From: Baptiste L. <bl...@us...> - 2004-06-19 15:25:52
|
Update of /cvsroot/cpptool/CppParser/examples/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24520/examples/parser Modified Files: symboldeclarator.cpp Log Message: * updated to work with the new parser production Index: symboldeclarator.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/symboldeclarator.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** symboldeclarator.cpp 8 Jun 2004 20:23:18 -0000 1.1.1.1 --- symboldeclarator.cpp 19 Jun 2004 15:25:43 -0000 1.2 *************** *** 43,47 **** SymbolDeclarator::declareTranslationUnit( const NodePtr &translationUnit ) { ! declareDeclarationSequence( translationUnit, *symbolTable_.translationUnitScope( currentFile() ) ); } --- 43,47 ---- SymbolDeclarator::declareTranslationUnit( const NodePtr &translationUnit ) { ! declareDeclarationSequence( safeGetChild( translationUnit, "declarations" ), *symbolTable_.translationUnitScope( currentFile() ) ); } *************** *** 104,109 **** Scope &parentScope ) { NodePtr unqualifiedId = safeGetChild( declaratorId, "unqualified_id" ); ! TypePtr type = makeType( typedefSpecifier, parentScope ); Symbol typedefSymbol( getChildSymbol( unqualifiedId ) ); SymbolDeclarationPtr declaration = symbolTable_.declare( typedefSymbol ); --- 104,110 ---- Scope &parentScope ) { + NodePtr typeSpecifier = safeGetChild( typedefSpecifier, "type_specifier" ); NodePtr unqualifiedId = safeGetChild( declaratorId, "unqualified_id" ); ! TypePtr type = makeType( typeSpecifier, parentScope ); Symbol typedefSymbol( getChildSymbol( unqualifiedId ) ); SymbolDeclarationPtr declaration = symbolTable_.declare( typedefSymbol ); *************** *** 118,127 **** Scope &parentScope ) { // really a sequence that need to be composited..., but we go the easy way for now ! NodePtr classSpecifier = getChild( declarationSpecifier, "class_specifier" ); if ( classSpecifier ) declareClass( classSpecifier, parentScope ); ! NodePtr forwardClassSpecifier = getChild( declarationSpecifier, "forward_class_specifier" ); if ( forwardClassSpecifier ) declareForwardClass( forwardClassSpecifier, parentScope ); --- 119,130 ---- Scope &parentScope ) { + NodePtr typeSpecifier = safeGetChild( declarationSpecifier, "type_specifier" ); + // really a sequence that need to be composited..., but we go the easy way for now ! NodePtr classSpecifier = getChild( typeSpecifier, "class_specifier" ); if ( classSpecifier ) declareClass( classSpecifier, parentScope ); ! NodePtr forwardClassSpecifier = getChild( typeSpecifier, "forward_class_specifier" ); if ( forwardClassSpecifier ) declareForwardClass( forwardClassSpecifier, parentScope ); *************** *** 286,292 **** parentScope.add( namespaceScope ); ! NodePtr body = getChild( namespaceDeclaration, "namespace_body" ); ! if ( body ) ! declareDeclarationSequence( body, *namespaceScope ); } --- 289,294 ---- parentScope.add( namespaceScope ); ! NodePtr body = safeGetChild( namespaceDeclaration, "declarations" ); ! declareDeclarationSequence( body, *namespaceScope ); } |