From 7d929dc69d724062c931f44266166c2ef2ed341a Mon Sep 17 00:00:00 2001 From: cas Date: Mon, 15 Nov 1999 18:00:27 +0000 Subject: [PATCH] No comments --- src/CDLFront/CDL.lex | 4 ++++ src/CDLFront/CDL.yacc | 23 +++++++++++++++++------ src/CDLFront/CDLFront.cxx | 9 +++++++++ 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/CDLFront/CDL.lex b/src/CDLFront/CDL.lex index ab910ad..8fa5010 100755 --- a/src/CDLFront/CDL.lex +++ b/src/CDLFront/CDL.lex @@ -48,6 +48,7 @@ FUNCTIONCALL [-][-][-][C][+][+][ \t]*[:][ \t]*[f][u][n][c][t][i][o][n][ \t]*[ /* The identifiers without underscore at begining and end */ IDENTIFIER [A-Za-z][A-Za-z0-9_]*[A-Za-z0-9] +JAVAIDENTIFIER [A-Za-z][A-Za-z0-9_.]*[A-Za-z0-9] /* Integer and real */ @@ -140,6 +141,9 @@ as[ \t]*object { return(object); } [A-Za-z] { strncpy(CDLlval.str,CDLtext,MAX_CHAR); return(IDENTIFIER); } +{JAVAIDENTIFIER} { strncpy(CDLlval.str,CDLtext,MAX_CHAR); + return(JAVAIDENTIFIER); } + {INTEGER} { strncpy (CDLlval.str,CDLtext,MAX_CHAR); return(INTEGER); } diff --git a/src/CDLFront/CDL.yacc b/src/CDLFront/CDL.yacc index 27d478d..c300ef7 100755 --- a/src/CDLFront/CDL.yacc +++ b/src/CDLFront/CDL.yacc @@ -24,7 +24,6 @@ #define CDL_EXTERNAL 6 #include - #include extern void CDLerror ( char* ); @@ -92,6 +91,7 @@ extern int CDLlex ( void ); %token ',' %token '=' %token IDENTIFIER +%token JAVAIDENTIFIER %token INTEGER %token LITERAL %token REAL @@ -101,7 +101,7 @@ extern int CDLlex ( void ); char str[MAX_STRING]; } -%type __Package_Name Package_Name Interface_Name __Interface_Name __Schema_Name __ExecFile_Name IDENTIFIER INTEGER REAL STRING LITERAL Schema_Name ExecFile_Name Empty_Str Engine_Name __Engine_Name Component_Name __Component_Name +%type __Package_Name Package_Name Interface_Name __Interface_Name __Schema_Name __ExecFile_Name IDENTIFIER JAVAIDENTIFIER INTEGER REAL STRING LITERAL Schema_Name ExecFile_Name Empty_Str Engine_Name __Engine_Name Component_Name __Component_Name Client_Name %start __Cdl_Declaration_List %% @@ -277,17 +277,28 @@ Component_Interface : interface IDENTIFIER CDL_from IDENTIFIER ';' { Component_I /*==========================================================================*/ /*==== Client definition ==================================================*/ /*==========================================================================*/ -Client_Declaration : client Client_Name +Client_Declaration : client Client_Name { Client_Begin($2); } + __Client_Uses is __Client_Definitions end __Client_End ';' ; -Client_Name : IDENTIFIER { Client_Begin($1); } +Client_Name : JAVAIDENTIFIER + | IDENTIFIER + ; + +__Client_Uses : Empty + | uses ClientUse_List ; -__Client_End : Empty - | IDENTIFIER { Client_End(); } +ClientUse_List : Client_Name { Client_Use ( $1 ); } + | ClientUse_List ',' Client_Name { Client_Use ( $3 ); } + ; + +__Client_End : Empty + | IDENTIFIER { Client_End(); } + | JAVAIDENTIFIER { Client_End(); } ; __Client_Definitions : Empty diff --git a/src/CDLFront/CDLFront.cxx b/src/CDLFront/CDLFront.cxx index d982626..e903e78 100755 --- a/src/CDLFront/CDLFront.cxx +++ b/src/CDLFront/CDLFront.cxx @@ -1081,6 +1081,15 @@ void Interface_Use(char*aPackageName) Interface->Use(aPackName); } +void Client_Use ( char* aClientName ) { + + Handle( TCollection_HAsciiString ) aCltName = + new TCollection_HAsciiString ( aClientName ); + + Client -> Use ( aCltName ); + +} // end Client_Use + void Interface_Package(char *aPackageName) { Handle(TCollection_HAsciiString) aPackName = new TCollection_HAsciiString(aPackageName); -- 2.39.5