From 63aa41447e7e0dfcdfd4b245e5bb740bb2cccfec Mon Sep 17 00:00:00 2001 From: cascade Date: Fri, 9 Sep 2005 21:47:22 +0000 Subject: [PATCH] OCC9462 Changing approach at Reference Documentation production cdl,hxx,cxx,tcl,edl Modifications in WOK that allow to extract documentation blocks --- src/CDLFront/CDL.lex | 104 ++++++++++---------- src/CDLFront/CDLFront.cxx | 177 ++++++++++++++++++++++++++++------- src/CDLFront/cdl_defines.hxx | 5 + src/CDLFront/cdl_rules.h | 2 + 4 files changed, 207 insertions(+), 81 deletions(-) diff --git a/src/CDLFront/CDL.lex b/src/CDLFront/CDL.lex index 8fa5010..67e98ae 100755 --- a/src/CDLFront/CDL.lex +++ b/src/CDLFront/CDL.lex @@ -13,7 +13,10 @@ #endif /* WNT */ #include -void add_cpp_comment(int,char*); +void add_cpp_comment(int, char*); +void add_documentation(char*); +void add_documentation1(char*); + #define yylval CDLlval #include int CDLlineno; @@ -30,6 +33,8 @@ extern void CDLerror ( char* ); /* The specials key words */ COMMENTER [-][-] +DOCUMENTATION [-][-][-][ \t]?[P][u][r][p][o][s][e].*[\n] +DOCUMENTATION1 [-]{2,}[ \t]{1,}.*[\n] FCPLUSPLUS [-][-][-][C][+][+][ \t]* CPLUSPLUS [-][-][-][C][+][+][ \t]*[:][ \t]* FCPLUSPLUSD [-][-][-][C][+][+][ \t]*[2][.][0][ \t]* @@ -68,54 +73,56 @@ STRING \"(\\\"|[^"])*\" /* %o 10000 */ /* The rules section execfile { return(execfile); }*/ +%s DOC_BLOCK %% -{REF}\n { add_cpp_comment(CDL_REF,CDLtext); CDLlineno++; } -{CONSTREF}\n { add_cpp_comment(CDL_CONSTREF,CDLtext); CDLlineno++; } -{CONSTRET}\n { add_cpp_comment(CDL_CONSTRET,CDLtext); CDLlineno++; } -{DESTRUCTOR}\n { add_cpp_comment(CDL_DESTRUCTOR,CDLtext); CDLlineno++; } -{INLINE}\n { add_cpp_comment(CDL_INLINE,CDLtext); CDLlineno++; } -{OPERATOR}.*\n { add_cpp_comment(CDL_OPERATOR,CDLtext); CDLlineno++; } -{HARDALIAS}\n { add_cpp_comment(CDL_HARDALIAS,CDLtext); CDLlineno++; } -{FUNCTIONCALL}\n { add_cpp_comment(CDL_FUNCTIONCALL,CDLtext); CDLlineno++; } -{CPLUSPLUSD}.*\n { CDLlineno++; CDLerror("C++2.0 directive no more supported."); } -{FCPLUSPLUSD}.*\n { CDLlineno++; CDLerror("C++2.0 directive no more supported (':' missing)."); } -{CPLUSPLUSD1}.*\n { CDLlineno++; CDLerror("C++2.1 directive no more supported."); } -{FCPLUSPLUSD1}.*\n { CDLlineno++; CDLerror("C++2.1 directive no more supported (':' missing)."); } -{CPLUSPLUS}\n { CDLlineno++; CDLerror("Empty C++ directive."); } -{FCPLUSPLUS}.*\n { CDLlineno++; CDLerror("C++ directive without ':'."); } -{COMMENTER}.*\n { CDLlineno++; } - - -alias { return(alias); } -any { return(any); } -asynchronous { return(asynchronous); } -as { return(as); } -class { return(class); } -client { return(client); } -component { return(component); } -deferred { return(deferred); } -schema { return(schema); } -end { return(end); } -engine { return(engine); } -enumeration { return(enumeration); } -exception { return(exception); } -executable { return(executable); } -fields { return(fields); } -friends { return(friends); } -from { return(CDL_from); } -generic { return(generic); } -immutable { return(immutable); } -imported { return(imported); } -in { return(in); } -inherits { return(inherits); } -instantiates { return(instantiates); } -interface { return(interface); } -is { return(is); } -like { return(like); } -me { return(me); } -mutable { return(mutable); } +{DOCUMENTATION} { add_documentation(CDLtext); BEGIN(DOC_BLOCK); CDLlineno++; } +{DOCUMENTATION1} { add_documentation1(CDLtext); CDLlineno++; } +{REF}\n { add_cpp_comment(CDL_REF,CDLtext); CDLlineno++; BEGIN(0);} +{CONSTREF}\n { add_cpp_comment(CDL_CONSTREF,CDLtext); CDLlineno++; BEGIN(0); } +{CONSTRET}\n { add_cpp_comment(CDL_CONSTRET,CDLtext); CDLlineno++; BEGIN(0); } +{DESTRUCTOR}\n { add_cpp_comment(CDL_DESTRUCTOR,CDLtext); CDLlineno++; BEGIN(0);} +{INLINE}\n { add_cpp_comment(CDL_INLINE,CDLtext); CDLlineno++; BEGIN(0);} +{OPERATOR}.*\n { add_cpp_comment(CDL_OPERATOR,CDLtext); CDLlineno++; BEGIN(0); } +{HARDALIAS}\n { add_cpp_comment(CDL_HARDALIAS,CDLtext); CDLlineno++; BEGIN(0); } +{FUNCTIONCALL}\n { add_cpp_comment(CDL_FUNCTIONCALL,CDLtext); CDLlineno++; BEGIN(0); } +{CPLUSPLUSD}.*\n { CDLlineno++; CDLerror("C++2.0 directive no more supported."); BEGIN(0); } +{FCPLUSPLUSD}.*\n { CDLlineno++; CDLerror("C++2.0 directive no more supported (':' missing)."); BEGIN(0);} +{CPLUSPLUSD1}.*\n { CDLlineno++; CDLerror("C++2.1 directive no more supported."); BEGIN(0);} +{FCPLUSPLUSD1}.*\n { CDLlineno++; CDLerror("C++2.1 directive no more supported (':' missing)."); BEGIN(0);} +{CPLUSPLUS}\n { CDLlineno++; CDLerror("Empty C++ directive."); BEGIN(0); } +{FCPLUSPLUS}.*\n { CDLlineno++; CDLerror("C++ directive without ':'."); BEGIN(0);} +{COMMENTER}.*\n { CDLlineno++; BEGIN(0); } + +alias { BEGIN(0); return(alias); } +any { BEGIN(0); return(any); } +asynchronous { BEGIN(0); return(asynchronous); } +as { BEGIN(0); return(as); } +class { BEGIN(0); return(class); } +client { BEGIN(0); return(client); } +component { BEGIN(0); return(component); } +deferred { BEGIN(0); return(deferred); } +schema { BEGIN(0); return(schema); } +end { BEGIN(0); return(end); } +engine { BEGIN(0); return(engine); } +enumeration { BEGIN(0); return(enumeration); } +exception { BEGIN(0); return(exception); } +executable { BEGIN(0); return(executable); } +fields { BEGIN(0); return(fields); } +friends { BEGIN(0); return(friends); } +from { BEGIN(0); return(CDL_from); } +generic { BEGIN(0); return(generic); } +immutable { BEGIN(0); return(immutable); } +imported { BEGIN(0); return(imported); } +in { BEGIN(0); return(in); } +inherits { BEGIN(0); return(inherits); } +instantiates { BEGIN(0); return(instantiates); } +interface { BEGIN(0); return(interface); } +is { BEGIN(0); return(is); } +like { BEGIN(0); return(like); } +me { BEGIN(0); return(me); } +mutable { BEGIN(0); return(mutable); } myclass { return(myclass); } out { return(out); } package { return(package); } @@ -132,7 +139,7 @@ uses { return(uses); } virtual { return(virtual); } library { return(library); } external { return(external); } -as[ \t]*[c][+][+] { return(cpp); } +as[ \t]*[c][+][+] { BEGIN(0); return(cpp); } as[ \t]*c { return(krc); } as[ \t]*fortran { return(fortran); } as[ \t]*object { return(object); } @@ -167,7 +174,7 @@ as[ \t]*object { return(object); } "=" { return('='); } [ \t] { /* We don't take care of line feed, space or tabulation */ } -[\n] { CDLlineno++; } +[\n] { CDLlineno++; BEGIN(0);} . { return(INVALID); } %% @@ -189,6 +196,7 @@ static Comment() strcpy(&comment[comment_nb],CDLtext); comment_nb += size; new_comment = 1; + cout << comment << endl; } } diff --git a/src/CDLFront/CDLFront.cxx b/src/CDLFront/CDLFront.cxx index e903e78..a21d8a6 100755 --- a/src/CDLFront/CDLFront.cxx +++ b/src/CDLFront/CDLFront.cxx @@ -157,7 +157,13 @@ extern int CDLlineno; #else extern "C" int CDLlineno; #endif // WNT - + +#ifndef WNT +extern FILE *CDLin; +#else +extern "C" FILE *CDLin; +#endif // WNT + // The Flags // static Standard_Boolean Private = Standard_False, @@ -329,6 +335,7 @@ Handle(TColStd_HSequenceOfHAsciiString) ListOfPackages = new TColStd_HSequenceO Handle(TColStd_HSequenceOfHAsciiString) ListOfItem = new TColStd_HSequenceOfHAsciiString; Handle(TColStd_HSequenceOfHAsciiString) ListOfName = new TColStd_HSequenceOfHAsciiString; Handle(TColStd_HSequenceOfHAsciiString) ListOfCplusplus = new TColStd_HSequenceOfHAsciiString; +Handle(TColStd_HSequenceOfHAsciiString) ListOfComments = new TColStd_HSequenceOfHAsciiString; Handle(TColStd_HSequenceOfInteger) ListOfCPPType = new TColStd_HSequenceOfInteger; Handle(TColStd_HSequenceOfHAsciiString) ListOfInteger = new TColStd_HSequenceOfHAsciiString; @@ -421,6 +428,7 @@ void CDL_InitVariable() ListOfItem = new TColStd_HSequenceOfHAsciiString; ListOfName = new TColStd_HSequenceOfHAsciiString; ListOfCplusplus = new TColStd_HSequenceOfHAsciiString; + ListOfComments = new TColStd_HSequenceOfHAsciiString; ListOfCPPType = new TColStd_HSequenceOfInteger; ListOfInteger = new TColStd_HSequenceOfHAsciiString; ListOfGlobalUsed.Nullify(); @@ -521,6 +529,10 @@ Standard_Boolean VerifyClassUses(const Handle(TCollection_HAsciiString)& thetype } } + //for (i = 1; i <= ListOfComments->Length(); i++ ) { + // SimpleClass->SetComment(ListOfComments->Value(i)); + //} + ErrorMsg << "CDL" << "\"" << CDLFileName->ToCString() << "\"" << ", line " << CDLlineno << ": " << "The 'uses' statement of your class has no declaration of : " << thetypename << endm; YY_nb_error++; } @@ -538,10 +550,15 @@ Standard_Boolean VerifyUses(char* used) Handle(MS_Engine) anEngine; Handle(MS_Component) aComponent; Standard_Boolean status = Standard_False; - + Standard_Integer i; + if (theMetaSchema->IsPackage(Container)) { aPackage = theMetaSchema->GetPackage(Container); aSeqOfPackage = aPackage->Uses(); + //for (i = 1; i <= ListOfComments->Length(); i++ ) { + //aPackage->SetComment(ListOfComments->Value(i)); + //} + } else if (theMetaSchema->IsInterface(Container)) { anInterface = theMetaSchema->GetInterface(Container); @@ -556,12 +573,13 @@ Standard_Boolean VerifyUses(char* used) aSeqOfPackage = aComponent->Uses(); } - for (Standard_Integer i = 1; i <= aSeqOfPackage->Length() && (status == 0); i++) { + for (i = 1; i <= aSeqOfPackage->Length() && (status == 0); i++) { if (strcmp(aSeqOfPackage->Value(i)->ToCString(),used) == 0) { status = Standard_True; } } - + ListOfComments->Clear(); + return status; } else return Standard_True; @@ -576,6 +594,7 @@ void Type_Pack(char *aName) msg->AssignCat(Container); CDLerror(msg->ToCString()); } + strncpy(Pack_Name,aName,MAX_CHAR); } @@ -589,12 +608,11 @@ char *TypeCompletion(char *aName) Handle(TCollection_HAsciiString) aPackageName, thethetypename = new TCollection_HAsciiString(aName); - if (SimpleClass->Name()->IsSameString(thethetypename)) { + if (SimpleClass->Name()->IsSameString(thethetypename)) { return Container->ToCString(); - } + } aSeqOfPackage = SimpleClass->GetUsesNames(); - for (i = 1; i <= aSeqOfPackage->Length(); i++) { aPackageName = aSeqOfPackage->Value(i)->Token("_"); if (aSeqOfPackage->Value(i)->IsSameString(MS::BuildFullName(aPackageName,thethetypename))) { @@ -697,6 +715,7 @@ void Type_Pack_Blanc() else { Type_Pack(Container->ToCString()); } + } void Add_Type() @@ -708,6 +727,37 @@ void Add_Type() ListOfPackages->Append(aPackName); } +void add_documentation(char *comment) +{ + Handle(TCollection_HAsciiString) aComment; + Handle(TCollection_HAsciiString) aRealComment; + Standard_Integer pos; + aComment = new TCollection_HAsciiString(comment); + pos = aComment->Location(1,':',1,aComment->Length()); + aRealComment = aComment->SubString(pos + 1, aComment->Length()); + aRealComment->LeftAdjust(); + if (!aRealComment->IsEmpty()) { + aRealComment->Insert(aRealComment->Length(), "
"); + aRealComment->Insert(1,"///"); + ListOfComments->Append(aRealComment); + } +} + +void add_documentation1(char *comment) +{ + Handle(TCollection_HAsciiString) aComment; + Handle(TCollection_HAsciiString) aRealComment; + aComment = new TCollection_HAsciiString(comment); + aRealComment = aComment; + aRealComment->RemoveAll('-'); + aRealComment->Insert(aRealComment->Length(), "
"); + aRealComment->Insert(1,"///"); + if (!aRealComment->IsEmpty()) { + aRealComment->LeftAdjust(); + ListOfComments->Append(aRealComment); + } +} + void add_cpp_comment(int cpptype, char *comment) { Handle(TCollection_HAsciiString) aComment; @@ -718,10 +768,10 @@ void add_cpp_comment(int cpptype, char *comment) YY_nb_warning++; } else { - // cout << Method->Name()->ToCString() << " " << comment << endl; + //cout << Method->Name()->ToCString() << " " << comment << endl; if (cpptype == CDL_HARDALIAS || cpptype == CDL_OPERATOR) { Standard_Integer pos; - aComment = new TCollection_HAsciiString(comment), + aComment = new TCollection_HAsciiString(comment); pos = aComment->Location(1,':',1,aComment->Length()); aRealComment = aComment->SubString(pos + 1,aComment->Length()); @@ -760,7 +810,7 @@ void Make_List_Int(char *anInt) void Schema_Begin(char *name) { Handle(TCollection_HAsciiString) aSchemaName = new TCollection_HAsciiString(name); - + Schema = new MS_Schema(aSchemaName); Schema->MetaSchema(theMetaSchema); Container = aSchemaName; @@ -769,13 +819,18 @@ void Schema_Begin(char *name) ErrorMsg << "CDL" << "\"" << CDLFileName->ToCString() << "\"" << ", line " << CDLlineno << ": " << "Schema : " << aSchemaName << " is already defined." << endm; YY_nb_error++; } + ListOfComments->Clear(); } void Schema_Package(char *name) { + Standard_Integer i; Handle(TCollection_HAsciiString) aName = new TCollection_HAsciiString(name); - Schema->Package(aName); + for(i = 1; i <= ListOfComments->Length(); i++) { + Schema->SetComment(ListOfComments->Value(i)); + } + ListOfComments->Clear(); } void Schema_Class() @@ -1158,6 +1213,9 @@ void Interface_End() // void Pack_Begin(char *aPackageName) { + + Standard_Integer i; + Handle(TCollection_HAsciiString) aPackName = new TCollection_HAsciiString(aPackageName); Container = aPackName; @@ -1165,22 +1223,34 @@ void Pack_Begin(char *aPackageName) Package = new MS_Package(aPackName); Package->MetaSchema(theMetaSchema); - + + for (i = 1; i <= ListOfComments->Length(); i++) { + Package->SetComment(ListOfComments->Value(i)); + } + if (!theMetaSchema->AddPackage(Package)) { ErrorMsg << "CDL" << "\"" << CDLFileName->ToCString() << "\"" << ", line " << CDLlineno << ": " << "Package : " << aPackageName << " is already defined." << endm; YY_nb_error++; } Package->Use(MS::GetPackageRootName()); + + Current_Entity = CDL_PACKAGE; + ListOfComments->Clear(); + } void Pack_Use(char *aPackageName) { Handle(TCollection_HAsciiString) aPackName = new TCollection_HAsciiString(aPackageName); + for (Standard_Integer i = 1; i <= ListOfComments->Length(); i++) { + Package->SetComment(ListOfComments->Value(i)); + } ListOfGlobalUsed->Append(aPackName); Package->Use(aPackName); - + ListOfComments->Clear(); + } void Pack_End() @@ -1189,6 +1259,8 @@ void Pack_End() Package.Nullify(); ListOfTypes->Clear(); ListOfPackages->Clear(); + ListOfComments->Clear(); + } // The actions for the classes @@ -1262,7 +1334,7 @@ void Pointer_End() void Imported_Begin() { Handle(TCollection_HAsciiString) anImportedName = new TCollection_HAsciiString(thetypename); - + Imported = new MS_Imported(anImportedName,Container,Container,Private); Imported->MetaSchema(theMetaSchema); @@ -1285,7 +1357,7 @@ void Imported_End() void Prim_Begin() { Handle(TCollection_HAsciiString) aPrimName = new TCollection_HAsciiString(thetypename); - + Primitive = new MS_PrimType(aPrimName,Container,Container,Private); Primitive->MetaSchema(theMetaSchema); @@ -1371,11 +1443,15 @@ void Except_End() void Inc_Class_Dec() { + Standard_Integer i; Handle(TCollection_HAsciiString) aClassName = new TCollection_HAsciiString(thetypename); StdClass = new MS_StdClass(aClassName,Container); StdClass->MetaSchema(theMetaSchema); + for (i =1; i <= ListOfComments->Length(); i++) { + //StdClass->SetComment(ListOfComments->Value(i)); + } if (!theMetaSchema->AddType(StdClass)) { ErrorMsg << "CDL" << "\"" << CDLFileName->ToCString() << "\"" << ", line " << CDLlineno << ": " << "Class : " << StdClass->FullName() << " is already defined." << endm; @@ -1398,6 +1474,7 @@ void Inc_Class_Dec() Deferred = Standard_False; Redefined = Standard_False; Like = Standard_False; + ListOfComments->Clear(); } void Inc_GenClass_Dec() @@ -1519,6 +1596,7 @@ void GenClass_Begin() Deferred = Standard_False; Redefined = Standard_False; Like = Standard_False; + ListOfComments->Clear(); } void Add_GenType() @@ -1573,7 +1651,8 @@ void InstClass_Begin() { Handle(TCollection_HAsciiString) aPackName = Container; Handle(TCollection_HAsciiString) aClassName = new TCollection_HAsciiString(thetypename); - + Standard_Integer i; + if (Current_Entity == CDL_GENCLASS) { aPackName = GenClass->Package()->Name(); } @@ -1596,6 +1675,10 @@ void InstClass_Begin() InstClass->MetaSchema(theMetaSchema); + for (i =1; i <= ListOfComments->Length(); i++) { + //InstClass->SetComment(ListOfComments->Value(i)); + } + if (!theMetaSchema->IsDefined(InstClass->FullName()) || Current_Entity == CDL_GENCLASS) { if (Current_Entity == CDL_GENCLASS && theMetaSchema->IsDefined(InstClass->FullName())) { theMetaSchema->RemoveType(InstClass->FullName(),Standard_False); @@ -1640,6 +1723,7 @@ void InstClass_Begin() ListOfTypes->Clear(); ListOfPackages->Clear(); + ListOfComments->Clear(); } void Add_Gen_Class() @@ -1730,7 +1814,6 @@ void DynaType_Begin() SaveState = Current_Entity; Current_Entity = CDL_GENTYPE; - if (! ListOfItem->IsEmpty()) { Standard_Integer i; Handle(TCollection_HAsciiString) aPackName; @@ -1768,24 +1851,23 @@ void StdClass_Begin() { Handle(TCollection_HAsciiString) aClassName = new TCollection_HAsciiString(thetypename); Handle(TCollection_HAsciiString) aPackName = new TCollection_HAsciiString(Pack_Name); + Standard_Integer i; if (Current_Entity == CDL_GENCLASS) { aPackName = GenClass->Package()->Name(); } Container = aPackName; - + if (!theMetaSchema->IsPackage(Container)) { ErrorMsg << "CDL" << "\"" << CDLFileName->ToCString() << "\"" << ", line " << CDLlineno << ": " << "Unknown package " << Container << endm; YY_nb_error++; CDL_InitVariable(); MS_TraductionError::Raise("Unknown package."); } - // si la classe n a pas ete cree par une dec incomplete // StdClass = new MS_StdClass(aClassName,aPackName); - StdClass->MetaSchema(theMetaSchema); if (!theMetaSchema->IsDefined(StdClass->FullName()) || Current_Entity == CDL_GENCLASS) { @@ -1853,9 +1935,12 @@ void StdClass_Begin() if (Current_Entity != CDL_GENCLASS) { Current_Entity = CDL_STDCLASS; } + for (i =1; i <= ListOfComments->Length(); i++) { + StdClass->SetComment(ListOfComments->Value(i)); + } SimpleClass = StdClass; - + Private = Standard_False; Protected = Standard_False; Static = Standard_True; @@ -1865,6 +1950,8 @@ void StdClass_Begin() ListOfTypes->Clear(); ListOfPackages->Clear(); + ListOfComments->Clear(); + } void Add_Std_Ancestors() @@ -1903,15 +1990,26 @@ void Add_Std_Ancestors() YY_nb_error++; } } - + //SimpleClass->MetaSchema(theMetaSchema); + for (i =1; i <= ListOfComments->Length(); i++) { + SimpleClass->SetComment(ListOfComments->Value(i)); + } + ListOfTypes->Clear(); ListOfPackages->Clear(); + ListOfComments->Clear(); } void Add_Std_Uses() { - Standard_Integer i; - + Standard_Integer i; + + + //SimpleClass->MetaSchema(theMetaSchema); + for (i =1; i <= ListOfComments->Length(); i++) { + SimpleClass->SetComment(ListOfComments->Value(i)); + } + for (i = 1; i <= ListOfTypes->Length(); i++) { Handle(TCollection_HAsciiString) aFullName = MS::BuildFullName(ListOfPackages->Value(i),ListOfTypes->Value(i)); @@ -1931,6 +2029,7 @@ void Add_Std_Uses() ListOfTypeUsed->Append(aFullName); } + ListOfComments->Clear(); ListOfTypes->Clear(); ListOfPackages->Clear(); } @@ -1946,6 +2045,7 @@ void StdClass_End() StdClass.Nullify(); ListOfTypes->Clear(); ListOfPackages->Clear(); + ListOfComments->Clear(); } @@ -2052,14 +2152,18 @@ WOKTools_MapOfHAsciiString anEnumMap; void Enum_Begin() { Handle(TCollection_HAsciiString) anEnumName = new TCollection_HAsciiString(thetypename); - + Standard_Integer i; + anEnumMap.Clear(); Enum = new MS_Enum(anEnumName,Container,Container,Private); Enum->MetaSchema(theMetaSchema); Enum->Package(Package->FullName()); - + for(i = 1; i <= ListOfComments->Length(); i++) { + Enum->SetComment(ListOfComments->Value(i)); + } + ListOfComments->Clear(); if (!theMetaSchema->AddType(Enum)) { ErrorMsg << "CDL" << "\"" << CDLFileName->ToCString() << "\"" << ", line " << CDLlineno << ": " << "Enumeration : " << Enum->FullName() << " is already defined." << endm; YY_nb_error++; @@ -2070,7 +2174,11 @@ void Enum_Begin() void Add_Enum(char *aValue) { Handle(TCollection_HAsciiString) anEnumValue = new TCollection_HAsciiString(aValue); - + for(Standard_Integer i = 1; i <= ListOfComments->Length(); i++) { + Enum->SetComment(ListOfComments->Value(i)); + } + ListOfComments->Clear(); + if (!anEnumMap.Contains(anEnumValue)) { anEnumMap.Add(anEnumValue); Enum->Enum(anEnumValue); @@ -2085,6 +2193,10 @@ void Enum_End() { //Enum->Check(); Package->Enum(Enum->Name()); + for(Standard_Integer i = 1; i <= ListOfComments->Length(); i++) { + Enum->SetComment(ListOfComments->Value(i)); + } + ListOfComments->Clear(); Enum.Nullify(); anEnumMap.Clear(); @@ -2121,6 +2233,9 @@ void add_cpp_comment_to_method() Standard_Integer i; Handle(TCollection_HAsciiString) aCP; + for(i = 1; i <= ListOfComments->Length(); i++) { + Method->SetComment(ListOfComments->Value(i)); + } for(i = 1; i <= ListOfCplusplus->Length(); i++) { aCommentType = ListOfCPPType->Value(i); @@ -2184,6 +2299,7 @@ void add_cpp_comment_to_method() break; } } + ListOfComments->Clear(); ListOfCplusplus->Clear(); ListOfCPPType->Clear(); theMetaSchema->AddMethod(Method); @@ -2635,11 +2751,6 @@ void CDL_Main() extern "C" { void CDLrestart(FILE*); } -#ifndef WNT -extern FILE *CDLin; -#else -extern "C" FILE *CDLin; -#endif // WNT int TraductionMain(char *FileName) { @@ -2712,7 +2823,7 @@ int CDLTranslate(const Handle(MS_MetaSchema)& aMetaSchema, ListOfTypeUsed.Nullify(); ListOfInst.Nullify(); ListOfGen.Nullify(); - + ListOfComments.Nullify(); return ErrorLevel; } diff --git a/src/CDLFront/cdl_defines.hxx b/src/CDLFront/cdl_defines.hxx index 07a0c59..9954eb5 100755 --- a/src/CDLFront/cdl_defines.hxx +++ b/src/CDLFront/cdl_defines.hxx @@ -11,3 +11,8 @@ #define CDL_REF 6 #define CDL_HARDALIAS 7 #define CDL_FUNCTIONCALL 8 +#define CDL_COMMENT 9 + + + + diff --git a/src/CDLFront/cdl_rules.h b/src/CDLFront/cdl_rules.h index 787ae89..f62afae 100755 --- a/src/CDLFront/cdl_rules.h +++ b/src/CDLFront/cdl_rules.h @@ -17,6 +17,8 @@ void Make_List_Int(char*); void set_inc_state(); void restore_state(); void add_cpp_comment(int,char*); +void add_documentation(char*); +void add_documentation1(char*); /*=-=-=-=-=-=-=-=-= The actions for the Package =-=-=-=-=-=-=-=-=-=-=-=-=-=*/ void Pack_Begin(char*); -- 2.39.5