You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(15) |
Feb
(26) |
Mar
(97) |
Apr
(224) |
May
(226) |
Jun
|
Jul
(3) |
Aug
(22) |
Sep
(48) |
Oct
|
Nov
|
Dec
(38) |
2004 |
Jan
(28) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(37) |
Jul
|
Aug
(73) |
Sep
|
Oct
|
Nov
|
Dec
|
Update of /cvsroot/cpptool/CppParser/examples/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17570/examples/parser Modified Files: symboldeclarator.h grammar_tree.txt scope.cpp scope.h symboldeclarator.cpp cpp_grammar.txt cppparsertest.cpp symboltabletest.cpp Log Message: * in the process of adding enum support to symbol table * refactored grammar for better enum tree structure Index: cpp_grammar.txt =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/cpp_grammar.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** cpp_grammar.txt 19 Jun 2004 14:55:52 -0000 1.6 --- cpp_grammar.txt 21 Jun 2004 13:49:30 -0000 1.7 *************** *** 403,407 **** enum_specifier = :node( 'enum_specifier', ! 'enum' ?(id) '{' ?( list(enumerator_definition, ',') ) '}' ); forwarded_type_id = :node( 'forwarded_type_id', --- 403,410 ---- enum_specifier = :node( 'enum_specifier', ! 'enum' ?(id) '{' ! :node( 'enumerator_definitions', ! ?( list(enumerator_definition, ',') ) ) ! '}' ); forwarded_type_id = :node( 'forwarded_type_id', Index: symboldeclarator.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/symboldeclarator.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** symboldeclarator.cpp 20 Jun 2004 11:00:38 -0000 1.3 --- symboldeclarator.cpp 21 Jun 2004 13:49:30 -0000 1.4 *************** *** 131,134 **** --- 131,138 ---- if ( forwardClassSpecifier ) declareForwardClass( forwardClassSpecifier, parentScope ); + + NodePtr enumSpecifier = getChild( typeSpecifier, "enum_specifier" ); + if ( enumSpecifier ) + declareEnumerator( enumSpecifier, parentScope ); } *************** *** 306,308 **** --- 310,339 ---- } + + void + SymbolDeclarator::declareEnumerator( const NodePtr &enumSpecifier, + Scope &parentScope ) + { + Symbol enumSymbol( getChildSymbol( enumSpecifier ) ); + SymbolDeclarationPtr declaration = symbolTable_.declare( enumSymbol ); + EnumScopePtr enumScope( new EnumScope( declaration ) ); + declaration->setScope( enumScope ); + parentScope.add( enumScope ); // should be actual nested scope + // @todo setScope in declaration + + NodePtr definitions = safeGetChild( enumSpecifier, "enumerator_definitions" ); + NodeEnumerator enumDefinition = definitions->enumChildren(); + while ( enumDefinition.hasNext() ) + { + NodePtr definition = enumDefinition.nextPtr(); + if ( definition->name() == ConstString("enumerator_definition") ) + { + Symbol valueSymbol( getChildSymbol( definition ) ); + SymbolDeclarationPtr valueDeclaration = symbolTable_.declare( valueSymbol ); + enumScope->addValue( valueDeclaration ); + //parentScope.add( + } + } + } + } // namespace Parser Index: cppparsertest.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/cppparsertest.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** cppparsertest.cpp 19 Jun 2004 14:55:52 -0000 1.6 --- cppparsertest.cpp 21 Jun 2004 13:49:30 -0000 1.7 *************** *** 1099,1102 **** --- 1099,1103 ---- CPPPARSER_ASSERT_TREE( "enum MyEnumType{v1=1,v2=v1<<1,v3=v2<<1}", "enum_specifier", testNode( "enum_specifier", "enum", spaces_t(1), id_t("MyEnumType"), "{", + testNode( "enumerator_definitions", testNode( "enumerator_definition", id_t("v1"), "=", jokerNode( "constant_expression" ) ), *************** *** 1106,1110 **** ",", testNode( "enumerator_definition", id_t("v3"), "=", ! jokerNode( "constant_expression" ) ), "}" ) ); } --- 1107,1111 ---- ",", testNode( "enumerator_definition", id_t("v3"), "=", ! jokerNode( "constant_expression" ) ) ), "}" ) ); } Index: scope.h =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/scope.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** scope.h 20 Jun 2004 11:00:38 -0000 1.3 --- scope.h 21 Jun 2004 13:49:30 -0000 1.4 *************** *** 15,18 **** --- 15,19 ---- class BlockScope; class ClassScope; + class EnumScope; class MemberFunctionScope; class NamespaceScope; *************** *** 21,24 **** --- 22,26 ---- class TypedefScope; typedef boost::shared_ptr<ClassScope> ClassScopePtr; + typedef boost::shared_ptr<EnumScope> EnumScopePtr; typedef boost::shared_ptr<MemberFunctionScope> MemberFunctionScopePtr; typedef boost::shared_ptr<NamespaceScope> NamespaceScopePtr; *************** *** 30,33 **** --- 32,37 ---- typedef boost::shared_ptr<Type> TypePtr; + typedef CppUT::Enumerator<SymbolDeclarationPtr> SymbolDeclarationPtrEnum; + class ScopeVisitor { *************** *** 36,39 **** --- 40,44 ---- virtual void visit( BlockScope &scope ) = 0; virtual void visit( ClassScope &scope ) = 0; + virtual void visit( EnumScope &scope ) = 0; virtual void visit( MemberFunctionScope &scope ) = 0; virtual void visit( NamespaceScope &scope ) = 0; *************** *** 217,220 **** --- 222,244 ---- }; + class EnumScope : public DeclarationScope + { + public: + EnumScope( const SymbolDeclarationPtr &declaration ); + + SymbolDeclarationPtrEnum values() const; + + void addValue( const SymbolDeclarationPtr &valueSymbol ); + + public: // overridden from Scope + void accept( ScopeVisitor &visitor ); + SymbolDeclarationPtr resolve( const std::string &name ) const; + SymbolDeclarationPtr memberResolve( const std::string &name ) const; + std::string str() const; + bool isTypeDeclaration() const; + + private: + std::deque<SymbolDeclarationPtr> values_; + }; class Type Index: grammar_tree.txt =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/grammar_tree.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** grammar_tree.txt 19 Jun 2004 15:25:16 -0000 1.3 --- grammar_tree.txt 21 Jun 2004 13:49:30 -0000 1.4 *************** *** 70,77 **** | enum_specifier[ id ! n enumerator_definition[ ! id ! constant_expression[...] ! ] ] | class_specifier[...] | forward_class_specifier[ --- 70,79 ---- | enum_specifier[ id ! enumerator_definitions[ ! n enumerator_definition[ ! id ! constant_expression[...] ! ] ] ! ] | class_specifier[...] | forward_class_specifier[ Index: scope.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/scope.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** scope.cpp 20 Jun 2004 11:00:38 -0000 1.3 --- scope.cpp 21 Jun 2004 13:49:30 -0000 1.4 *************** *** 492,495 **** --- 492,549 ---- + + // class EnumScope + // ////////////////////////////////////////////////////////////////// + + EnumScope::EnumScope( const SymbolDeclarationPtr &declaration ) + : DeclarationScope( declaration ) + { + } + + + SymbolDeclarationPtrEnum + EnumScope::values() const + { + return CppUT::enumStl( values_ ); + } + + void + EnumScope::addValue( const SymbolDeclarationPtr &valueSymbol ) + { + values_.push_back( valueSymbol ); + } + + + void + EnumScope::accept( ScopeVisitor &visitor ) + { + visitor.visit( *this ); + } + + SymbolDeclarationPtr + EnumScope::resolve( const std::string &name ) const + { + return SymbolDeclarationPtr(); + } + + SymbolDeclarationPtr + EnumScope::memberResolve( const std::string &name ) const + { + return SymbolDeclarationPtr(); + } + + std::string + EnumScope::str() const + { + return "EnumScope<name=" + declaration()->name() + ">"; + } + + + bool + EnumScope::isTypeDeclaration() const + { + return true; + } + // class FundamentalType // ////////////////////////////////////////////////////////////////// Index: symboldeclarator.h =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/symboldeclarator.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** symboldeclarator.h 20 Jun 2004 11:00:38 -0000 1.2 --- symboldeclarator.h 21 Jun 2004 13:49:30 -0000 1.3 *************** *** 45,48 **** --- 45,51 ---- Scope &parentScope ); + void declareEnumerator( const NodePtr &enumSpecifier, + Scope &parentScope ); + Symbol getChildSymbol( const NodePtr &node ) const; Index: symboltabletest.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/symboltabletest.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** symboltabletest.cpp 20 Jun 2004 15:53:41 -0000 1.6 --- symboltabletest.cpp 21 Jun 2004 13:49:30 -0000 1.7 *************** *** 46,49 **** --- 46,52 ---- void checkNamespace( const NodePtr &namespaceNode ); void checkAnonymousNamespace( const NodePtr &namespaceNode ); + void checkEnumeration( const NodePtr &enumerationNode ); + void checkEnumerationValues( const Parser::EnumScopePtr &enumScope, + const NodePtr &valuesNode ); CppUT::Message makeMessage( const NodePtr &node, *************** *** 185,190 **** else if ( child->specificationName() == "anonymous_namespace" ) checkAnonymousNamespace( child ); else ! CppUT::fail( makeMessage( child, "don't know how to check node type." ) ); } } --- 188,198 ---- else if ( child->specificationName() == "anonymous_namespace" ) checkAnonymousNamespace( child ); + else if ( child->specificationName() == "enumeration" ) + checkEnumeration( child ); else ! { ! CppUT::fail( makeMessage( child, ! "don't know how to check node type: " + child->specificationName() ) ); ! } } } *************** *** 284,287 **** --- 292,341 ---- } + + void + DeclarationChecker::checkEnumeration( const NodePtr &enumerationNode ) + { + std::string enumName = enumerationNode->braceValue(); + Parser::SymbolDeclarationPtr declaration = memberResolve( enumName ); + CppUT::checkTrue( declaration, makeMessage( enumerationNode, "Declaration not found." ) ); + checkReferences( enumerationNode, declaration ); + Parser::EnumScopePtr enumScope = boost::dynamic_pointer_cast<Parser::EnumScope>( declaration->scope() ); + CppUT::checkTrue( enumScope, makeMessage( enumerationNode, + "Declaration found is not an enum:" + + declaration->scope()->str() ) ); + if ( enumerationNode->hasChild("values") ) + checkEnumerationValues( enumScope, enumerationNode->child("values") ); + } + + + void + DeclarationChecker::checkEnumerationValues( const Parser::EnumScopePtr &enumScope, + const NodePtr &valuesNode ) + { + // enumerate all member of the enum, and make list of name + // make list of expect names + // sequence assert equal + + Parser::SymbolDeclarationPtrEnum enumValues = enumScope->values(); + std::deque<std::string> actualValues; + while ( enumValues.hasNext() ) + actualValues.push_back( enumValues.next()->name() ); + + std::deque<std::string> expectedValues; + NodeEnumerator enumNode( valuesNode->children() ); + while ( enumNode.hasNext() ) + expectedValues.push_back( enumNode.next()->braceValue() ); + + CppUT::checkStlSequenceEqual( expectedValues, actualValues, + makeMessage( valuesNode, "Enumerator values do not match." ) ); + + // for each expected value: + // resolve value name + // check type + // check initializer if any + // check declarations + // check references + } + } // anonymous namespace |
From: Baptiste L. <bl...@us...> - 2004-06-21 13:49:38
|
Update of /cvsroot/cpptool/CppParser/examples/parser/testdata/symbol_table In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17570/examples/parser/testdata/symbol_table Modified Files: enum1.txt enum2.txt __tests__.txt Log Message: * in the process of adding enum support to symbol table * refactored grammar for better enum tree structure Index: enum2.txt =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/testdata/symbol_table/enum2.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** enum2.txt 8 Jun 2004 20:23:19 -0000 1.1.1.1 --- enum2.txt 21 Jun 2004 13:49:29 -0000 1.2 *************** *** 1,12 **** ! ====file: enum1.cpp $Values.0$enum $Values.1$Values { v1 = 0, v2, v3 ! }; ====declarations: enumeration(Values) { ! declaration: $Values.0 references: $Values.1 values { --- 1,12 ---- ! ====file: enum2.cpp $Values.0$enum $Values.1$Values { v1 = 0, v2, v3 ! } value_; ====declarations: enumeration(Values) { ! declarations: $Values.0 references: $Values.1 values { *************** *** 16,18 **** --- 16,21 ---- } } + ##variable(value_) { + ## type: type(Values) + ##} ====end: Index: __tests__.txt =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/testdata/symbol_table/__tests__.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** __tests__.txt 20 Jun 2004 11:00:36 -0000 1.2 --- __tests__.txt 21 Jun 2004 13:49:29 -0000 1.3 *************** *** 7,8 **** --- 7,9 ---- typedef2.txt namespace3.txt + enum1.txt Index: enum1.txt =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/testdata/symbol_table/enum1.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** enum1.txt 8 Jun 2004 20:23:19 -0000 1.1.1.1 --- enum1.txt 21 Jun 2004 13:49:29 -0000 1.2 *************** *** 1,12 **** ! ====file: enum2.cpp $Values.0$enum $Values.1$Values { v1 = 0, v2, v3 ! } value_; ====declarations: enumeration(Values) { ! declaration: $Values.0 references: $Values.1 values { --- 1,12 ---- ! ====file: enum1.cpp $Values.0$enum $Values.1$Values { v1 = 0, v2, v3 ! }; ====declarations: enumeration(Values) { ! declarations: $Values.0 references: $Values.1 values { *************** *** 16,21 **** } } - variable(value_) { - type: type(Values) - } ====end: --- 16,18 ---- |
From: Baptiste L. <bl...@us...> - 2004-06-20 15:53:53
|
Update of /cvsroot/cpptool/CppParser/examples/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv788/examples/parser Modified Files: parser.vcproj symboltabletest.cpp Added Files: symboltabletestprocessor.cpp symboltabletestprocessor.h Log Message: * extracted class SymbolTableTestProcessor Index: parser.vcproj =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/parser.vcproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** parser.vcproj 20 Jun 2004 10:07:56 -0000 1.3 --- parser.vcproj 20 Jun 2004 15:53:41 -0000 1.4 *************** *** 498,506 **** <File RelativePath=".\refactoringtest.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool"/> - </FileConfiguration> </File> <File --- 498,501 ---- *************** *** 542,550 **** <File RelativePath=".\symboltabletest.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool"/> - </FileConfiguration> </File> <File --- 537,540 ---- *************** *** 552,555 **** --- 542,551 ---- </File> <File + RelativePath=".\symboltabletestprocessor.cpp"> + </File> + <File + RelativePath=".\symboltabletestprocessor.h"> + </File> + <File RelativePath=".\testproject.cpp"> </File> --- NEW FILE: symboltabletestprocessor.h --- #ifndef PARSER_SYMBOLTABLETESTPROCESSOR_H_INCLUDED # define PARSER_SYMBOLTABLETESTPROCESSOR_H_INCLUDED # include "lineprocessor.h" # include "nodeprocessor.h" class TestProject; class SymbolTableTestProcessor : public LineProcessor { public: SymbolTableTestProcessor( LocationTracker &tracker, TestProject &project ); NodePtr declarationsTree() const; private: // overridden from LineProcessor bool commentAllowed() const; void doProcessLine( const std::string &line ); bool doStateChange( const std::string &name, const std::string ¶meter ); void doProcessReadFile( const std::string &path, const std::string &content ); void doTerminateCurrentAction(); private: void processDeclarations(); std::string declarations_; std::string description_; std::string *currentLineBuffer_; unsigned declarationsStartLine_; NodePtr declarationsTree_; TestProject &project_; }; #endif // PARSER_SYMBOLTABLETESTPROCESSOR_H_INCLUDED --- NEW FILE: symboltabletestprocessor.cpp --- #include "symboltabletestprocessor.h" #include "testproject.h" // class DeclarationsNodeProcessor // /////////////////////////////////////////////////////////////// class DeclarationsNodeProcessor : public NodeProcessor { public: DeclarationsNodeProcessor(); }; DeclarationsNodeProcessor::DeclarationsNodeProcessor() { NodeSpecification globalDeclarations( "global_declarations", "", nsHasChildren ); globalDeclarations.addChild( "aggregate" ); globalDeclarations.addChild( "type_alias" ); globalDeclarations.addChild( "namespace" ); globalDeclarations.addChild( "anonymous_namespace" ); globalDeclarations.addChild( "variable" ); globalDeclarations.addChild( "enumeration" ); recordSpecfication( globalDeclarations ); setRootSpecification( globalDeclarations.specificationName() ); NodeSpecification declarations( "declarations", "declarations", nsHasColonStringListValue ); recordSpecfication( declarations ); NodeSpecification references( "references", "references", nsHasColonStringListValue ); recordSpecfication( references ); NodeSpecification aggregate( "aggregate", "aggregate", nsHasBraceValue | nsHasChildren ); aggregate.addChild( "aggregate_kind" ); aggregate.addMandatoryChild( "declarations" ); aggregate.addMandatoryChild( "references" ); aggregate.addChild( "aggregate_members" ); recordSpecfication( aggregate ); NodeSpecification aggregateKind( "aggregate_kind", "kind", nsHasColonEnumerationValue ); aggregateKind.addEnumerationValue( "class" ); aggregateKind.addEnumerationValue( "struct" ); aggregateKind.addEnumerationValue( "union" ); recordSpecfication( aggregateKind ); NodeSpecification aggregateMembers( "aggregate_members", "members", nsHasChildren ); aggregateMembers.addChild( "aggregate" ); aggregateMembers.addChild( "constructor" ); aggregateMembers.addChild( "destructor" ); aggregateMembers.addChild( "function" ); aggregateMembers.addChild( "type_alias" ); recordSpecfication( aggregateMembers ); NodeSpecification constructor( "constructor", "constructor", nsHasBraceValue | nsHasChildren ); constructor.addMandatoryChild( "prototypes" ); constructor.addChild( "function_definition" ); constructor.addChild( "function_parameters" ); recordSpecfication( constructor ); NodeSpecification destructor( "destructor", "destructor", nsHasBraceValue | nsHasChildren ); destructor.addMandatoryChild( "prototypes" ); destructor.addChild( "function_definition" ); destructor.addChild( "function_parameters" ); recordSpecfication( destructor ); NodeSpecification function( "function", "function", nsHasBraceValue | nsHasChildren ); function.addMandatoryChild( "prototypes" ); function.addMandatoryChild( "return_type" ); function.addChild( "function_definition" ); function.addChild( "function_parameters" ); recordSpecfication( function ); NodeSpecification prototypes( "prototypes", "prototypes", nsHasColonStringListValue ); recordSpecfication( prototypes ); NodeSpecification functionDefinition( "function_definition", "definition", nsHasColonStringListValue ); recordSpecfication( functionDefinition ); NodeSpecification returnType( "return_type", "return_type", nsHasColonNodeValue ); returnType.addChild( "type_built_in" ); returnType.addChild( "type_const" ); returnType.addChild( "type_volatile" ); returnType.addChild( "type_ref" ); returnType.addChild( "type_ptr" ); recordSpecfication( returnType ); NodeSpecification functionParameters( "function_parameters", "parameters", nsHasChildren ); functionParameters.addChild( "function_parameter" ); recordSpecfication( functionParameters ); NodeSpecification functionParameter( "function_parameter", "parameter", nsHasBraceValue | nsHasChildren ); functionParameter.addMandatoryChild( "type" ); recordSpecfication( functionParameter ); NodeSpecification type( "type", "type", nsHasColonNodeValue ); type.addChild( "type_built_in" ); type.addChild( "type_const" ); type.addChild( "type_volatile" ); type.addChild( "type_ref" ); type.addChild( "type_ptr" ); type.addChild( "type_type" ); recordSpecfication( type ); NodeSpecification typeBuiltIn( "type_built_in", "built_in", nsHasBraceValues ); recordSpecfication( typeBuiltIn ); NodeSpecification typeType( "type_type", "type", nsHasBraceValue ); recordSpecfication( typeType ); NodeSpecification typeConst( "type_const", "const", nsHasBraceNodeValue ); typeConst.addChild( "type_built_in" ); typeConst.addChild( "type_volatile" ); typeConst.addChild( "type_ref" ); typeConst.addChild( "type_ptr" ); typeConst.addChild( "type_type" ); recordSpecfication( typeConst ); NodeSpecification typeVolatile( "type_volatile", "volatile", nsHasBraceNodeValue ); typeVolatile.addChild( "type_built_in" ); typeVolatile.addChild( "type_const" ); typeVolatile.addChild( "type_ref" ); typeVolatile.addChild( "type_ptr" ); typeVolatile.addChild( "type_type" ); recordSpecfication( typeVolatile ); NodeSpecification typeRef( "type_ref", "ref", nsHasBraceNodeValue ); typeRef.addChild( "type_built_in" ); typeRef.addChild( "type_const" ); typeRef.addChild( "type_volatile" ); typeRef.addChild( "type_ptr" ); typeRef.addChild( "type_type" ); recordSpecfication( typeRef ); NodeSpecification typePtr( "type_ptr", "ptr", nsHasBraceNodeValue ); typePtr.addChild( "type_built_in" ); typePtr.addChild( "type_const" ); typePtr.addChild( "type_volatile" ); typePtr.addChild( "type_ref" ); typePtr.addChild( "type_ptr" ); typePtr.addChild( "type_type" ); recordSpecfication( typePtr ); NodeSpecification typeAlias( "type_alias", "type_alias", nsHasBraceValue | nsHasChildren ); typeAlias.addMandatoryChild( "declarations" ); typeAlias.addMandatoryChild( "references" ); typeAlias.addMandatoryChild( "type" ); recordSpecfication( typeAlias ); NodeSpecification namespaceSpec( "namespace", "namespace", nsHasBraceValue | nsHasChildren ); namespaceSpec.addMandatoryChild( "declarations" ); namespaceSpec.addMandatoryChild( "references" ); namespaceSpec.addMandatoryChild( "namespace_members" ); recordSpecfication( namespaceSpec ); NodeSpecification anonymousNamespace( "anonymous_namespace", "anonymous_namespace", nsHasBraceValue | nsHasChildren ); anonymousNamespace.addMandatoryChild( "declarations" ); anonymousNamespace.addMandatoryChild( "namespace_members" ); recordSpecfication( anonymousNamespace ); NodeSpecification namespaceMembers( "namespace_members", "members", nsHasChildren ); // .. add declaration sequence members namespaceMembers.addChild( "aggregate" ); namespaceMembers.addChild( "type_alias" ); namespaceMembers.addChild( "namespace" ); namespaceMembers.addChild( "variable" ); namespaceMembers.addChild( "enumeration" ); recordSpecfication( namespaceMembers ); NodeSpecification enumeration( "enumeration", "enumeration", nsHasBraceValue | nsHasChildren ); enumeration.addMandatoryChild( "declarations" ); enumeration.addMandatoryChild( "references" ); enumeration.addMandatoryChild( "enumeration_values" ); recordSpecfication( enumeration ); NodeSpecification enumerationValues( "enumeration_values", "values", nsHasChildren ); enumerationValues.addChild( "enumeration_value" ); recordSpecfication( enumerationValues ); NodeSpecification enumerationValue( "enumeration_value", "value", nsHasBraceValue ); recordSpecfication( enumerationValue ); NodeSpecification variable( "variable", "variable", nsHasBraceValue | nsHasChildren ); variable.addMandatoryChild( "declarations" ); variable.addMandatoryChild( "references" ); variable.addMandatoryChild( "type" ); recordSpecfication( variable ); checkSpecifications(); } // class SymbolTableTestProcessor // /////////////////////////////////////////////////////////////// SymbolTableTestProcessor::SymbolTableTestProcessor( LocationTracker &tracker, TestProject &project ) : LineProcessor( tracker ) , project_( project ) , declarationsStartLine_( -1 ) , currentLineBuffer_( 0 ) { } void SymbolTableTestProcessor::processDeclarations() { DeclarationsNodeProcessor nodeProcessor; declarationsTree_ = nodeProcessor.parseNodeTree( declarations_, declarationsStartLine_ ); } bool SymbolTableTestProcessor::commentAllowed() const { return !currentLineBuffer_; } void SymbolTableTestProcessor::doProcessLine( const std::string &line ) { if ( !currentLineBuffer_ ) return; *currentLineBuffer_ += line; *currentLineBuffer_ += "\n"; } bool SymbolTableTestProcessor::doStateChange( const std::string &name, const std::string ¶meter ) { if ( name == "declarations" ) { currentLineBuffer_ = &declarations_; declarations_ = ""; declarationsStartLine_ = currentLine() + 1; return true; } else if ( name == "description" ) { currentLineBuffer_ = &description_; return true; } return false; } void SymbolTableTestProcessor::doProcessReadFile( const std::string &path, const std::string &content ) { Parser::FileId file = project_.setSourceFile( path, content ); memorizePendingLocations( file ); } void SymbolTableTestProcessor::doTerminateCurrentAction() { if ( currentLineBuffer_ == &declarations_ ) processDeclarations(); currentLineBuffer_ = 0; } NodePtr SymbolTableTestProcessor::declarationsTree() const { return declarationsTree_; } Index: symboltabletest.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/symboltabletest.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** symboltabletest.cpp 20 Jun 2004 11:00:38 -0000 1.5 --- symboltabletest.cpp 20 Jun 2004 15:53:41 -0000 1.6 *************** *** 7,10 **** --- 7,11 ---- #include "symboldeclarator.h" #include "symboltable.h" + #include "symboltabletestprocessor.h" #include "stlhelper.h" #include <fstream> *************** *** 22,318 **** } - // class DeclarationsNodeProcessor - // /////////////////////////////////////////////////////////////// - - class DeclarationsNodeProcessor : public NodeProcessor - { - public: - DeclarationsNodeProcessor(); - }; - - - DeclarationsNodeProcessor::DeclarationsNodeProcessor() - { - NodeSpecification globalDeclarations( "global_declarations", "", nsHasChildren ); - globalDeclarations.addChild( "aggregate" ); - globalDeclarations.addChild( "type_alias" ); - globalDeclarations.addChild( "namespace" ); - globalDeclarations.addChild( "anonymous_namespace" ); - globalDeclarations.addChild( "variable" ); - globalDeclarations.addChild( "enumeration" ); - recordSpecfication( globalDeclarations ); - setRootSpecification( globalDeclarations.specificationName() ); - - NodeSpecification declarations( "declarations", "declarations", nsHasColonStringListValue ); - recordSpecfication( declarations ); - - NodeSpecification references( "references", "references", nsHasColonStringListValue ); - recordSpecfication( references ); - - NodeSpecification aggregate( "aggregate", "aggregate", nsHasBraceValue | nsHasChildren ); - aggregate.addChild( "aggregate_kind" ); - aggregate.addMandatoryChild( "declarations" ); - aggregate.addMandatoryChild( "references" ); - aggregate.addChild( "aggregate_members" ); - recordSpecfication( aggregate ); - - NodeSpecification aggregateKind( "aggregate_kind", "kind", nsHasColonEnumerationValue ); - aggregateKind.addEnumerationValue( "class" ); - aggregateKind.addEnumerationValue( "struct" ); - aggregateKind.addEnumerationValue( "union" ); - recordSpecfication( aggregateKind ); - - NodeSpecification aggregateMembers( "aggregate_members", "members", nsHasChildren ); - aggregateMembers.addChild( "aggregate" ); - aggregateMembers.addChild( "constructor" ); - aggregateMembers.addChild( "destructor" ); - aggregateMembers.addChild( "function" ); - aggregateMembers.addChild( "type_alias" ); - recordSpecfication( aggregateMembers ); - - NodeSpecification constructor( "constructor", "constructor", nsHasBraceValue | nsHasChildren ); - constructor.addMandatoryChild( "prototypes" ); - constructor.addChild( "function_definition" ); - constructor.addChild( "function_parameters" ); - recordSpecfication( constructor ); - - NodeSpecification destructor( "destructor", "destructor", nsHasBraceValue | nsHasChildren ); - destructor.addMandatoryChild( "prototypes" ); - destructor.addChild( "function_definition" ); - destructor.addChild( "function_parameters" ); - recordSpecfication( destructor ); - - NodeSpecification function( "function", "function", nsHasBraceValue | nsHasChildren ); - function.addMandatoryChild( "prototypes" ); - function.addMandatoryChild( "return_type" ); - function.addChild( "function_definition" ); - function.addChild( "function_parameters" ); - recordSpecfication( function ); - - NodeSpecification prototypes( "prototypes", "prototypes", nsHasColonStringListValue ); - recordSpecfication( prototypes ); - - NodeSpecification functionDefinition( "function_definition", "definition", nsHasColonStringListValue ); - recordSpecfication( functionDefinition ); - - NodeSpecification returnType( "return_type", "return_type", nsHasColonNodeValue ); - returnType.addChild( "type_built_in" ); - returnType.addChild( "type_const" ); - returnType.addChild( "type_volatile" ); - returnType.addChild( "type_ref" ); - returnType.addChild( "type_ptr" ); - recordSpecfication( returnType ); - - NodeSpecification functionParameters( "function_parameters", "parameters", nsHasChildren ); - functionParameters.addChild( "function_parameter" ); - recordSpecfication( functionParameters ); - - NodeSpecification functionParameter( "function_parameter", "parameter", nsHasBraceValue | nsHasChildren ); - functionParameter.addMandatoryChild( "type" ); - recordSpecfication( functionParameter ); - - NodeSpecification type( "type", "type", nsHasColonNodeValue ); - type.addChild( "type_built_in" ); - type.addChild( "type_const" ); - type.addChild( "type_volatile" ); - type.addChild( "type_ref" ); - type.addChild( "type_ptr" ); - type.addChild( "type_type" ); - recordSpecfication( type ); - - NodeSpecification typeBuiltIn( "type_built_in", "built_in", nsHasBraceValues ); - recordSpecfication( typeBuiltIn ); - - NodeSpecification typeType( "type_type", "type", nsHasBraceValue ); - recordSpecfication( typeType ); - - NodeSpecification typeConst( "type_const", "const", nsHasBraceNodeValue ); - typeConst.addChild( "type_built_in" ); - typeConst.addChild( "type_volatile" ); - typeConst.addChild( "type_ref" ); - typeConst.addChild( "type_ptr" ); - typeConst.addChild( "type_type" ); - recordSpecfication( typeConst ); - - NodeSpecification typeVolatile( "type_volatile", "volatile", nsHasBraceNodeValue ); - typeVolatile.addChild( "type_built_in" ); - typeVolatile.addChild( "type_const" ); - typeVolatile.addChild( "type_ref" ); - typeVolatile.addChild( "type_ptr" ); - typeVolatile.addChild( "type_type" ); - recordSpecfication( typeVolatile ); - - NodeSpecification typeRef( "type_ref", "ref", nsHasBraceNodeValue ); - typeRef.addChild( "type_built_in" ); - typeRef.addChild( "type_const" ); - typeRef.addChild( "type_volatile" ); - typeRef.addChild( "type_ptr" ); - typeRef.addChild( "type_type" ); - recordSpecfication( typeRef ); - - NodeSpecification typePtr( "type_ptr", "ptr", nsHasBraceNodeValue ); - typePtr.addChild( "type_built_in" ); - typePtr.addChild( "type_const" ); - typePtr.addChild( "type_volatile" ); - typePtr.addChild( "type_ref" ); - typePtr.addChild( "type_ptr" ); - typePtr.addChild( "type_type" ); - recordSpecfication( typePtr ); - - NodeSpecification typeAlias( "type_alias", "type_alias", nsHasBraceValue | nsHasChildren ); - typeAlias.addMandatoryChild( "declarations" ); - typeAlias.addMandatoryChild( "references" ); - typeAlias.addMandatoryChild( "type" ); - recordSpecfication( typeAlias ); - - NodeSpecification namespaceSpec( "namespace", "namespace", nsHasBraceValue | nsHasChildren ); - namespaceSpec.addMandatoryChild( "declarations" ); - namespaceSpec.addMandatoryChild( "references" ); - namespaceSpec.addMandatoryChild( "namespace_members" ); - recordSpecfication( namespaceSpec ); - - NodeSpecification anonymousNamespace( "anonymous_namespace", "anonymous_namespace", nsHasBraceValue | nsHasChildren ); - anonymousNamespace.addMandatoryChild( "declarations" ); - anonymousNamespace.addMandatoryChild( "namespace_members" ); - recordSpecfication( anonymousNamespace ); - - NodeSpecification namespaceMembers( "namespace_members", "members", nsHasChildren ); - // .. add declaration sequence members - namespaceMembers.addChild( "aggregate" ); - namespaceMembers.addChild( "type_alias" ); - namespaceMembers.addChild( "namespace" ); - namespaceMembers.addChild( "variable" ); - namespaceMembers.addChild( "enumeration" ); - recordSpecfication( namespaceMembers ); - - NodeSpecification enumeration( "enumeration", "enumeration", nsHasBraceValue | nsHasChildren ); - enumeration.addMandatoryChild( "declarations" ); - enumeration.addMandatoryChild( "references" ); - enumeration.addMandatoryChild( "enumeration_values" ); - recordSpecfication( enumeration ); - - NodeSpecification enumerationValues( "enumeration_values", "values", nsHasChildren ); - enumerationValues.addChild( "enumeration_value" ); - recordSpecfication( enumerationValues ); - - NodeSpecification enumerationValue( "enumeration_value", "value", nsHasBraceValue ); - recordSpecfication( enumerationValue ); - - NodeSpecification variable( "variable", "variable", nsHasBraceValue | nsHasChildren ); - variable.addMandatoryChild( "declarations" ); - variable.addMandatoryChild( "references" ); - variable.addMandatoryChild( "type" ); - recordSpecfication( variable ); - - checkSpecifications(); - } - - // class SymbolTableTestProcessor - // /////////////////////////////////////////////////////////////// - class SymbolTableTestProcessor : public LineProcessor - { - public: - SymbolTableTestProcessor( LocationTracker &tracker, - TestProject &project ); - - NodePtr declarationsTree() const; - - private: // overridden from LineProcessor - bool commentAllowed() const; - - void doProcessLine( const std::string &line ); - bool doStateChange( const std::string &name, - const std::string ¶meter ); - void doProcessReadFile( const std::string &path, - const std::string &content ); - void doTerminateCurrentAction(); - - private: - void processDeclarations(); - - std::string declarations_; - std::string description_; - std::string *currentLineBuffer_; - unsigned declarationsStartLine_; - NodePtr declarationsTree_; - TestProject &project_; - }; - - SymbolTableTestProcessor::SymbolTableTestProcessor( LocationTracker &tracker, - TestProject &project ) - : LineProcessor( tracker ) - , project_( project ) - , declarationsStartLine_( -1 ) - , currentLineBuffer_( 0 ) - { - } - - - void - SymbolTableTestProcessor::processDeclarations() - { - DeclarationsNodeProcessor nodeProcessor; - declarationsTree_ = nodeProcessor.parseNodeTree( declarations_, declarationsStartLine_ ); - } - - bool - SymbolTableTestProcessor::commentAllowed() const - { - return !currentLineBuffer_; - } - - void - SymbolTableTestProcessor::doProcessLine( const std::string &line ) - { - if ( !currentLineBuffer_ ) - return; - - *currentLineBuffer_ += line; - *currentLineBuffer_ += "\n"; - } - - bool - SymbolTableTestProcessor::doStateChange( const std::string &name, - const std::string ¶meter ) - { - if ( name == "declarations" ) - { - currentLineBuffer_ = &declarations_; - declarations_ = ""; - declarationsStartLine_ = currentLine() + 1; - return true; - } - else if ( name == "description" ) - { - currentLineBuffer_ = &description_; - return true; - } - return false; - } - - void - SymbolTableTestProcessor::doProcessReadFile( const std::string &path, - const std::string &content ) - { - Parser::FileId file = project_.setSourceFile( path, content ); - memorizePendingLocations( file ); - } - - - void - SymbolTableTestProcessor::doTerminateCurrentAction() - { - if ( currentLineBuffer_ == &declarations_ ) - processDeclarations(); - currentLineBuffer_ = 0; - } - - NodePtr - SymbolTableTestProcessor::declarationsTree() const - { - return declarationsTree_; - } - - // class DeclarationChecker // /////////////////////////////////////////////////////////////// --- 23,26 ---- |
From: Baptiste L. <bl...@us...> - 2004-06-20 11:01:02
|
Update of /cvsroot/cpptool/CppParser/examples/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17967/examples/parser Modified Files: location.h project.h scope.cpp scope.h symboldeclarator.cpp symboldeclarator.h symboltable.cpp symboltable.h symboltabletest.cpp testproject.cpp testproject.h Log Message: * added support for anonymous namespace Index: testproject.h =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/testproject.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** testproject.h 8 Jun 2004 20:23:18 -0000 1.1.1.1 --- testproject.h 20 Jun 2004 11:00:38 -0000 1.2 *************** *** 21,25 **** std::string readSourceFile( const std::string &path ); ! std::string sourcePath( Parser::FileId file ); Parser::SourceEditor &editSource( Parser::FileId file ); --- 21,27 ---- std::string readSourceFile( const std::string &path ); ! Parser::FileId fileIdFromPath( const std::string &path ); ! ! std::string pathFromFileId( Parser::FileId file ); Parser::SourceEditor &editSource( Parser::FileId file ); Index: scope.h =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/scope.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** scope.h 14 Jun 2004 23:08:11 -0000 1.2 --- scope.h 20 Jun 2004 11:00:38 -0000 1.3 *************** *** 12,15 **** --- 12,16 ---- /// @todo: there is a cycle between SymbolDeclaration & Scope which cause memory not to be freed. + class AnonymousNamespaceScope; class BlockScope; class ClassScope; *************** *** 20,27 **** class TypedefScope; typedef boost::shared_ptr<ClassScope> ClassScopePtr; typedef boost::shared_ptr<NamespaceScope> NamespaceScopePtr; typedef boost::shared_ptr<OverallScope> OverallScopePtr; typedef boost::shared_ptr<TypedefScope> TypedefScopePtr; ! typedef boost::shared_ptr<MemberFunctionScope> MemberFunctionScopePtr; class Type; --- 21,29 ---- class TypedefScope; typedef boost::shared_ptr<ClassScope> ClassScopePtr; + typedef boost::shared_ptr<MemberFunctionScope> MemberFunctionScopePtr; typedef boost::shared_ptr<NamespaceScope> NamespaceScopePtr; typedef boost::shared_ptr<OverallScope> OverallScopePtr; typedef boost::shared_ptr<TypedefScope> TypedefScopePtr; ! typedef boost::shared_ptr<TranslationUnitScope> TranslationUnitScopePtr; class Type; *************** *** 31,34 **** --- 33,37 ---- { public: + virtual void visit( AnonymousNamespaceScope &scope ) = 0; virtual void visit( BlockScope &scope ) = 0; virtual void visit( ClassScope &scope ) = 0; *************** *** 81,85 **** { public: ! ScopePtr translationUnitScope( FileId file ) const; public: // overridden from Scope --- 84,88 ---- { public: ! TranslationUnitScopePtr translationUnitScope( FileId file ) const; public: // overridden from Scope *************** *** 89,93 **** std::string str() const; private: ! typedef std::map<FileId,ScopePtr> TranslationUnitScopes; mutable TranslationUnitScopes scopes_; }; --- 92,96 ---- std::string str() const; private: ! typedef std::map<FileId,TranslationUnitScopePtr> TranslationUnitScopes; mutable TranslationUnitScopes scopes_; }; *************** *** 105,108 **** --- 108,128 ---- class TranslationUnitScope : public Scope { + public: + TranslationUnitScope(); + + ScopePtr anonymousNamespaceScope() const; + + public: // overridden from Scope + void accept( ScopeVisitor &visitor ); + SymbolDeclarationPtr resolve( const std::string &name ) const; + SymbolDeclarationPtr memberResolve( const std::string &name ) const; + std::string str() const; + + private: + ScopePtr anonymousNamespaceScope_; + }; + + class AnonymousNamespaceScope : public Scope + { public: // overridden from Scope void accept( ScopeVisitor &visitor ); Index: location.h =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/location.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** location.h 8 Jun 2004 20:23:14 -0000 1.1.1.1 --- location.h 20 Jun 2004 11:00:38 -0000 1.2 *************** *** 7,10 **** --- 7,12 ---- typedef unsigned int FileId; + enum { invalidFileId = -1 }; + class Location { *************** *** 32,36 **** inline Location::Location() ! : file_( -1 ) , pos_( -1 ) { --- 34,38 ---- inline Location::Location() ! : file_( invalidFileId ) , pos_( -1 ) { Index: symboltabletest.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/symboltabletest.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** symboltabletest.cpp 20 Jun 2004 10:07:56 -0000 1.4 --- symboltabletest.cpp 20 Jun 2004 11:00:38 -0000 1.5 *************** *** 38,41 **** --- 38,42 ---- globalDeclarations.addChild( "type_alias" ); globalDeclarations.addChild( "namespace" ); + globalDeclarations.addChild( "anonymous_namespace" ); globalDeclarations.addChild( "variable" ); globalDeclarations.addChild( "enumeration" ); *************** *** 336,339 **** --- 337,341 ---- const Parser::SymbolDeclarationPtr &declaration ); void checkNamespace( const NodePtr &namespaceNode ); + void checkAnonymousNamespace( const NodePtr &namespaceNode ); CppUT::Message makeMessage( const NodePtr &node, *************** *** 364,368 **** { std::ostringstream os; ! std::string path = project_.sourcePath( location.file() ); std::string text = project_.readSourceFile( path ); int line = std::count( text.begin(), text.begin() + location.pos(), '\n' ); --- 366,370 ---- { std::ostringstream os; ! std::string path = project_.pathFromFileId( location.file() ); std::string text = project_.readSourceFile( path ); int line = std::count( text.begin(), text.begin() + location.pos(), '\n' ); *************** *** 473,476 **** --- 475,480 ---- else if ( child->specificationName() == "namespace" ) checkNamespace( child ); + else if ( child->specificationName() == "anonymous_namespace" ) + checkAnonymousNamespace( child ); else CppUT::fail( makeMessage( child, "don't know how to check node type." ) ); *************** *** 549,552 **** --- 553,579 ---- } + + void + DeclarationChecker::checkAnonymousNamespace( const NodePtr &namespaceNode ) + { + std::string translationUnitName = namespaceNode->braceValue(); + try + { + Parser::FileId translationUnitId = project_.fileIdFromPath( translationUnitName ); + Parser::TranslationUnitScopePtr translationUnitScope = table_.translationUnitScope( translationUnitId ); + Parser::ScopePtr anonymousScope = translationUnitScope->anonymousNamespaceScope(); + if ( namespaceNode->hasChild("members") ) + { + enterScope( anonymousScope ); + checkDeclarations( namespaceNode->child("members") ); + exitScope(); + } + } + catch ( Parser::ProjectError & ) + { + CppUT::fail( makeMessage( namespaceNode, "Unknown translation unit." ) ); + } + } + } // anonymous namespace Index: symboldeclarator.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/symboldeclarator.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** symboldeclarator.cpp 19 Jun 2004 15:25:43 -0000 1.2 --- symboldeclarator.cpp 20 Jun 2004 11:00:38 -0000 1.3 *************** *** 60,63 **** --- 60,65 ---- else if ( declaration->name() == ConstString("named_namespace_def") ) declareNamespaceDef( declaration, parentScope ); + else if ( declaration->name() == ConstString("unnamed_namespace_def") ) + declareAnonymousNamespaceDef( declaration, parentScope ); } } *************** *** 293,295 **** --- 295,308 ---- } + + void + SymbolDeclarator::declareAnonymousNamespaceDef( const NodePtr &namespaceDeclaration, + Scope &parentScope ) + { + TranslationUnitScopePtr translationScope = symbolTable_.translationUnitScope( currentFile_ ); + ScopePtr anonymousScope = translationScope->anonymousNamespaceScope(); + NodePtr body = safeGetChild( namespaceDeclaration, "declarations" ); + declareDeclarationSequence( body, *anonymousScope ); + } + } // namespace Parser Index: symboltable.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/symboltable.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** symboltable.cpp 8 Jun 2004 20:23:18 -0000 1.1.1.1 --- symboltable.cpp 20 Jun 2004 11:00:38 -0000 1.2 *************** *** 58,62 **** ! ScopePtr SymbolTable::translationUnitScope( FileId file ) { --- 58,62 ---- ! TranslationUnitScopePtr SymbolTable::translationUnitScope( FileId file ) { Index: symboltable.h =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/symboltable.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** symboltable.h 8 Jun 2004 20:23:18 -0000 1.1.1.1 --- symboltable.h 20 Jun 2004 11:00:38 -0000 1.2 *************** *** 10,14 **** --- 10,16 ---- namespace Parser { class OverallScope; + class TranslationUnitScope; typedef boost::shared_ptr<OverallScope> OverallScopePtr; + typedef boost::shared_ptr<TranslationUnitScope> TranslationUnitScopePtr; class SymbolTable *************** *** 29,33 **** OverallScopePtr overallScope() const; ! ScopePtr translationUnitScope( FileId file ); SymbolDeclarationPtr resolve( const std::string &name ) const; --- 31,35 ---- OverallScopePtr overallScope() const; ! TranslationUnitScopePtr translationUnitScope( FileId file ); SymbolDeclarationPtr resolve( const std::string &name ) const; Index: testproject.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/testproject.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** testproject.cpp 8 Jun 2004 20:23:18 -0000 1.1.1.1 --- testproject.cpp 20 Jun 2004 11:00:38 -0000 1.2 *************** *** 63,68 **** std::string ! TestProject::sourcePath( Parser::FileId file ) { IdsFile::const_iterator it = idToPaths_.find( file ); --- 63,77 ---- + Parser::FileId + TestProject::fileIdFromPath( const std::string &path ) + { + FileIds::const_iterator it = pathToIds_.find( path ); + if ( it == pathToIds_.end() ) + throw Parser::ProjectError( "Unregistered path." ); + return it->second; + } + std::string ! TestProject::pathFromFileId( Parser::FileId file ) { IdsFile::const_iterator it = idToPaths_.find( file ); *************** *** 80,84 **** return *(it->second); ! std::string path = sourcePath( file ); Parser::SourceEditorPtr editor( new Parser::SourceEditor( readSourceFile(path), *this ) ); editors_[ file ] = editor; --- 89,93 ---- return *(it->second); ! std::string path = pathFromFileId( file ); Parser::SourceEditorPtr editor( new Parser::SourceEditor( readSourceFile(path), *this ) ); editors_[ file ] = editor; *************** *** 101,105 **** for ( ; it != editors_.end(); ++it ) { ! std::string path = sourcePath( it->first ); Parser::SourceEditor &editor = *(it->second); files_[path] = editor.source(); --- 110,114 ---- for ( ; it != editors_.end(); ++it ) { ! std::string path = pathFromFileId( it->first ); Parser::SourceEditor &editor = *(it->second); files_[path] = editor.source(); Index: project.h =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/project.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** project.h 8 Jun 2004 20:23:17 -0000 1.1.1.1 --- project.h 20 Jun 2004 11:00:38 -0000 1.2 *************** *** 54,58 **** virtual const ProjectConfiguration &configuration() const = 0; ! // virtual FileId fileId( const std::string &path ) = 0; // virtual bool sourceFileExist( const std::string &path ) = 0; --- 54,62 ---- virtual const ProjectConfiguration &configuration() const = 0; ! /// @exception ProjectError if source file does not exist ! virtual FileId fileIdFromPath( const std::string &path ) = 0; ! ! /// @exception ProjectError if source file does not exist ! virtual std::string pathFromFileId( FileId file ) = 0; // virtual bool sourceFileExist( const std::string &path ) = 0; *************** *** 62,68 **** /// @exception ProjectError if source file does not exist - virtual std::string sourcePath( FileId file ) = 0; - - /// @exception ProjectError if source file does not exist virtual SourceEditor &editSource( FileId file ) = 0; --- 66,69 ---- Index: scope.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/scope.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** scope.cpp 14 Jun 2004 23:08:11 -0000 1.2 --- scope.cpp 20 Jun 2004 11:00:38 -0000 1.3 *************** *** 66,70 **** // class OverallScope // ////////////////////////////////////////////////////////////////// ! ScopePtr OverallScope::translationUnitScope( FileId file ) const { --- 66,70 ---- // class OverallScope // ////////////////////////////////////////////////////////////////// ! TranslationUnitScopePtr OverallScope::translationUnitScope( FileId file ) const { *************** *** 140,143 **** --- 140,156 ---- // ////////////////////////////////////////////////////////////////// + TranslationUnitScope::TranslationUnitScope() + : anonymousNamespaceScope_( new AnonymousNamespaceScope() ) + { + } + + + ScopePtr + TranslationUnitScope::anonymousNamespaceScope() const + { + return anonymousNamespaceScope_; + } + + void TranslationUnitScope::accept( ScopeVisitor &visitor ) *************** *** 149,152 **** --- 162,169 ---- TranslationUnitScope::resolve( const std::string &name ) const { + SymbolDeclarationPtr declaration = anonymousNamespaceScope_->resolve( name ); + if ( declaration ) + return declaration; + for ( int index = 0; index < subScopeCount(); ++index ) { *************** *** 161,164 **** --- 178,185 ---- TranslationUnitScope::memberResolve( const std::string &name ) const { + SymbolDeclarationPtr declaration = anonymousNamespaceScope_->getMemberDeclaration( name ); + if ( declaration ) + return declaration; + for ( int index = 0; index < subScopeCount(); ++index ) { *************** *** 177,180 **** --- 198,241 ---- + // class AnonymousNamespaceScope + // ////////////////////////////////////////////////////////////////// + + void + AnonymousNamespaceScope::accept( ScopeVisitor &visitor ) + { + visitor.visit( *this ); + } + + SymbolDeclarationPtr + AnonymousNamespaceScope::resolve( const std::string &name ) const + { + for ( int index = 0; index < subScopeCount(); ++index ) + { + SymbolDeclarationPtr declaration = subScopeAt(index)->resolve( name ); + if ( declaration ) + return declaration; + } + return SymbolDeclarationPtr(); + } + + SymbolDeclarationPtr + AnonymousNamespaceScope::memberResolve( const std::string &name ) const + { + for ( int index = 0; index < subScopeCount(); ++index ) + { + SymbolDeclarationPtr declaration = subScopeAt(index)->getMemberDeclaration( name ); + if ( declaration ) + return declaration; + } + return SymbolDeclarationPtr(); + } + + std::string + AnonymousNamespaceScope::str() const + { + return "AnonymousNamespaceScope<>"; + } + + // class NamespaceScope // ////////////////////////////////////////////////////////////////// Index: symboldeclarator.h =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/symboldeclarator.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** symboldeclarator.h 8 Jun 2004 20:23:18 -0000 1.1.1.1 --- symboldeclarator.h 20 Jun 2004 11:00:38 -0000 1.2 *************** *** 53,56 **** --- 53,59 ---- Scope &parentScope ); + void declareAnonymousNamespaceDef( const NodePtr &namespaceDeclaration, + Scope &parentScope ); + CppUT::Enumerator<std::string> getAllChildSymbols( const NodePtr &node ) const; |
From: Baptiste L. <bl...@us...> - 2004-06-20 11:00:58
|
Update of /cvsroot/cpptool/CppParser/examples/parser/testdata/symbol_table In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17967/examples/parser/testdata/symbol_table Modified Files: __tests__.txt namespace3.txt Log Message: * added support for anonymous namespace Index: namespace3.txt =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/testdata/symbol_table/namespace3.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** namespace3.txt 20 Jun 2004 10:07:55 -0000 1.2 --- namespace3.txt 20 Jun 2004 11:00:37 -0000 1.3 *************** *** 11,15 **** ====declarations: namespace(N1) { ! declaration: $N1.0 references: $N1.1 members { --- 11,15 ---- ====declarations: namespace(N1) { ! declarations: $N1.0 references: $N1.1 members { *************** *** 22,28 **** } anonymous_namespace(n3.cpp) { ! declaration: $N3.0 members { ! type_alias(Offset) { type: built_in(int) declarations: $Pos.0 --- 22,28 ---- } anonymous_namespace(n3.cpp) { ! declarations: $N3.0 members { ! type_alias(Pos) { type: built_in(int) declarations: $Pos.0 Index: __tests__.txt =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/testdata/symbol_table/__tests__.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** __tests__.txt 20 Jun 2004 10:07:55 -0000 1.1 --- __tests__.txt 20 Jun 2004 11:00:36 -0000 1.2 *************** *** 6,7 **** --- 6,8 ---- typedef1.txt typedef2.txt + namespace3.txt |
From: Baptiste L. <bl...@us...> - 2004-06-20 10:08:05
|
Update of /cvsroot/cpptool/CppParser/examples/parser/testdata/symbol_table In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6749/examples/parser/testdata/symbol_table Modified Files: namespace1.txt namespace2.txt namespace3.txt Added Files: __tests__.txt Log Message: * the list of tests for the symbol table is now read from __tests__.txt Index: namespace3.txt =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/testdata/symbol_table/namespace3.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** namespace3.txt 8 Jun 2004 20:23:19 -0000 1.1.1.1 --- namespace3.txt 20 Jun 2004 10:07:55 -0000 1.2 *************** *** 1,2 **** --- 1,4 ---- + ====description: + Declare a typedef in namespace N1, and another one in an anonymous namespace. ====file: n1.cpp $N1.0$namespace $N1.1$N1 { Index: namespace1.txt =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/testdata/symbol_table/namespace1.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** namespace1.txt 8 Jun 2004 20:23:19 -0000 1.1.1.1 --- namespace1.txt 20 Jun 2004 10:07:55 -0000 1.2 *************** *** 1,2 **** --- 1,4 ---- + ====description: + An empty named namespace declaration. ====file: n1.cpp $N1.0$namespace $N1.1$N1 { --- NEW FILE: __tests__.txt --- ## This file list all the tests for the symbol table ## Path are relative to this directory & follow the unix naming convention ## '/' is used as directory separator. namespace1.txt namespace2.txt typedef1.txt typedef2.txt Index: namespace2.txt =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/testdata/symbol_table/namespace2.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** namespace2.txt 8 Jun 2004 20:23:19 -0000 1.1.1.1 --- namespace2.txt 20 Jun 2004 10:07:55 -0000 1.2 *************** *** 1,2 **** --- 1,4 ---- + ====description: + Nested named namespace with the same name. N1::N1 & N2::N2. Test symbol resolution & scope. ====file: n1.cpp $N1.0$namespace $N1.1$N1 { |
From: Baptiste L. <bl...@us...> - 2004-06-20 10:08:05
|
Update of /cvsroot/cpptool/CppParser/examples/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6749/examples/parser Modified Files: parser.vcproj symboltabletest.cpp symboltabletest.h Log Message: * the list of tests for the symbol table is now read from __tests__.txt Index: parser.vcproj =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/parser.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** parser.vcproj 19 Jun 2004 15:27:02 -0000 1.2 --- parser.vcproj 20 Jun 2004 10:07:56 -0000 1.3 *************** *** 238,241 **** --- 238,244 ---- Filter=""> <File + RelativePath=".\testdata\symbol_table\__tests__.txt"> + </File> + <File RelativePath=".\testdata\symbol_table\class1.txt"> </File> Index: symboltabletest.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/symboltabletest.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** symboltabletest.cpp 20 Jun 2004 08:25:24 -0000 1.3 --- symboltabletest.cpp 20 Jun 2004 10:07:56 -0000 1.4 *************** *** 15,21 **** - CPPUT_REGISTER_SUITE_TO_DEFAULT( SymbolTableTest ); - - namespace { --- 15,18 ---- *************** *** 552,562 **** } - - } // anonymous namespace - #define LOCAL_CHECK_DECLARATIONS \ - CPPUT_BEGIN_ASSERTION_MACRO() \ - checkSymbolDeclarations --- 549,554 ---- *************** *** 564,588 **** // /////////////////////////////////////////////////////////////// ! ! void ! SymbolTableTest::setUp() { - symbolTablePath_ = "testdata/symbol_table/"; - tracker_.reset( new LocationTracker() ); - project_.reset( new TestProject() ); } void ! SymbolTableTest::tearDown() { ! tracker_.reset(); ! project_.reset(); } void ! SymbolTableTest::checkSymbolDeclarations( const std::string &path ) { SymbolTableTestProcessor processor( *tracker_, *project_ ); processor.processFile( path ); --- 556,580 ---- // /////////////////////////////////////////////////////////////// ! SymbolTableTestCase::SymbolTableTestCase( const std::string &basePath, ! const std::string &testPath ) ! : CppUT::AbstractTestCase( testPath ) ! , basePath_( basePath ) ! , testPath_( testPath ) { } void ! SymbolTableTestCase::setUp() { ! tracker_.reset( new LocationTracker() ); ! project_.reset( new TestProject() ); } void ! SymbolTableTestCase::doRun() { + std::string path = basePath_ + testPath_; SymbolTableTestProcessor processor( *tracker_, *project_ ); processor.processFile( path ); *************** *** 594,620 **** void ! SymbolTableTest::testTypedefTest1() { ! LOCAL_CHECK_DECLARATIONS( symbolTablePath_ + "typedef1.txt" ); } ! void ! SymbolTableTest::testTypedefTest2() { ! LOCAL_CHECK_DECLARATIONS( symbolTablePath_ + "typedef2.txt" ); } void ! SymbolTableTest::testNamespace1() { ! LOCAL_CHECK_DECLARATIONS( symbolTablePath_ + "namespace1.txt" ); } ! void ! SymbolTableTest::testNamespace2() { ! LOCAL_CHECK_DECLARATIONS( symbolTablePath_ + "namespace2.txt" ); } --- 586,674 ---- void ! SymbolTableTestCase::tearDown() { ! tracker_.reset(); ! project_.reset(); } ! // template class TestListProcessor ! // //////////////////////////////////////////////////////////////////////// ! ! template<class TestCaseType> ! class TestListProcessor : public LineProcessor { ! public: ! TestListProcessor( CppUT::TestSuite &suite, ! const std::string &basePath, ! const std::string &testListFilename ); ! ! public: // overridden from LineProcessor ! void doProcessLine( const std::string &line ); ! ! bool doStateChange( const std::string &name, ! const std::string ¶meter ) ! { ! return false; ! } ! ! void doProcessReadFile( const std::string &path, ! const std::string &content ) ! { ! } ! ! void doTerminateCurrentAction() ! { ! } ! ! private: ! std::string basePath_; ! CppUT::TestSuite &suite_; ! LocationTracker dummyLocationTracker_; ! }; ! ! ! template<class TestCaseType> ! TestListProcessor<TestCaseType>::TestListProcessor( CppUT::TestSuite &suite, ! const std::string &basePath, ! const std::string &testListFilename ) ! : LineProcessor( dummyLocationTracker_ ) ! , basePath_( basePath ) ! , suite_( suite ) ! { ! std::string testListPath = basePath + testListFilename; ! try ! { ! processFile( testListPath ); ! } ! catch ( InputProcessorError &e ) ! { ! suite_.add( CppUT::makeFailingTestCase( "CriticalError", e.what() ) ); ! } } + template<class TestCaseType> void ! TestListProcessor<TestCaseType>::doProcessLine( const std::string &line ) { ! std::string trimedLine = StlHelper::trim( line ); ! if ( trimedLine.empty() ) ! return; ! ! suite_.add( CppUT::TestPtr( new TestCaseType( basePath_, trimedLine ) ) ); } ! // class SymbolTableTestSuite ! // ///////////////////////////////////////////////////////////////////////////// ! ! CPPUT_REGISTER_SUITE_TO_DEFAULT( SymbolTableTestSuite ); ! ! SymbolTableTestSuite::SymbolTableTestSuite() ! : CppUT::TestSuite( "SymbolTableTest" ) { ! TestListProcessor<SymbolTableTestCase> processor( *this, ! "testdata/symbol_table/", ! "__tests__.txt" ); } Index: symboltabletest.h =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/symboltabletest.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** symboltabletest.h 8 Jun 2004 20:23:18 -0000 1.1.1.1 --- symboltabletest.h 20 Jun 2004 10:07:56 -0000 1.2 *************** *** 7,34 **** ! class SymbolTableTest : public CppUT::TestFixture { public: ! CPPUT_TESTSUITE_BEGIN( SymbolTableTest ); ! CPPUT_TEST( testTypedefTest1 ); ! CPPUT_TEST( testTypedefTest2 ); ! CPPUT_TEST( testNamespace1 ); ! CPPUT_TEST( testNamespace2 ); ! CPPUT_TESTSUITE_END(); ! void setUp(); void tearDown(); ! void testTypedefTest1(); ! void testTypedefTest2(); ! void testNamespace1(); ! void testNamespace2(); private: void checkSymbolDeclarations( const std::string &path ); - std::string symbolTablePath_; CppUT::SmartPtr<LocationTracker> tracker_; CppUT::SmartPtr<TestProject> project_; }; --- 7,41 ---- ! class SymbolTableTestCase : public CppUT::AbstractTestCase { public: ! SymbolTableTestCase( const std::string &basePath, ! const std::string &testPath ); ! void setUp(); void tearDown(); ! private: // overridden from CppUT::AbstractTestCase ! void doRun(); private: void checkSymbolDeclarations( const std::string &path ); CppUT::SmartPtr<LocationTracker> tracker_; CppUT::SmartPtr<TestProject> project_; + std::string basePath_; + std::string testPath_; + }; + + + class SymbolTableTestSuite : public CppUT::TestSuite + { + public: + SymbolTableTestSuite(); + + static CppUT::TestPtr suite( std::string suiteName = std::string("SymbolTableTestSuite") ) + { + return CppUT::TestPtr( new SymbolTableTestSuite() ); + } }; |
From: Baptiste L. <bl...@us...> - 2004-06-20 10:07:05
|
Update of /cvsroot/cpptool/CppParser/src/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6205/src/cpput Modified Files: testcase.cpp Log Message: * added makeFailingTestCase Index: testcase.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/src/cpput/testcase.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** testcase.cpp 8 Jun 2004 20:23:24 -0000 1.1.1.1 --- testcase.cpp 20 Jun 2004 10:06:53 -0000 1.2 *************** *** 133,136 **** --- 133,165 ---- + + namespace { + class FailingTestCase : public CppUT::AbstractTestCase + { + public: + FailingTestCase( const std::string &name, + const CppUT::Message &message ) + : CppUT::AbstractTestCase( name ) + , message_( message ) + { + } + private: // overridden from AbstractTestCase + void doRun() + { + throw CppUT::AssertException( message_ ); + } + + Message message_; + }; + } + + + TestPtr CPPUT_API makeFailingTestCase( const std::string &name, + const Message &message ) + { + return TestPtr( new FailingTestCase( name, message ) ); + } + + } // namespace CppUT |
From: Baptiste L. <bl...@us...> - 2004-06-20 10:07:04
|
Update of /cvsroot/cpptool/CppParser/include/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6205/include/cpput Modified Files: testcase.h Log Message: * added makeFailingTestCase Index: testcase.h =================================================================== RCS file: /cvsroot/cpptool/CppParser/include/cpput/testcase.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** testcase.h 8 Jun 2004 20:23:21 -0000 1.1.1.1 --- testcase.h 20 Jun 2004 10:06:54 -0000 1.2 *************** *** 70,73 **** --- 70,76 ---- const std::string &name ); + TestPtr CPPUT_API makeFailingTestCase( const std::string &name, + const Message &message ); + template<typename FixtureType> TestPtr makeFixtureTestCase( const SmartPtr<FixtureType> &fixture, |
From: Baptiste L. <bl...@us...> - 2004-06-20 08:25:34
|
Update of /cvsroot/cpptool/CppParser/examples/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15519/examples/parser Modified Files: symboltabletest.cpp Log Message: * added a description section to test file Index: symboltabletest.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/symboltabletest.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** symboltabletest.cpp 14 Jun 2004 23:08:11 -0000 1.2 --- symboltabletest.cpp 20 Jun 2004 08:25:24 -0000 1.3 *************** *** 234,239 **** std::string declarations_; unsigned declarationsStartLine_; - bool isReadingDeclarations_; NodePtr declarationsTree_; TestProject &project_; --- 234,240 ---- std::string declarations_; + std::string description_; + std::string *currentLineBuffer_; unsigned declarationsStartLine_; NodePtr declarationsTree_; TestProject &project_; *************** *** 244,249 **** : LineProcessor( tracker ) , project_( project ) - , isReadingDeclarations_( false ) , declarationsStartLine_( -1 ) { } --- 245,250 ---- : LineProcessor( tracker ) , project_( project ) , declarationsStartLine_( -1 ) + , currentLineBuffer_( 0 ) { } *************** *** 260,264 **** SymbolTableTestProcessor::commentAllowed() const { ! return !isReadingDeclarations_; } --- 261,265 ---- SymbolTableTestProcessor::commentAllowed() const { ! return !currentLineBuffer_; } *************** *** 266,274 **** SymbolTableTestProcessor::doProcessLine( const std::string &line ) { ! if ( !isReadingDeclarations_ ) return; ! declarations_ += line; ! declarations_ += "\n"; } --- 267,275 ---- SymbolTableTestProcessor::doProcessLine( const std::string &line ) { ! if ( !currentLineBuffer_ ) return; ! *currentLineBuffer_ += line; ! *currentLineBuffer_ += "\n"; } *************** *** 279,287 **** if ( name == "declarations" ) { ! isReadingDeclarations_ = true; declarations_ = ""; declarationsStartLine_ = currentLine() + 1; return true; } return false; } --- 280,293 ---- if ( name == "declarations" ) { ! currentLineBuffer_ = &declarations_; declarations_ = ""; declarationsStartLine_ = currentLine() + 1; return true; } + else if ( name == "description" ) + { + currentLineBuffer_ = &description_; + return true; + } return false; } *************** *** 299,307 **** SymbolTableTestProcessor::doTerminateCurrentAction() { ! if ( isReadingDeclarations_ ) ! { ! isReadingDeclarations_ = false; processDeclarations(); ! } } --- 305,311 ---- SymbolTableTestProcessor::doTerminateCurrentAction() { ! if ( currentLineBuffer_ == &declarations_ ) processDeclarations(); ! currentLineBuffer_ = 0; } |
From: Baptiste L. <bl...@us...> - 2004-06-19 15:27:12
|
Update of /cvsroot/cpptool/CppParser/examples/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25546/examples/parser Modified Files: parser.vcproj Log Message: * added grammar_tree.txt Index: parser.vcproj =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/parser.vcproj,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** parser.vcproj 8 Jun 2004 20:23:17 -0000 1.1.1.1 --- parser.vcproj 19 Jun 2004 15:27:02 -0000 1.2 *************** *** 357,360 **** --- 357,363 ---- </File> <File + RelativePath=".\grammar_tree.txt"> + </File> + <File RelativePath="grammarparsertest.h"> </File> *************** *** 492,495 **** --- 495,503 ---- <File RelativePath=".\refactoringtest.cpp"> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCLCompilerTool"/> + </FileConfiguration> </File> <File *************** *** 531,534 **** --- 539,547 ---- <File RelativePath=".\symboltabletest.cpp"> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCLCompilerTool"/> + </FileConfiguration> </File> <File |
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 ); } |
From: Baptiste L. <bl...@us...> - 2004-06-19 15:25:27
|
Update of /cvsroot/cpptool/CppParser/examples/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24175/examples/parser Modified Files: grammar_tree.txt Log Message: * updated with new 'declarations' Index: grammar_tree.txt =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/grammar_tree.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** grammar_tree.txt 19 Jun 2004 14:46:07 -0000 1.2 --- grammar_tree.txt 19 Jun 2004 15:25:16 -0000 1.3 *************** *** 2,71 **** translation_unit[ ! n declaration_error ! | namespace_alias_def[ ! id ! namespace_specifier[...] ! ~ n id] // +(namespace_name) ! | using_declaration[ ! using_id ! ~ n id] // @todo any_id ! | using_directive[ ! namespace_specifier[...] ] ! | simple_declaration[ ! [ typedef_decl_specifiers ! cv_qualifiers ! [ fundamental_type_specifier ! | type_name ! | enum_specifier[ ! id ! n enumerator_definition[ ! id ! constant_expression[...] ! ] ] ! | class_specifier[...] ! | elaborated_type_specifier[ ! ] ! ? cv_qualifiers ! | friend_specifier[ ! declaration_specifier[...] ] ! | declaration_specifier[ ! //content same as friend_specifier ! ? storage_class_specifier ! ? function_specifier ! ? cv_qualifiers ! workaround_type_specifier ! same as typedef_decl_specifiers ! ? cv_qualifiers ! ] ] ! ? init_declarators[ ! n init_declarator[ ! declarator[...] ! ? assign_initializer[ ! [ assignment_expression[...] // = 1234 ! | n initializer_clause ] // = {1,2,3,4} ! | expression_list[...] // (1,2,3,4) ctor ! ] ] ] ] ] ! | linkage_specification[ ! 'extern' ! $string ! [ '{' !declaration_seq '}' => same as translation_unit ! | declaration[...] ] ! ] ! | named_namespace_def[ ! id ! namespace_body[ !declaration_seq ] ! ] ! | unnamed_namespace_def[ ! namespace_body[ !declaration_seq ] ! ] ! | function_definition[ ... ] ! | template_declaration[ ... ] ! | explicit_template_instantiation[...] ! | explicit_template_specialization[...] --- 2,90 ---- translation_unit[ ! declarations[...] ! ] ! ! ! ///////////////////////////////// declarations /////////////////////////// ! declarations[ ! [ n declaration_error ! | namespace_alias_def[ ! id ! namespace_specifier[...] ! ~ n id] // +(namespace_name) ! | using_declaration[ ! using_id ! ~ n id] // @todo any_id ! | using_directive[ ! namespace_specifier[...] ] ! | simple_declaration[ ! [ typedef_decl_specifiers[ ! type_specifier[...] ] ! | friend_specifier[ ! declaration_specifier[...] ] ! | declaration_specifier[ ! //content same as friend_specifier ! ? storage_class_specifier ! ? function_specifier ! type_specifier[...] ] ! ] ! ? init_declarators[ ! n init_declarator[ ! declarator[...] ! ? assign_initializer[ ! [ assignment_expression[...] // = 1234 ! | n initializer_clause ] // = {1,2,3,4} ! | expression_list[...] // (1,2,3,4) ctor ] ] ] ] ! ] ! | linkage_specification[ ! 'extern' ! $string ! [ '{' !declaration_seq '}' => same as translation_unit ! | declaration[...] ] ! ] ! | named_namespace_def[ ! id ! namespace_body[ !declaration_seq ] ! ] ! | unnamed_namespace_def[ ! namespace_body[ !declaration_seq ] ! ] ! | function_definition[ ... ] ! | template_declaration[ ... ] ! | explicit_template_instantiation[...] ! | explicit_template_specialization[...] ! ] ! ] + ///////////////////////////////// type_specifier /////////////////////////// + + type_specifier[ + cv_qualifiers + [ fundamental_type_specifier + | type_name + | enum_specifier[ + id + n enumerator_definition[ + id + constant_expression[...] + ] ] + | class_specifier[...] + | forward_class_specifier[ + forwarded_type_id[ + ~n id ] ] + | forward_enum_specifier[ // @todo better tree structure + forwarded_type_id[ + ~n id ] ] + | forward_typename_specifier[ + forwarded_type_id[ + ~n id ] ] + ] + ? cv_qualifiers + ] |
From: Baptiste L. <bl...@us...> - 2004-06-19 14:56:02
|
Update of /cvsroot/cpptool/CppParser/examples/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32609/examples/parser Modified Files: cpp_grammar.txt cppparsertest.cpp Log Message: * refactoring occurence of cv_qualifiers_seq workaround_type_specifier cv_qualifiers_seq to type_specifier. Index: cpp_grammar.txt =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/cpp_grammar.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** cpp_grammar.txt 19 Jun 2004 14:53:07 -0000 1.5 --- cpp_grammar.txt 19 Jun 2004 14:55:52 -0000 1.6 *************** *** 590,595 **** # fixed bug: added support for pointer return types ! function_return_type = ?(cv_qualifier_seq) workaround_type_specifier ! ?(cv_qualifier_seq) ?( :node( 'ptr_operator_declarator', +( ptr_operator ) ) ); --- 590,594 ---- # fixed bug: added support for pointer return types ! function_return_type = type_specifier ?( :node( 'ptr_operator_declarator', +( ptr_operator ) ) ); Index: cppparsertest.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/cppparsertest.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** cppparsertest.cpp 19 Jun 2004 14:51:22 -0000 1.5 --- cppparsertest.cpp 19 Jun 2004 14:55:52 -0000 1.6 *************** *** 983,991 **** { CPPPARSER_ASSERT_TREE( "void initialize(){}", "function_definition", ! testNode( "function_definition", ! testNode( "function_return_type", fundamentalTypeNode("void") ), ! declaratorIdNode( "initialize", 1 ), ! testNode( "function_parameters", "(", ")" ), ! jokerNode( "compound_statement" ) ) ); CPPPARSER_ASSERT_MATCH( "void initialize() {}", "function_definition" ); CPPPARSER_ASSERT_MATCH( "void initialize() const volatile {}", "function_definition" ); --- 983,992 ---- { CPPPARSER_ASSERT_TREE( "void initialize(){}", "function_definition", ! testNode( "function_definition", ! testNode( "function_return_type", ! testNode( "type_specifier", fundamentalTypeNode("void") ) ), ! declaratorIdNode( "initialize", 1 ), ! testNode( "function_parameters", "(", ")" ), ! jokerNode( "compound_statement" ) ) ); CPPPARSER_ASSERT_MATCH( "void initialize() {}", "function_definition" ); CPPPARSER_ASSERT_MATCH( "void initialize() const volatile {}", "function_definition" ); |
From: Baptiste L. <bl...@us...> - 2004-06-19 14:53:15
|
Update of /cvsroot/cpptool/CppParser/examples/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30126/examples/parser Modified Files: cpp_grammar.txt Log Message: * replaced parameter_type with type_specifier Index: cpp_grammar.txt =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/cpp_grammar.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** cpp_grammar.txt 19 Jun 2004 14:51:22 -0000 1.4 --- cpp_grammar.txt 19 Jun 2004 14:53:07 -0000 1.5 *************** *** 520,529 **** opt_parameter_decl_assign = ?( :node( 'assign_initializer', '=' assignment_expression ) ); - parameter_type = type_specifier; - new_type = workaround_type_specifier; parameter_declaration = :node( 'function_parameter', ! :node('declaration_specifier', parameter_type) :node('declarator', declarator | abstract_declarator) opt_parameter_decl_assign ); --- 520,527 ---- opt_parameter_decl_assign = ?( :node( 'assign_initializer', '=' assignment_expression ) ); new_type = workaround_type_specifier; parameter_declaration = :node( 'function_parameter', ! :node('declaration_specifier', type_specifier) :node('declarator', declarator | abstract_declarator) opt_parameter_decl_assign ); |
From: Baptiste L. <bl...@us...> - 2004-06-19 14:51:31
|
Update of /cvsroot/cpptool/CppParser/examples/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28188/examples/parser Modified Files: cpp_grammar.txt cppparsertest.cpp Log Message: * refactoring occurence of cv_qualifiers_seq workaround_type_specifier cv_qualifiers_seq to type_specifier. Index: cpp_grammar.txt =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/cpp_grammar.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** cpp_grammar.txt 19 Jun 2004 14:46:07 -0000 1.3 --- cpp_grammar.txt 19 Jun 2004 14:51:22 -0000 1.4 *************** *** 451,455 **** typedef_decl_specifiers = :node( 'typedef_specifier', ! 'typedef' ?(cv_qualifier_seq) workaround_type_specifier ?(cv_qualifier_seq) ); friend_decl_specifiers = :node( 'friend_specifier', --- 451,455 ---- typedef_decl_specifiers = :node( 'typedef_specifier', ! 'typedef' type_specifier ); friend_decl_specifiers = :node( 'friend_specifier', *************** *** 520,524 **** opt_parameter_decl_assign = ?( :node( 'assign_initializer', '=' assignment_expression ) ); ! parameter_type = ?(cv_qualifier_seq) workaround_type_specifier ?(cv_qualifier_seq); new_type = workaround_type_specifier; --- 520,524 ---- opt_parameter_decl_assign = ?( :node( 'assign_initializer', '=' assignment_expression ) ); ! parameter_type = type_specifier; new_type = workaround_type_specifier; Index: cppparsertest.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/cppparsertest.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** cppparsertest.cpp 19 Jun 2004 14:46:07 -0000 1.4 --- cppparsertest.cpp 19 Jun 2004 14:51:22 -0000 1.5 *************** *** 920,928 **** "(", testNode("function_parameter", ! testNode("declaration_specifier", fundamentalTypeNode("int")), testNode("declarator", declaratorIdNode( "x", 1 ) ) ), ",", testNode("function_parameter", ! testNode("declaration_specifier", fundamentalTypeNode("int")), testNode("declarator", declaratorIdNode( "y", 1 ) ), testNode("assign_initializer", "=", --- 920,928 ---- "(", testNode("function_parameter", ! testNode("declaration_specifier", testNode( "type_specifier", fundamentalTypeNode("int") ) ), testNode("declarator", declaratorIdNode( "x", 1 ) ) ), ",", testNode("function_parameter", ! testNode("declaration_specifier", testNode( "type_specifier", fundamentalTypeNode("int") ) ), testNode("declarator", declaratorIdNode( "y", 1 ) ), testNode("assign_initializer", "=", |
From: Baptiste L. <bl...@us...> - 2004-06-19 14:46:16
|
Update of /cvsroot/cpptool/CppParser/examples/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22086/examples/parser Modified Files: cpp_grammar.txt cppparsertest.cpp grammar_tree.txt Log Message: * renamed type_specifier_seq to type_specifier * refactoring occurence of cv_qualifiers_seq workaround_type_specifier cv_qualifiers_seq to type_specifier. Index: grammar_tree.txt =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/grammar_tree.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** grammar_tree.txt 19 Jun 2004 12:24:30 -0000 1.1 --- grammar_tree.txt 19 Jun 2004 14:46:07 -0000 1.2 *************** *** 5,15 **** | namespace_alias_def[ id ! namespace_specifier ! ~ n id] | using_declaration[ using_id ! ~ n id] | using_directive[ ! ~ n id] | simple_declaration[ [ typedef_decl_specifiers --- 5,15 ---- | namespace_alias_def[ id ! namespace_specifier[...] ! ~ n id] // +(namespace_name) | using_declaration[ using_id ! ~ n id] // @todo any_id | using_directive[ ! namespace_specifier[...] ] | simple_declaration[ [ typedef_decl_specifiers *************** *** 28,35 **** ? cv_qualifiers | friend_specifier[ ! !content same as declaration_specifier ! ] | declaration_specifier[ ! !content same as friend_specifier ? storage_class_specifier ? function_specifier --- 28,34 ---- ? cv_qualifiers | friend_specifier[ ! declaration_specifier[...] ] | declaration_specifier[ ! //content same as friend_specifier ? storage_class_specifier ? function_specifier Index: cpp_grammar.txt =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/cpp_grammar.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cpp_grammar.txt 19 Jun 2004 12:47:06 -0000 1.2 --- cpp_grammar.txt 19 Jun 2004 14:46:07 -0000 1.3 *************** *** 292,296 **** condition = expression ! | [ type_specifier_seq declarator '='assignment_expression ] ; --- 292,296 ---- condition = expression ! | [ type_specifier declarator '='assignment_expression ] ; *************** *** 357,361 **** # Notes: OK. No parsing issue qualified_namespace_specifier = :node( 'namespace_specifier', ! ?('::') ?(nested_name_specifier) namespace_name ); namespace_body = '{' declaration_seq '}'; named_namespace_definition = 'namespace' id namespace_body; --- 357,361 ---- # Notes: OK. No parsing issue qualified_namespace_specifier = :node( 'namespace_specifier', ! ?('::') *(id '::') namespace_name ); namespace_body = '{' declaration_seq '}'; named_namespace_definition = 'namespace' id namespace_body; *************** *** 446,451 **** standard_decl_specifier_impl = ?( storage_class_specifier ) ! ?( function_specifier ) ?( cv_qualifier_seq ) ! workaround_type_specifier ?( cv_qualifier_seq ); standard_decl_specifiers = :node( 'declaration_specifier', standard_decl_specifier_impl ); --- 446,450 ---- standard_decl_specifier_impl = ?( storage_class_specifier ) ! ?( function_specifier ) type_specifier; standard_decl_specifiers = :node( 'declaration_specifier', standard_decl_specifier_impl ); *************** *** 553,557 **** # defined in A71, declarators, p807 , after cv_qualifier ! type_id = :node( 'type_id', type_specifier_seq ?( abstract_declarator ) ); # removed infinite left recursion --- 552,556 ---- # defined in A71, declarators, p807 , after cv_qualifier ! type_id = :node( 'type_id', type_specifier ?( abstract_declarator ) ); # removed infinite left recursion *************** *** 581,587 **** init_declarator_list = :node( 'init_declarators', list( init_declarator, ',' ) ); ! type_specifier_seq = :node( 'type_specifier', ! ?(cv_qualifier_seq) workaround_type_specifier ! ?(cv_qualifier_seq) ); function_body = compound_statement; --- 580,586 ---- init_declarator_list = :node( 'init_declarators', list( init_declarator, ',' ) ); ! type_specifier = :node( 'type_specifier', ! ?(cv_qualifier_seq) workaround_type_specifier ! ?(cv_qualifier_seq) ); function_body = compound_statement; *************** *** 596,600 **** ?(cv_qualifier_seq) ?( :node( 'ptr_operator_declarator', +( ptr_operator ) ) ); - #function_return_type = ?(cv_qualifier_seq) workaround_type_specifier ?(cv_qualifier_seq); function_declarator = declarator_id direct_abstract_declarator_fn_suffix; --- 595,598 ---- *************** *** 674,678 **** conversion_type_id = :node('conversion_type', ! type_specifier_seq ?( conversion_declarator )); conversion_function_id = :node('conversion_function_ref', --- 672,676 ---- conversion_type_id = :node('conversion_type', ! type_specifier ?( conversion_declarator )); conversion_function_id = :node('conversion_function_ref', *************** *** 735,739 **** throw_expression = 'throw' ?( assignment_expression ); ! exception_declaration = [ type_specifier_seq ?( declarator | abstract_declarator ) ] | '...'; --- 733,737 ---- throw_expression = 'throw' ?( assignment_expression ); ! exception_declaration = [ type_specifier ?( declarator | abstract_declarator ) ] | '...'; Index: cppparsertest.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/cppparsertest.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** cppparsertest.cpp 19 Jun 2004 12:47:06 -0000 1.3 --- cppparsertest.cpp 19 Jun 2004 14:46:07 -0000 1.4 *************** *** 1031,1034 **** --- 1031,1038 ---- CPPPARSER_ASSERT_MATCH( "namespace fs = ::boost::filesystem;", "namespace_alias_definition" ); CPPPARSER_ASSERT_MATCH( "namespace b = boost;", "namespace_alias_definition" ); + CPPPARSER_ASSERT_TREE( "namespace fs=boost::filesystem;", "namespace_alias_definition", + testNode( "namespace_alias_def", "namespace", spaces_t(1), id_t("fs"), "=", + testNode("namespace_specifier", id_t("boost"), "::", id_t("filesystem") ), + ";" ) ); } *************** *** 1052,1055 **** --- 1056,1064 ---- CPPPARSER_ASSERT_MATCH( "using namespace std;", "using_directive" ); CPPPARSER_ASSERT_MATCH( "using namespace ::std;", "using_directive" ); + CPPPARSER_ASSERT_TREE( "using namespace ::boost::filesystem;", "using_directive", + testNode( "using_directive", "using", spaces_t(1), "namespace", + testNode("namespace_specifier", spaces_t(1), + "::", id_t("boost"), "::", id_t("filesystem") ), + ";" ) ); } *************** *** 1127,1136 **** CppParserTest::testTypeSpecifierSeqParser() { ! CPPPARSER_ASSERT_MATCH( "const int", "type_specifier_seq" ); ! CPPPARSER_ASSERT_MATCH( "enum MyEnum {}", "type_specifier_seq" ); ! CPPPARSER_ASSERT_MATCH( "int const", "type_specifier_seq" ); ! CPPPARSER_ASSERT_MATCH( "volatile double", "type_specifier_seq" ); ! CPPPARSER_ASSERT_MATCH( "struct MyNamespace::MyStruct", "type_specifier_seq" ); ! CPPPARSER_ASSERT_MATCH( "class MyClass {}", "type_specifier_seq" ); // more case to test } --- 1136,1145 ---- CppParserTest::testTypeSpecifierSeqParser() { ! CPPPARSER_ASSERT_MATCH( "const int", "type_specifier" ); ! CPPPARSER_ASSERT_MATCH( "enum MyEnum {}", "type_specifier" ); ! CPPPARSER_ASSERT_MATCH( "int const", "type_specifier" ); ! CPPPARSER_ASSERT_MATCH( "volatile double", "type_specifier" ); ! CPPPARSER_ASSERT_MATCH( "struct MyNamespace::MyStruct", "type_specifier" ); ! CPPPARSER_ASSERT_MATCH( "class MyClass {}", "type_specifier" ); // more case to test } *************** *** 1178,1182 **** CPPPARSER_ASSERT_TREE( "int x=2;", "simple_declaration", testNode( "simple_declaration", ! testNode( "declaration_specifier", fundamentalTypeNode("int" ) ), testNode( "init_declarators", testNode( "init_declarator", --- 1187,1192 ---- CPPPARSER_ASSERT_TREE( "int x=2;", "simple_declaration", testNode( "simple_declaration", ! testNode( "declaration_specifier", ! testNode( "type_specifier", fundamentalTypeNode("int" ) ) ), testNode( "init_declarators", testNode( "init_declarator", *************** *** 1188,1193 **** testNode( "simple_declaration", testNode( "declaration_specifier", ! testNode( "forward_class_specifier", "class", ! testNode( "forwarded_type_id", spaces_t(1), id_t("Tools"), "::", id_t("String") ) ) ), ";" ) ); CPPPARSER_ASSERT_MATCH( "void main();", "simple_declaration" ); --- 1198,1205 ---- testNode( "simple_declaration", testNode( "declaration_specifier", ! testNode( "type_specifier", ! testNode( "forward_class_specifier", "class", ! testNode( "forwarded_type_id", ! spaces_t(1), id_t("Tools"), "::", id_t("String") ) ) ) ), ";" ) ); CPPPARSER_ASSERT_MATCH( "void main();", "simple_declaration" ); *************** *** 1337,1346 **** testNode( "compound_statement", "{", "}" ) ) ), testNode( "member_declaration", ! testNode( "declaration_specifier", fundamentalTypeNode("void") ), testNode( "declarator", declaratorIdNode( "initialize", 1 ), testNode( "function_parameters", "(", ")" ) ), ";" ), testNode( "member_declaration", ! testNode( "declaration_specifier", fundamentalTypeNode("int") ), testNode( "declarator", declaratorIdNode( "x_", 1 ) ), ";" ), --- 1349,1358 ---- testNode( "compound_statement", "{", "}" ) ) ), testNode( "member_declaration", ! testNode( "declaration_specifier", testNode( "type_specifier", fundamentalTypeNode("void") ) ), testNode( "declarator", declaratorIdNode( "initialize", 1 ), testNode( "function_parameters", "(", ")" ) ), ";" ), testNode( "member_declaration", ! testNode( "declaration_specifier", testNode( "type_specifier", fundamentalTypeNode("int") ) ), testNode( "declarator", declaratorIdNode( "x_", 1 ) ), ";" ), *************** *** 1596,1604 **** testNode( "simple_declaration", testNode( "declaration_specifier", ! testNode( "class_specifier", ! "class", ! testNode( "class_name", ! testNode( "id", spaces_t(1), id_t("C1") ) ), ! spaces_t(1), "{", "}" ) ), ";" ) ) ) ); --- 1608,1617 ---- testNode( "simple_declaration", testNode( "declaration_specifier", ! testNode( "type_specifier", ! testNode( "class_specifier", ! "class", ! testNode( "class_name", ! testNode( "id", spaces_t(1), id_t("C1") ) ), ! spaces_t(1), "{", "}" ) ) ), ";" ) ) ) ); |
From: Baptiste L. <bl...@us...> - 2004-06-19 12:47:16
|
Update of /cvsroot/cpptool/CppParser/examples/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9867/examples/parser Modified Files: cpp_grammar.txt cppparsertest.cpp Log Message: * cleaned up declaration_seq tree structure Index: cpp_grammar.txt =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/cpp_grammar.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** cpp_grammar.txt 8 Jun 2004 20:23:13 -0000 1.1.1.1 --- cpp_grammar.txt 19 Jun 2004 12:47:06 -0000 1.2 *************** *** 91,95 **** # A.4, C++PL3 p.798 ! translation_unit = :node( 'translation_unit', ?( declaration_seq ) ); --- 91,95 ---- # A.4, C++PL3 p.798 ! translation_unit = :node( 'translation_unit', declaration_seq ); *************** *** 351,364 **** declaration_error_recovery = :node( 'declaration_error', :cpp_block_error_recovery() ); ! declaration_seq = +( declaration | declaration_error_recovery ); # A.7, C++PL3 p.805-806 # => parse namespace declaration and namespace alias declaration # Notes: OK. No parsing issue - namespace_body = ?( :node( 'namespace_body', declaration_seq ) ); qualified_namespace_specifier = :node( 'namespace_specifier', ?('::') ?(nested_name_specifier) namespace_name ); ! named_namespace_definition = 'namespace' id '{' namespace_body '}'; ! unnamed_namespace_definition = 'namespace' '{' namespace_body '}'; namespace_definition = :node( 'named_namespace_def', named_namespace_definition ) | :node( 'unnamed_namespace_def', unnamed_namespace_definition ) --- 351,364 ---- declaration_error_recovery = :node( 'declaration_error', :cpp_block_error_recovery() ); ! declaration_seq = :node('declarations', *( declaration | declaration_error_recovery ) ); # A.7, C++PL3 p.805-806 # => parse namespace declaration and namespace alias declaration # Notes: OK. No parsing issue qualified_namespace_specifier = :node( 'namespace_specifier', ?('::') ?(nested_name_specifier) namespace_name ); ! namespace_body = '{' declaration_seq '}'; ! named_namespace_definition = 'namespace' id namespace_body; ! unnamed_namespace_definition = 'namespace' namespace_body; namespace_definition = :node( 'named_namespace_def', named_namespace_definition ) | :node( 'unnamed_namespace_def', unnamed_namespace_definition ) *************** *** 375,379 **** using_declaration = :node('using_declaration', 'using' using_id ';' ); ! using_directive = 'using' 'namespace' qualified_namespace_specifier ';'; # A.7, C++PL3 p.806 --- 375,380 ---- using_declaration = :node('using_declaration', 'using' using_id ';' ); ! using_directive = :node( 'using_directive', ! 'using' 'namespace' qualified_namespace_specifier ';' ); # A.7, C++PL3 p.806 *************** *** 381,385 **** asm_keyword = %'asm __asm'; ! asm_definition = asm_keyword '(' $string ')' ';'; # A.7, C++PL3 p.806 --- 382,386 ---- asm_keyword = %'asm __asm'; ! asm_definition = :node( 'asm_definition', asm_keyword '(' $string ')' ';' ); # A.7, C++PL3 p.806 *************** *** 387,391 **** linkage_specification_begin = 'extern' $string; linkage_specification = :node( 'linkage_specification', ! linkage_specification_begin [ [ '{' ?(declaration_seq) '}' ] | declaration ] ); --- 388,392 ---- linkage_specification_begin = 'extern' $string; linkage_specification = :node( 'linkage_specification', ! linkage_specification_begin [ [ '{' declaration_seq '}' ] | declaration ] ); *************** *** 708,712 **** # don't you this until we can now for sure that the id of the template_name is really an id # => would otherwise be confused with expression such as x < y && x > z. ! template_id = template_name '<' ?( template_argument_list ) '>'; type_parameter = --- 709,713 ---- # don't you this until we can now for sure that the id of the template_name is really an id # => would otherwise be confused with expression such as x < y && x > z. ! template_id = :node( 'template_id', template_name '<' ?( template_argument_list ) '>' ); type_parameter = Index: cppparsertest.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/cppparsertest.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cppparsertest.cpp 14 Jun 2004 23:08:11 -0000 1.2 --- cppparsertest.cpp 19 Jun 2004 12:47:06 -0000 1.3 *************** *** 1060,1063 **** --- 1060,1070 ---- CPPPARSER_ASSERT_MATCH( "namespace { } ", "namespace_definition" ); CPPPARSER_ASSERT_MATCH( "namespace MyWork { } ", "namespace_definition" ); + CPPPARSER_ASSERT_TREE( "namespace MyWork{} ", "namespace_definition", + testNode( "named_namespace_def", + "namespace", spaces_t(1), id_t( "MyWork" ), "{", + jokerNode( "declarations" ), "}" ) ); + CPPPARSER_ASSERT_TREE( "namespace{} ", "namespace_definition", + testNode( "unnamed_namespace_def", + "namespace", "{", jokerNode( "declarations" ), "}" ) ); } *************** *** 1100,1103 **** --- 1107,1114 ---- CPPPARSER_ASSERT_MATCH( "extern \"C\" { int x; void fn(); }", "linkage_specification" ); CPPPARSER_ASSERT_MATCH( "extern \"C\" int x;", "linkage_specification" ); + CPPPARSER_ASSERT_TREE( "extern \"C\"{}", "linkage_specification", + testNode( "linkage_specification", + "extern", spaces_t(1), string_t("C"), "{", + jokerNode("declarations"), "}" ) ); } *************** *** 1582,1593 **** "translation_unit", testNode( "translation_unit", ! testNode( "simple_declaration", ! testNode( "declaration_specifier", ! testNode( "class_specifier", ! "class", ! testNode( "class_name", ! testNode( "id", spaces_t(1), id_t("C1") ) ), ! spaces_t(1), "{", "}" ) ), ! ";" ) ) ); //CPPPARSER_ASSERT_TREE( "namespace N1 { namespace N2 {} }", --- 1593,1605 ---- "translation_unit", testNode( "translation_unit", ! testNode( "declarations", ! testNode( "simple_declaration", ! testNode( "declaration_specifier", ! testNode( "class_specifier", ! "class", ! testNode( "class_name", ! testNode( "id", spaces_t(1), id_t("C1") ) ), ! spaces_t(1), "{", "}" ) ), ! ";" ) ) ) ); //CPPPARSER_ASSERT_TREE( "namespace N1 { namespace N2 {} }", *************** *** 1613,1620 **** , "translation_unit", testNode( "translation_unit", ! jokerNode("simple_declaration"), ! testNode("declaration_error", ! id_t("WEIRD_MACRO"), "(",int_t("12"),")", ! "int", spaces_t(1), id_t("x"), ";" ), ! jokerNode("simple_declaration") ) ); } --- 1625,1633 ---- , "translation_unit", testNode( "translation_unit", ! testNode( "declarations", ! jokerNode("simple_declaration"), ! testNode("declaration_error", ! id_t("WEIRD_MACRO"), "(",int_t("12"),")", ! "int", spaces_t(1), id_t("x"), ";" ), ! jokerNode("simple_declaration") ) ) ); } |
From: Baptiste L. <bl...@us...> - 2004-06-19 12:25:56
|
Update of /cvsroot/cpptool/CppParser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21911 Added Files: .cvsignore Log Message: * hide some working directory --- NEW FILE: .cvsignore --- backup build wiki libs |
From: Baptiste L. <bl...@us...> - 2004-06-19 12:24:40
|
Update of /cvsroot/cpptool/CppParser/examples/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20423/examples/parser Added Files: grammar_tree.txt Log Message: * possible grammar tree. used to clean-up the tree produced by the grammar for easier analysis --- NEW FILE: grammar_tree.txt --- /* C++ grammar Tree */ translation_unit[ n declaration_error | namespace_alias_def[ id namespace_specifier ~ n id] | using_declaration[ using_id ~ n id] | using_directive[ ~ n id] | simple_declaration[ [ typedef_decl_specifiers cv_qualifiers [ fundamental_type_specifier | type_name | enum_specifier[ id n enumerator_definition[ id constant_expression[...] ] ] | class_specifier[...] | elaborated_type_specifier[ ] ? cv_qualifiers | friend_specifier[ !content same as declaration_specifier ] | declaration_specifier[ !content same as friend_specifier ? storage_class_specifier ? function_specifier ? cv_qualifiers workaround_type_specifier ! same as typedef_decl_specifiers ? cv_qualifiers ] ] ? init_declarators[ n init_declarator[ declarator[...] ? assign_initializer[ [ assignment_expression[...] // = 1234 | n initializer_clause ] // = {1,2,3,4} | expression_list[...] // (1,2,3,4) ctor ] ] ] ] ] | linkage_specification[ 'extern' $string [ '{' !declaration_seq '}' => same as translation_unit | declaration[...] ] ] | named_namespace_def[ id namespace_body[ !declaration_seq ] ] | unnamed_namespace_def[ namespace_body[ !declaration_seq ] ] | function_definition[ ... ] | template_declaration[ ... ] | explicit_template_instantiation[...] | explicit_template_specialization[...] ///////////////////////////////// class_specifier[ class_name ? dll_macro[ id] ? nested_name_specifier[...] id[ id] | template_id[...] ? class_bases[ n base_specifier[ base_class_access ? 'virtual' %access_specifier ? 'virtual'] base_class_name[ ? nested_name_specifier id] ] ? member_specification[ n access_specification[ %access_specifier ] | member_declaration[ member_function_definition[ function_definition[ ? function_return_type declarator_id[~ n id] function_parameters[ n function_parameter[ declaration_specifier[ ] declarator[ ? ptr_operator_declarator[ '*' ? cv_qualifier_seq[...] | '&' | pointer_to_member[ nested_name_specifier[..] ?cv_qualifier_seq[...] ] ] declarator_id[...] | braced_declarator[ declarator[...] ] function_parameters[...] | abstract_array_declarator[ constant_expression[...] ] ? assign_initializer[ assignment_expression[...] ] ] ? ellipsis_parameter[ '...' ] ? cv_qualifiers ? exception_specification ] ? cv_qualifiers[ n cv_qualifier] ? exception_specification[ type_id_list[ type_id[...] ] ] ] | member_error[...] ] ] |
Update of /cvsroot/cpptool/CppParser/examples/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27491/examples/parser Modified Files: cpp_parser.suo cppparsertest.cpp grammarparsertest.cpp preprocessortest.cpp scope.cpp scope.h symboltabletest.cpp Log Message: * fixed namespace resolution issue N1::N1 Index: cpp_parser.suo =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/cpp_parser.suo,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Binary files /tmp/cvsxDu2Vr and /tmp/cvsYNIMJq differ Index: scope.h =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/scope.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** scope.h 8 Jun 2004 20:23:17 -0000 1.1.1.1 --- scope.h 14 Jun 2004 23:08:11 -0000 1.2 *************** *** 53,56 **** --- 53,62 ---- virtual SymbolDeclarationPtr resolve( const std::string &name ) const = 0; + // to not recurse down + virtual SymbolDeclarationPtr memberResolve( const std::string &name ) const = 0; + + // default, none + virtual SymbolDeclarationPtr getMemberDeclaration( const std::string &name ) const; + // default is false virtual bool isTypeDeclaration() const; *************** *** 80,83 **** --- 86,90 ---- void accept( ScopeVisitor &visitor ); SymbolDeclarationPtr resolve( const std::string &name ) const; + SymbolDeclarationPtr memberResolve( const std::string &name ) const; std::string str() const; private: *************** *** 91,94 **** --- 98,102 ---- DeclarationScope( const SymbolDeclarationPtr &declaration ); SymbolDeclarationPtr declaration() const; + SymbolDeclarationPtr getMemberDeclaration( const std::string &name ) const; private: SymbolDeclarationPtr declaration_; *************** *** 100,103 **** --- 108,112 ---- void accept( ScopeVisitor &visitor ); SymbolDeclarationPtr resolve( const std::string &name ) const; + SymbolDeclarationPtr memberResolve( const std::string &name ) const; std::string str() const; }; *************** *** 111,114 **** --- 120,124 ---- void accept( ScopeVisitor &visitor ); SymbolDeclarationPtr resolve( const std::string &name ) const; + SymbolDeclarationPtr memberResolve( const std::string &name ) const; std::string str() const; }; *************** *** 125,128 **** --- 135,139 ---- void accept( ScopeVisitor &visitor ); SymbolDeclarationPtr resolve( const std::string &name ) const; + SymbolDeclarationPtr memberResolve( const std::string &name ) const; std::string str() const; bool isTypeDeclaration() const; *************** *** 139,142 **** --- 150,154 ---- void accept( ScopeVisitor &visitor ); SymbolDeclarationPtr resolve( const std::string &name ) const; + SymbolDeclarationPtr memberResolve( const std::string &name ) const; std::string str() const; bool isTypeDeclaration() const; *************** *** 159,162 **** --- 171,175 ---- void accept( ScopeVisitor &visitor ); SymbolDeclarationPtr resolve( const std::string &name ) const; + SymbolDeclarationPtr memberResolve( const std::string &name ) const; std::string str() const; private: *************** *** 180,183 **** --- 193,197 ---- void accept( ScopeVisitor &visitor ); SymbolDeclarationPtr resolve( const std::string &name ) const; + SymbolDeclarationPtr memberResolve( const std::string &name ) const; std::string str() const; }; Index: cppparsertest.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/cppparsertest.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** cppparsertest.cpp 8 Jun 2004 20:23:12 -0000 1.1.1.1 --- cppparsertest.cpp 14 Jun 2004 23:08:11 -0000 1.2 *************** *** 257,261 **** Parser::CppParser::tokenize( "operator =", actual ); Parser::Tokens expected = tokens( "operator", spaces_t( 1 ), "=" ); ! CppUT::checkStlSequenceEqual( expected, actual, &weakTokenEqual ); } --- 257,261 ---- Parser::CppParser::tokenize( "operator =", actual ); Parser::Tokens expected = tokens( "operator", spaces_t( 1 ), "=" ); ! CppUT::checkCustomEqualityStlSequenceEqual( expected, actual, &weakTokenEqual ); } Index: preprocessortest.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/preprocessortest.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** preprocessortest.cpp 8 Jun 2004 20:23:17 -0000 1.1.1.1 --- preprocessortest.cpp 14 Jun 2004 23:08:11 -0000 1.2 *************** *** 30,34 **** Parser::Tokens actual; Parser::CppParser::preprocess( input, actual ); ! CppUT::checkStlSequenceEqual( expected, actual, &weakTokenEqual ); } --- 30,34 ---- Parser::Tokens actual; Parser::CppParser::preprocess( input, actual ); ! CppUT::checkCustomEqualityStlSequenceEqual( expected, actual, &weakTokenEqual ); } *************** *** 40,44 **** Parser::CppParser::preprocess( "operator =", actual ); Parser::Tokens expected = tokens( "operator", spaces_t( 1 ), "=" ); ! CppUT::checkStlSequenceEqual( expected, actual, &weakTokenEqual ); } --- 40,44 ---- Parser::CppParser::preprocess( "operator =", actual ); Parser::Tokens expected = tokens( "operator", spaces_t( 1 ), "=" ); ! CppUT::checkCustomEqualityStlSequenceEqual( expected, actual, &weakTokenEqual ); } Index: symboltabletest.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/symboltabletest.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** symboltabletest.cpp 8 Jun 2004 20:23:18 -0000 1.1.1.1 --- symboltabletest.cpp 14 Jun 2004 23:08:11 -0000 1.2 *************** *** 319,323 **** { public: ! DeclarationChecker( Parser::SymbolTable &table, LocationTracker &tracker_ ); --- 319,323 ---- { public: ! DeclarationChecker( Parser::Project &project, LocationTracker &tracker_ ); *************** *** 341,345 **** --- 341,347 ---- void exitScope(); Parser::SymbolDeclarationPtr resolve( const std::string &name ) const; + Parser::SymbolDeclarationPtr memberResolve( const std::string &name ) const; + Parser::Project &project_; Parser::SymbolTable &table_; typedef CppUT::Enumerator<NodePtr> NodeEnumerator; *************** *** 351,357 **** ! DeclarationChecker::DeclarationChecker( Parser::SymbolTable &table, LocationTracker &tracker ) ! : table_( table ) , tracker_( tracker ) { --- 353,389 ---- ! struct LocationStringizer ! { ! LocationStringizer( Parser::Project &project ) ! : project_( project ) ! { ! } ! ! std::string operator()( const Parser::Location &location ) const ! { ! std::ostringstream os; ! std::string path = project_.sourcePath( location.file() ); ! std::string text = project_.readSourceFile( path ); ! int line = std::count( text.begin(), text.begin() + location.pos(), '\n' ); ! int lastEOLPos = text.rfind( '\n', location.pos() ); ! int column = location.pos(); ! if ( lastEOLPos != std::string::npos ) ! column -= lastEOLPos; ! os << "Location<file=" << location.file() ! << ":\"" << path << "\"; line=" << (line+1) ! << "; column=" << (column+1) ! << "; pos=" << location.pos() ! << ">"; ! return os.str(); ! } ! ! Parser::Project &project_; ! }; ! ! ! DeclarationChecker::DeclarationChecker( Parser::Project &project, LocationTracker &tracker ) ! : project_( project ) ! , table_( project.symbolTable() ) , tracker_( tracker ) { *************** *** 377,380 **** --- 409,413 ---- DeclarationChecker::resolve( const std::string &name ) const { + // Notes: investigate needs for resolve/memberResolve... Parser::ScopePtr currentScope = scopes_.top(); return currentScope->resolve( name ); *************** *** 382,385 **** --- 415,426 ---- + Parser::SymbolDeclarationPtr + DeclarationChecker::memberResolve( const std::string &name ) const + { + Parser::ScopePtr currentScope = scopes_.top(); + return currentScope->memberResolve( name ); + } + + CppUT::Message DeclarationChecker::makeMessage( const NodePtr &node, *************** *** 407,413 **** } ! CppUT::checkSetEqual( CppUT::enumStl( expectedLocations ), table_.enumReferences( declaration ), makeMessage( references, "Some references are incorrect..." ) ); } --- 448,461 ---- } ! LocationStringizer stringizer( project_ ); ! CppUT::checkCustomStringSetEqual( CppUT::enumStl( expectedLocations ), ! table_.enumReferences( declaration ), ! stringizer, ! makeMessage( references, ! "Some references are incorrect..." ) ); ! /* CppUT::checkSetEqual( CppUT::enumStl( expectedLocations ), table_.enumReferences( declaration ), makeMessage( references, "Some references are incorrect..." ) ); + */ } *************** *** 489,493 **** { std::string namespaceName = namespaceNode->braceValue(); ! Parser::SymbolDeclarationPtr declaration = resolve( namespaceName ); CppUT::checkTrue( declaration, makeMessage( namespaceNode, "Declaration not found." ) ); checkReferences( namespaceNode, declaration ); --- 537,541 ---- { std::string namespaceName = namespaceNode->braceValue(); ! Parser::SymbolDeclarationPtr declaration = memberResolve( namespaceName ); CppUT::checkTrue( declaration, makeMessage( namespaceNode, "Declaration not found." ) ); checkReferences( namespaceNode, declaration ); *************** *** 536,540 **** processor.processFile( path ); NodePtr root = processor.declarationsTree(); ! DeclarationChecker checker( project_->symbolTable(), *tracker_ ); checker.checkDeclarations( root ); } --- 584,588 ---- processor.processFile( path ); NodePtr root = processor.declarationsTree(); ! DeclarationChecker checker( *project_, *tracker_ ); checker.checkDeclarations( root ); } Index: scope.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/scope.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** scope.cpp 8 Jun 2004 20:23:17 -0000 1.1.1.1 --- scope.cpp 14 Jun 2004 23:08:11 -0000 1.2 *************** *** 50,53 **** --- 50,60 ---- + SymbolDeclarationPtr + Scope::getMemberDeclaration( const std::string &name ) const + { + return SymbolDeclarationPtr(); + } + + bool Scope::isTypeDeclaration() const *************** *** 86,89 **** --- 93,109 ---- } + SymbolDeclarationPtr + OverallScope::memberResolve( const std::string &name ) const + { + TranslationUnitScopes::const_iterator it = scopes_.begin(); + for ( ; it != scopes_.end(); ++it ) + { + SymbolDeclarationPtr declaration = it->second->memberResolve( name ); + if ( declaration ) + return declaration; + } + return SymbolDeclarationPtr(); + } + std::string OverallScope::str() const *************** *** 108,111 **** --- 128,140 ---- + SymbolDeclarationPtr + DeclarationScope::getMemberDeclaration( const std::string &name ) const + { + if ( declaration_->name() == name ) + return declaration_; + return SymbolDeclarationPtr(); + } + + // class TranslationUnitScope // ////////////////////////////////////////////////////////////////// *************** *** 129,132 **** --- 158,173 ---- } + SymbolDeclarationPtr + TranslationUnitScope::memberResolve( const std::string &name ) const + { + for ( int index = 0; index < subScopeCount(); ++index ) + { + SymbolDeclarationPtr declaration = subScopeAt(index)->getMemberDeclaration( name ); + if ( declaration ) + return declaration; + } + return SymbolDeclarationPtr(); + } + std::string TranslationUnitScope::str() const *************** *** 167,170 **** --- 208,224 ---- } + SymbolDeclarationPtr + NamespaceScope::memberResolve( const std::string &name ) const + { + for ( int index = 0; index < subScopeCount(); ++index ) + { + SymbolDeclarationPtr declaration = subScopeAt(index)->getMemberDeclaration( name ); + if ( declaration ) + return declaration; + } + + return SymbolDeclarationPtr(); + } + std::string NamespaceScope::str() const *************** *** 204,207 **** --- 258,267 ---- } + SymbolDeclarationPtr + TypedefScope::memberResolve( const std::string &name ) const + { + return SymbolDeclarationPtr(); + } + std::string TypedefScope::str() const *************** *** 239,242 **** --- 299,308 ---- } + SymbolDeclarationPtr + ClassScope::memberResolve( const std::string &name ) const + { + return SymbolDeclarationPtr(); + } + std::string ClassScope::str() const *************** *** 324,327 **** --- 390,399 ---- } + SymbolDeclarationPtr + MemberFunctionScope::memberResolve( const std::string &name ) const + { + return SymbolDeclarationPtr(); + } + std::string MemberFunctionScope::str() const *************** *** 346,349 **** --- 418,427 ---- } + SymbolDeclarationPtr + BlockScope::memberResolve( const std::string &name ) const + { + return SymbolDeclarationPtr(); + } + std::string BlockScope::str() const Index: grammarparsertest.cpp =================================================================== RCS file: /cvsroot/cpptool/CppParser/examples/parser/grammarparsertest.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** grammarparsertest.cpp 8 Jun 2004 20:23:14 -0000 1.1.1.1 --- grammarparsertest.cpp 14 Jun 2004 23:08:11 -0000 1.2 *************** *** 19,23 **** Parser::Tokens actual; Parser::GrammarParser::tokenize( grammar, actual ); ! CppUT::checkStlSequenceEqual( expected, actual, &weakTokenEqual ); } --- 19,23 ---- Parser::Tokens actual; Parser::GrammarParser::tokenize( grammar, actual ); ! CppUT::checkCustomEqualityStlSequenceEqual( expected, actual, &weakTokenEqual ); } |
From: Baptiste L. <bl...@us...> - 2004-06-14 23:08:22
|
Update of /cvsroot/cpptool/CppParser/include/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27491/include/cpput Modified Files: assertenum.h stringize.h Log Message: * fixed namespace resolution issue N1::N1 Index: assertenum.h =================================================================== RCS file: /cvsroot/cpptool/CppParser/include/cpput/assertenum.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** assertenum.h 8 Jun 2004 20:23:19 -0000 1.1.1.1 --- assertenum.h 14 Jun 2004 23:08:12 -0000 1.2 *************** *** 44,51 **** template<class ExpectedEnumType ,class ActualEnumType ! ,class EqualityComparator> unsigned int getSequenceDiffIndex( ExpectedEnumType expected, ActualEnumType actual, ! EqualityComparator comparator ) { unsigned int diffIndex = 0; --- 44,51 ---- template<class ExpectedEnumType ,class ActualEnumType ! ,class EqualityPredicate> unsigned int getSequenceDiffIndex( ExpectedEnumType expected, ActualEnumType actual, ! EqualityPredicate comparator ) { unsigned int diffIndex = 0; *************** *** 105,115 **** enum { noDifference = -1 }; ! template<class ExpectedSeqType ! ,class ActualSeqType ! ,class EqualityComparator> ! void checkSequenceEqual( const ExpectedSeqType &expected, ! const ActualSeqType &actual, ! EqualityComparator comparator, ! const Message &message ) { unsigned int diffIndex = Impl::getSequenceDiffIndex( expected.clone(), --- 105,119 ---- enum { noDifference = -1 }; ! template<class ExpectedEnumerator ! ,class ActualEnumerator ! ,class ExpectedStringizer ! ,class ActualStringizer ! ,class EqualityPredicate> ! void checkCustomHeterogeneousSequenceEqual( const ExpectedEnumerator &expected, ! const ActualEnumerator &actual, ! ExpectedStringizer expectedStringizer, ! ActualStringizer actualStringizer, ! EqualityPredicate comparator, ! const Message &message ) { unsigned int diffIndex = Impl::getSequenceDiffIndex( expected.clone(), *************** *** 119,125 **** return; ! ExpectedSeqType common = enumSlice( expected, 0, diffIndex ); ! ExpectedSeqType expectedDiff = enumSlice( expected, diffIndex ); ! ActualSeqType actualDiff = enumSlice( actual, diffIndex ); Message newMessage( message ); --- 123,129 ---- return; ! ExpectedEnumerator common = enumSlice( expected, 0, diffIndex ); ! ExpectedEnumerator expectedDiff = enumSlice( expected, diffIndex ); ! ActualEnumerator actualDiff = enumSlice( actual, diffIndex ); Message newMessage( message ); *************** *** 127,178 **** newMessage.add( translate( "Divergence position (0 based): " ) + stringize(diffIndex) ); if ( common.length() > 0 ) ! newMessage.add( translate( "Common:\n" ) + enumToString(common) ); ! newMessage.add( translate( "Expected:\n" ) + enumToString(expectedDiff) ); ! newMessage.add( translate( "Actual:\n" ) + enumToString(actualDiff) ); fail( newMessage ); } ! template<class ExpectedSeqType ! ,class ActualSeqType ! ,class EqualityComparator> ! void checkStlSequenceEqual( const ExpectedSeqType &expected, ! const ActualSeqType &actual, ! EqualityComparator comparator, ! const Message &message = Message() ) { ! checkSequenceEqual( enumStl( expected ), enumStl( actual ), comparator, message ); } ! template<class ExpectedSeqType ! ,class ActualSeqType> ! void checkStlSequenceEqual( const ExpectedSeqType &expected, ! const ActualSeqType &actual, ! const Message &message = Message() ) { ! checkSequenceEqual( enumStl( expected ), enumStl( actual ), message ); } ! template<class ExpectedSeqType ! ,class ActualSeqType> ! void checkSequenceEqual( const ExpectedSeqType &expected, ! const ActualSeqType &actual, const Message &message = Message() ) { ! DefaultComparator<ExpectedSeqType::Type ! ,ActualSeqType::Type> comparator; ! checkSequenceEqual( expected, actual, comparator, message ); } ! template<class ExpectedSetType ! ,class ActualSetType ,class EqualityPredicate> ! void checkSetEqual( const ExpectedSetType &expected, ! const ActualSetType &actual, ! EqualityPredicate predicate, ! const Message &message ) { ! std::deque<ExpectedSetType::Type> missing; ! std::deque<ActualSetType::Type> extraneous; Impl::getSetDifference( expected, actual, missing, extraneous, --- 131,233 ---- newMessage.add( translate( "Divergence position (0 based): " ) + stringize(diffIndex) ); if ( common.length() > 0 ) ! newMessage.add( translate( "Common:\n" ) + enumToStringCustom(common, ! expectedStringizer) ); ! newMessage.add( translate( "Expected:\n" ) + enumToStringCustom(expectedDiff, ! expectedStringizer) ); ! newMessage.add( translate( "Actual:\n" ) + enumToStringCustom(actualDiff, ! actualStringizer) ); fail( newMessage ); } ! template<class EnumeratorType ! ,class StringizerType ! ,class EqualityPredicate> ! void checkCustomSequenceEqual( const EnumeratorType &expected, ! const EnumeratorType &actual, ! StringizerType stringizer, ! EqualityPredicate comparator, ! const Message &message ) { ! checkCustomHeterogeneousSequenceEqual( expected, actual, ! stringizer, stringizer, ! comparator, message ); } ! template<class EnumeratorType ! ,class StringizerType ! ,class EqualityPredicate> ! void checkCustomStringSequenceEqual( const EnumeratorType &expected, ! const EnumeratorType &actual, ! StringizerType stringizer, ! const Message &message = Message() ) { ! DefaultComparator<EnumeratorType::Type,EnumeratorType::Type> comparator; ! checkCustomHeterogeneousSequenceEqual( expected, actual, ! stringizer, stringizer, ! comparator, message ); ! } ! ! template<class ExpectedEnumerator ! ,class ActualEnumerator ! ,class EqualityPredicate> ! void checkCustomEqualitySequenceEqual( const ExpectedEnumerator &expected, ! const ActualEnumerator &actual, ! EqualityPredicate comparator, ! const Message &message = Message() ) ! { ! typedef DefaultStringizer<CPPUT_DEDUCED_TYPENAME ExpectedEnumerator::Type> ExpectedStringizer; ! typedef DefaultStringizer<CPPUT_DEDUCED_TYPENAME ActualEnumerator::Type> ActualStringizer; ! checkCustomHeterogeneousSequenceEqual( expected, actual, ! ExpectedStringizer(), ActualStringizer(), ! comparator, message ); } ! template<class ExpectedEnumeratorType ! ,class ActualEnumeratorType> ! void checkSequenceEqual( const ExpectedEnumeratorType &expected, ! const ActualEnumeratorType &actual, const Message &message = Message() ) { ! DefaultComparator<ExpectedEnumeratorType::Type ! ,ActualEnumeratorType::Type> comparator; ! checkCustomEqualitySequenceEqual( expected, actual, comparator, message ); } ! template<class ExpectedEnumeratorType ! ,class ActualEnumeratorType ,class EqualityPredicate> ! void checkCustomEqualityStlSequenceEqual( const ExpectedEnumeratorType &expected, ! const ActualEnumeratorType &actual, ! EqualityPredicate comparator, ! const Message &message = Message() ) { ! checkCustomEqualitySequenceEqual( enumStl( expected ), enumStl( actual ), ! comparator, message ); ! } ! ! template<class ExpectedEnumeratorType ! ,class ActualEnumeratorType> ! void checkStlSequenceEqual( const ExpectedEnumeratorType &expected, ! const ActualEnumeratorType &actual, ! const Message &message = Message() ) ! { ! checkSequenceEqual( enumStl( expected ), enumStl( actual ), message ); ! } ! ! template<class ExpectedEnumerator ! ,class ActualEnumerator ! ,class ExpectedStringizer ! ,class ActualStringizer ! ,class EqualityPredicate> ! void checkCustomHeterogeneousSetEqual( const ExpectedEnumerator &expected, ! const ActualEnumerator &actual, ! ExpectedStringizer expectedStringizer, ! ActualStringizer actualStringizer, ! EqualityPredicate predicate, ! const Message &message ) ! { ! std::deque<ExpectedEnumerator::Type> missing; ! std::deque<ActualEnumerator::Type> extraneous; Impl::getSetDifference( expected, actual, missing, extraneous, *************** *** 183,209 **** Message newMessage( message ); newMessage.add( translate( "Sets do not contain the same items." ) ); ! newMessage.add( translate( "Actual:\n" ) + enumToString(actual) ); if ( missing.size() > 0 ) ! newMessage.add( translate( "Missing:\n" ) + enumToString(enumStl(missing)) ); if ( extraneous.size() > 0 ) ! newMessage.add( translate( "Extraneous:\n" ) + enumToString(enumStl(extraneous)) ); fail( newMessage ); } ! template<class ExpectedSetType ! ,class ActualSetType> ! void checkSetEqual( const ExpectedSetType &expected, ! const ActualSetType &actual, const Message &message = Message() ) { ! DefaultComparator<ExpectedSetType::Type ! ,ActualSetType::Type> comparator; ! checkSetEqual( expected, actual, comparator, message ); } ! template<class ExpectedSetType ! ,class ActualSetType> ! void checkStlSetEqual( const ExpectedSetType &expected, ! const ActualSetType &actual, const Message &message = Message() ) { --- 238,309 ---- Message newMessage( message ); newMessage.add( translate( "Sets do not contain the same items." ) ); ! newMessage.add( translate( "Actual:\n" ) + enumToStringCustom(actual,actualStringizer) ); if ( missing.size() > 0 ) ! newMessage.add( translate( "Missing:\n" ) + enumToStringCustom(enumStl(missing), ! expectedStringizer) ); if ( extraneous.size() > 0 ) ! newMessage.add( translate( "Extraneous:\n" ) + enumToStringCustom(enumStl(extraneous), ! actualStringizer) ); fail( newMessage ); } ! template<class ExpectedEnumerator ! ,class ActualEnumerator ! ,class ItemStringizer ! ,class EqualityPredicate> ! void checkCustomSetEqual( const ExpectedEnumerator &expected, ! const ActualEnumerator &actual, ! ItemStringizer itemStringizer, ! EqualityPredicate comparator, ! const Message &message = Message() ) ! { ! checkCustomHeterogeneousSetEqual( expected, actual, ! itemStringizer, itemStringizer, ! comparator, message ); ! } ! ! template<class ExpectedEnumerator ! ,class ActualEnumerator ! ,class ItemStringizer> ! void checkCustomStringSetEqual( const ExpectedEnumerator &expected, ! const ActualEnumerator &actual, ! ItemStringizer itemStringizer, ! const Message &message = Message() ) ! { ! DefaultComparator<CPPUT_DEDUCED_TYPENAME ExpectedEnumerator::Type ! ,CPPUT_DEDUCED_TYPENAME ActualEnumerator::Type> comparator; ! checkCustomSetEqual( expected, actual, itemStringizer, comparator, message ); ! } ! ! template<class ExpectedEnumerator ! ,class ActualEnumerator ! ,class EqualityPredicate> ! void checkCustomEqualitySetEqual( const ExpectedEnumerator &expected, ! const ActualEnumerator &actual, ! EqualityPredicate comparator, ! const Message &message = Message() ) ! { ! typedef DefaultStringizer<CPPUT_DEDUCED_TYPENAME ExpectedEnumerator::Type> ExpectedStringizer; ! typedef DefaultStringizer<CPPUT_DEDUCED_TYPENAME ActualEnumerator::Type> ActualStringizer; ! checkCustomHeterogeneousSetEqual( expected, actual, ! ExpectedStringizer(), ActualStringizer(), ! comparator, message ); ! } ! ! template<class ExpectedEnumerator ! ,class ActualEnumerator> ! void checkSetEqual( const ExpectedEnumerator &expected, ! const ActualEnumerator &actual, const Message &message = Message() ) { ! DefaultComparator<CPPUT_DEDUCED_TYPENAME ExpectedEnumerator::Type ! ,CPPUT_DEDUCED_TYPENAME ActualEnumerator::Type> comparator; ! checkCustomEqualitySetEqual( expected, actual, comparator, message ); } ! template<class ExpectedStlSet ! ,class ActualStlSet> ! void checkStlSetEqual( const ExpectedStlSet &expected, ! const ActualStlSet &actual, const Message &message = Message() ) { *************** *** 214,221 **** ,class ActualSetType ,class EqualityPredicate> ! void checkStlSetEqual( const ExpectedSetType &expected, ! const ActualSetType &actual, ! EqualityPredicate predicate, ! const Message &message = Message() ) { checkSetEqual( enumStl( expected ), enumStl( actual ), predicate, message ); --- 314,321 ---- ,class ActualSetType ,class EqualityPredicate> ! void checkCustomEqualityStlSetEqual( const ExpectedSetType &expected, ! const ActualSetType &actual, ! EqualityPredicate predicate, ! const Message &message = Message() ) { checkSetEqual( enumStl( expected ), enumStl( actual ), predicate, message ); *************** *** 223,231 **** ! template<class EnumType> ! std::string enumToString( const EnumType &enumerator, ! const std::string &separator = "; ", ! const std::string &begin = "{ ", ! const std::string &end = " }" ) { EnumType enumToStringize = enumerator.clone(); --- 323,333 ---- ! template<class EnumType ! ,class ItemStringizerType> ! std::string enumToStringCustom( const EnumType &enumerator, ! ItemStringizerType itemStringizer, ! const std::string &separator = "; ", ! const std::string &begin = "{ ", ! const std::string &end = " }" ) { EnumType enumToStringize = enumerator.clone(); *************** *** 233,237 **** while ( enumToStringize.hasNext() ) { ! std::string item = stringize( enumToStringize.next() ); if ( !str.empty() ) str += separator; --- 335,339 ---- while ( enumToStringize.hasNext() ) { ! std::string item = itemStringizer( enumToStringize.next() ); if ( !str.empty() ) str += separator; *************** *** 241,244 **** --- 343,360 ---- } + + template<class EnumType> + std::string enumToString( const EnumType &enumerator, + const std::string &separator = "; ", + const std::string &begin = "{ ", + const std::string &end = " }" ) + { + return enumToStringCustom( enumerator, + DefaultStringizer<CPPUT_DEDUCED_TYPENAME EnumType::Type>(), + separator, + begin, + end ); + } + } // namespace CppUT Index: stringize.h =================================================================== RCS file: /cvsroot/cpptool/CppParser/include/cpput/stringize.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** stringize.h 8 Jun 2004 20:23:21 -0000 1.1.1.1 --- stringize.h 14 Jun 2004 23:08:12 -0000 1.2 *************** *** 13,16 **** --- 13,25 ---- + template<class ValueType> + struct DefaultStringizer + { + std::string operator()( const ValueType &value ) const + { + return stringize( value ); + } + }; + // ------------------- convertToString ------------------------------- // User should overload convertToString() to support their own string types. |
From: Baptiste L. <bl...@us...> - 2004-06-13 14:18:02
|
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3762/src/rftaparser Modified Files: rftaparser.vcproj Log Message: * updated & removed cppunit dependencies in release build. Index: rftaparser.vcproj =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/rftaparser.vcproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rftaparser.vcproj 13 Jun 2004 12:16:27 -0000 1.3 --- rftaparser.vcproj 13 Jun 2004 14:17:47 -0000 1.4 *************** *** 667,670 **** --- 667,676 ---- <File RelativePath=".\DeclarationDetailsParserTest.cpp"> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="TRUE"> + <Tool + Name="VCCLCompilerTool"/> + </FileConfiguration> </File> <File |
From: Baptiste L. <bl...@us...> - 2004-06-13 14:18:02
|
Update of /cvsroot/cpptool/rfta/src/rfta In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3762/src/rfta Modified Files: rfta.vcproj Log Message: * updated & removed cppunit dependencies in release build. Index: rfta.vcproj =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/rfta.vcproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rfta.vcproj 13 Jun 2004 12:28:46 -0000 1.3 --- rfta.vcproj 13 Jun 2004 14:17:46 -0000 1.4 *************** *** 42,46 **** Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" ! AdditionalDependencies="odbc32.lib odbccp32.lib cppunit_dll.lib" OutputFile="..\..\build\rfta\Release/rfta_mdr.ext" LinkIncremental="1" --- 42,46 ---- Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" ! AdditionalDependencies="odbc32.lib odbccp32.lib" OutputFile="..\..\build\rfta\Release/rfta_mdr.ext" LinkIncremental="1" *************** *** 191,200 **** </File> <File - RelativePath="IdentifierScopeTest.cpp"> - </File> - <File - RelativePath="IdentifierScopeTest.h"> - </File> - <File RelativePath=".\IdentifierVisitor.cpp"> </File> --- 191,194 ---- *************** *** 478,481 **** --- 472,487 ---- </File> <File + RelativePath="IdentifierScopeTest.cpp"> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="TRUE"> + <Tool + Name="VCCLCompilerTool"/> + </FileConfiguration> + </File> + <File + RelativePath="IdentifierScopeTest.h"> + </File> + <File RelativePath=".\IdentifierVisitorTest.cpp"> <FileConfiguration |
From: Baptiste L. <bl...@us...> - 2004-06-13 14:18:02
|
Update of /cvsroot/cpptool/rfta/src/rftavc7addin/rftavc7addinSetup In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3762/src/rftavc7addin/rftavc7addinSetup Modified Files: rftavc7addinSetup.vdproj Log Message: * updated & removed cppunit dependencies in release build. Index: rftavc7addinSetup.vdproj =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftavc7addin/rftavc7addinSetup/rftavc7addinSetup.vdproj,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** rftavc7addinSetup.vdproj 15 May 2003 19:40:57 -0000 1.5 --- rftavc7addinSetup.vdproj 13 Jun 2004 14:17:47 -0000 1.6 *************** *** 34,64 **** "Entry" { ! "MsmKey" = "8:_53BF111FA2689E52EB955007FAC50B84" ! "OwnerKey" = "8:_4F39125FE37B4E7C99CA50E1AEACEF2C" ! "MsmSig" = "8:C:\\W2K\\SYSTEM32\\MSVCP70D.DLL" } "Entry" { ! "MsmKey" = "8:_53BF111FA2689E52EB955007FAC50B84" ! "OwnerKey" = "8:_BDD30E1B06EF492AB8190D9FDEFFEF26" ! "MsmSig" = "8:C:\\W2K\\SYSTEM32\\MSVCP70D.DLL" } "Entry" { ! "MsmKey" = "8:_53BF111FA2689E52EB955007FAC50B84" ! "OwnerKey" = "8:_522BA9FE774D45B2B8765528552DC359" ! "MsmSig" = "8:C:\\W2K\\SYSTEM32\\MSVCP70D.DLL" } "Entry" { ! "MsmKey" = "8:_592247AE469E8CA7008DFAD9B4ECD204" "OwnerKey" = "8:_522BA9FE774D45B2B8765528552DC359" ! "MsmSig" = "8:C:\\PRG\\VC\\RFTAVC7\\BUILD\\RFTA\\DEBUG\\RFTAPARSER_MDD.EXT" ! } ! "Entry" ! { ! "MsmKey" = "8:_BDD30E1B06EF492AB8190D9FDEFFEF26" ! "OwnerKey" = "8:_UNDEFINED" ! "MsmSig" = "8:C:\\PRG\\VC\\RFTAVC7\\DEPLIB\\CPPUNIT\\SRC\\CPPUNIT\\DEBUGDLL\\CPPUNITD_DLL.DLL" } "Entry" --- 34,58 ---- "Entry" { ! "MsmKey" = "8:_ABE6C36CE16E4BF1B3F850C3E94C3B6C" ! "OwnerKey" = "8:_UNDEFINED" ! "MsmSig" = "8:E:\\PRG\\ZZZZ\\RFTA\\BUILD\\RFTAPARSER\\RELEASE\\RFTAPARSER_MDR.EXT" } "Entry" { ! "MsmKey" = "8:_B57A5AA4E68C4E65988682A5740AB37B" ! "OwnerKey" = "8:_4F39125FE37B4E7C99CA50E1AEACEF2C" ! "MsmSig" = "8:VC_User_CRT.BA9B6D09_0DE0_11D5_A548_0090278A1BB8" } "Entry" { ! "MsmKey" = "8:_B57A5AA4E68C4E65988682A5740AB37B" ! "OwnerKey" = "8:_ABE6C36CE16E4BF1B3F850C3E94C3B6C" ! "MsmSig" = "8:VC_User_CRT.BA9B6D09_0DE0_11D5_A548_0090278A1BB8" } "Entry" { ! "MsmKey" = "8:_B57A5AA4E68C4E65988682A5740AB37B" "OwnerKey" = "8:_522BA9FE774D45B2B8765528552DC359" ! "MsmSig" = "8:VC_User_CRT.BA9B6D09_0DE0_11D5_A548_0090278A1BB8" } "Entry" *************** *** 70,79 **** "Entry" { - "MsmKey" = "8:_C2143E30E84ADF1BB8900CF8CFFE6AAD" - "OwnerKey" = "8:_4F39125FE37B4E7C99CA50E1AEACEF2C" - "MsmSig" = "8:C:\\W2K\\SYSTEM32\\MFC70D.DLL" - } - "Entry" - { "MsmKey" = "8:_D067F475DC974BE7977A73691F994F6A" "OwnerKey" = "8:_UNDEFINED" --- 64,67 ---- *************** *** 82,100 **** "Entry" { ! "MsmKey" = "8:_D83A07287F2BE87C8D8C57AA65C80DE9" "OwnerKey" = "8:_4F39125FE37B4E7C99CA50E1AEACEF2C" ! "MsmSig" = "8:C:\\W2K\\SYSTEM32\\MSVCR70D.DLL" } "Entry" { ! "MsmKey" = "8:_D83A07287F2BE87C8D8C57AA65C80DE9" ! "OwnerKey" = "8:_BDD30E1B06EF492AB8190D9FDEFFEF26" ! "MsmSig" = "8:C:\\W2K\\SYSTEM32\\MSVCR70D.DLL" } "Entry" { ! "MsmKey" = "8:_D83A07287F2BE87C8D8C57AA65C80DE9" "OwnerKey" = "8:_522BA9FE774D45B2B8765528552DC359" ! "MsmSig" = "8:C:\\W2K\\SYSTEM32\\MSVCR70D.DLL" } } --- 70,94 ---- "Entry" { ! "MsmKey" = "8:_D56AEC1CFDE94BB28C891CA41C360A4B" "OwnerKey" = "8:_4F39125FE37B4E7C99CA50E1AEACEF2C" ! "MsmSig" = "8:VC_User_STL.BA9B76E9_0DE0_11D5_A548_0090278A1BB8" } "Entry" { ! "MsmKey" = "8:_D56AEC1CFDE94BB28C891CA41C360A4B" ! "OwnerKey" = "8:_ABE6C36CE16E4BF1B3F850C3E94C3B6C" ! "MsmSig" = "8:VC_User_STL.BA9B76E9_0DE0_11D5_A548_0090278A1BB8" } "Entry" { ! "MsmKey" = "8:_D56AEC1CFDE94BB28C891CA41C360A4B" "OwnerKey" = "8:_522BA9FE774D45B2B8765528552DC359" ! "MsmSig" = "8:VC_User_STL.BA9B76E9_0DE0_11D5_A548_0090278A1BB8" ! } ! "Entry" ! { ! "MsmKey" = "8:_EA103882E96D426BA9A4B9971881F6D5" ! "OwnerKey" = "8:_4F39125FE37B4E7C99CA50E1AEACEF2C" ! "MsmSig" = "8:VC_User_MFC.BA9B6D6E_0DE0_11D5_A548_0090278A1BB8" } } *************** *** 126,130 **** "PackageFileSize" = "3:-2147483648" "CabType" = "3:1" ! "Compression" = "3:2" "SignOutput" = "11:FALSE" "CertificateFile" = "8:" --- 120,124 ---- "PackageFileSize" = "3:-2147483648" "CabType" = "3:1" ! "Compression" = "3:3" "SignOutput" = "11:FALSE" "CertificateFile" = "8:" *************** *** 150,195 **** "File" { - "{54DA9790-1474-11D3-8E00-00C04F6837D0}:_53BF111FA2689E52EB955007FAC50B84" - { - "Signature" = "8:2000000080dd2a10d295c101069a290e161bc30180dd2a10d295c1010000000000400b0000000000000000006d0073007600630070003700300064002e0064006c006c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - "SourcePath" = "8:MSVCP70D.dll" - "TargetName" = "8:MSVCP70D.dll" - "Tag" = "8:" - "Folder" = "8:_35EBC673C4CC45569A935CF2127C29EF" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } - "{54DA9790-1474-11D3-8E00-00C04F6837D0}:_592247AE469E8CA7008DFAD9B4ECD204" - { - "Signature" = "8:200000003ea8c41e8019c3010022520e161bc301a4e6f576ab1ac3010000000000e01b00000000000000000072006600740061007000610072007300650072005f006d00640064002e00650078007400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005200460054004100500041007e0031002e0045005800540000000000" - "SourcePath" = "8:rftaparser_mdd.ext" - "TargetName" = "8:rftaparser_mdd.ext" - "Tag" = "8:" - "Folder" = "8:_35EBC673C4CC45569A935CF2127C29EF" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } "{54DA9790-1474-11D3-8E00-00C04F6837D0}:_BE0905392342433C95A2536A98E6CAA6" { --- 144,147 ---- *************** *** 212,236 **** "IsolateTo" = "8:" } - "{54DA9790-1474-11D3-8E00-00C04F6837D0}:_C2143E30E84ADF1BB8900CF8CFFE6AAD" - { - "Signature" = "8:2000000080aca7acdf95c101aee5b4b2151bc30180aca7acdf95c1010000000000801d0000000000000000006d00660063003700300064002e0064006c006c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - "SourcePath" = "8:MFC70D.DLL" - "TargetName" = "8:MFC70D.DLL" - "Tag" = "8:" - "Folder" = "8:_35EBC673C4CC45569A935CF2127C29EF" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } "{54DA9790-1474-11D3-8E00-00C04F6837D0}:_D067F475DC974BE7977A73691F994F6A" { --- 164,167 ---- *************** *** 253,277 **** "IsolateTo" = "8:" } - "{54DA9790-1474-11D3-8E00-00C04F6837D0}:_D83A07287F2BE87C8D8C57AA65C80DE9" - { - "Signature" = "8:20000000803a49fed195c10162aab9b2151bc301803a49fed195c101000000000030080000000000000000006d0073007600630072003700300064002e0064006c006c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - "SourcePath" = "8:MSVCR70D.dll" - "TargetName" = "8:MSVCR70D.dll" - "Tag" = "8:" - "Folder" = "8:_35EBC673C4CC45569A935CF2127C29EF" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } } "FileType" --- 184,187 ---- *************** *** 652,656 **** "{B1E2BB22-187D-11D3-8E02-00C04F6837D0}:_35EA69036D8A4CC6827B528D20437232" { ! "SourcePath" = "8:..\\debug\\resources\\1033\\rftavc7addinui.dll" "TargetName" = "8:" "Tag" = "8:" --- 562,566 ---- "{B1E2BB22-187D-11D3-8E02-00C04F6837D0}:_35EA69036D8A4CC6827B528D20437232" { ! "SourcePath" = "8:..\\Release\\resources\\1033\\rftavc7addinui.dll" "TargetName" = "8:" "Tag" = "8:" *************** *** 681,685 **** "{B1E2BB22-187D-11D3-8E02-00C04F6837D0}:_4F39125FE37B4E7C99CA50E1AEACEF2C" { ! "SourcePath" = "8:..\\debug\\rftavc7addin.dll" "TargetName" = "8:" "Tag" = "8:" --- 591,595 ---- "{B1E2BB22-187D-11D3-8E02-00C04F6837D0}:_4F39125FE37B4E7C99CA50E1AEACEF2C" { ! "SourcePath" = "8:..\\Release\\rftavc7addin.dll" "TargetName" = "8:" "Tag" = "8:" *************** *** 710,714 **** "{B1E2BB22-187D-11D3-8E02-00C04F6837D0}:_522BA9FE774D45B2B8765528552DC359" { ! "SourcePath" = "8:..\\..\\..\\build\\rfta\\Debug\\rfta_mdd.ext" "TargetName" = "8:" "Tag" = "8:" --- 620,624 ---- "{B1E2BB22-187D-11D3-8E02-00C04F6837D0}:_522BA9FE774D45B2B8765528552DC359" { ! "SourcePath" = "8:..\\..\\..\\build\\rfta\\Release\\rfta_mdr.ext" "TargetName" = "8:" "Tag" = "8:" *************** *** 737,743 **** } } ! "{B1E2BB22-187D-11D3-8E02-00C04F6837D0}:_BDD30E1B06EF492AB8190D9FDEFFEF26" { ! "SourcePath" = "8:..\\..\\..\\deplib\\cppunit\\src\\cppunit\\DebugDll\\cppunitd_dll.dll" "TargetName" = "8:" "Tag" = "8:" --- 647,653 ---- } } ! "{B1E2BB22-187D-11D3-8E02-00C04F6837D0}:_ABE6C36CE16E4BF1B3F850C3E94C3B6C" { ! "SourcePath" = "8:..\\..\\..\\build\\rftaparser\\Release\\rftaparser_mdr.ext" "TargetName" = "8:" "Tag" = "8:" *************** *** 759,764 **** "OutputConfiguration" = "8:" "OutputGroupCanonicalName" = "8:Built" ! "OutputProjectCanonicalName" = "8:..\\deplib\\cppunit\\src\\cppunit\\cppunit_dll.vcproj" ! "OutputProjectGuid" = "8:{2EA464D8-AA14-4CED-B21A-3B84B892B33E}" "ShowKeyOutput" = "11:TRUE" "ExcludeFilters" --- 669,674 ---- "OutputConfiguration" = "8:" "OutputGroupCanonicalName" = "8:Built" ! "OutputProjectCanonicalName" = "8:rftaparser\\rftaparser.vcproj" ! "OutputProjectGuid" = "8:{3FB51A64-B118-4B24-BB68-56E94C2341DF}" "ShowKeyOutput" = "11:TRUE" "ExcludeFilters" *************** *** 772,776 **** "ProductName" = "8:rftavc7addinSetup" "ProductCode" = "8:{4F84D796-FDF0-4423-B052-CCB7B4FB29BF}" ! "PackageCode" = "8:{04632043-A4D8-4625-8E5F-B71766BD9AE2}" "UpgradeCode" = "8:{ACC5C73B-1C78-4058-A615-D0F5260F376B}" "RestartWWWService" = "11:FALSE" --- 682,686 ---- "ProductName" = "8:rftavc7addinSetup" "ProductCode" = "8:{4F84D796-FDF0-4423-B052-CCB7B4FB29BF}" ! "PackageCode" = "8:{AD262841-5191-4515-B9F7-4D0783369535}" "UpgradeCode" = "8:{ACC5C73B-1C78-4058-A615-D0F5260F376B}" "RestartWWWService" = "11:FALSE" *************** *** 798,801 **** --- 708,789 ---- "MergeModule" { + "{AC8774A4-3E09-11D3-8E14-00C04F6837D0}:_B57A5AA4E68C4E65988682A5740AB37B" + { + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:TRUE" + "SourcePath" = "8:vc_crt.msm" + "ModuleSignature" = "8:VC_User_CRT.BA9B6D09_0DE0_11D5_A548_0090278A1BB8" + "Properties" + { + "DIR_RETARGET_TARGETDIR" + { + "Name" = "8:DIR_RETARGET_TARGETDIR" + "DisplayName" = "8:Module Retargetable Folder" + "Description" = "8:" + "Type" = "3:10" + "ContextData" = "8:IsolationDir" + "Attributes" = "3:6" + "Setting" = "3:1" + "UsePlugInResources" = "11:FALSE" + } + } + "LanguageId" = "3:0" + "Exclude" = "11:FALSE" + "Folder" = "8:" + "Feature" = "8:" + "IsolateTo" = "8:" + } + "{AC8774A4-3E09-11D3-8E14-00C04F6837D0}:_D56AEC1CFDE94BB28C891CA41C360A4B" + { + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:TRUE" + "SourcePath" = "8:vc_stl.msm" + "ModuleSignature" = "8:VC_User_STL.BA9B76E9_0DE0_11D5_A548_0090278A1BB8" + "Properties" + { + "DIR_RETARGET_TARGETDIR" + { + "Name" = "8:DIR_RETARGET_TARGETDIR" + "DisplayName" = "8:Module Retargetable Folder" + "Description" = "8:" + "Type" = "3:10" + "ContextData" = "8:IsolationDir" + "Attributes" = "3:6" + "Setting" = "3:1" + "UsePlugInResources" = "11:FALSE" + } + } + "LanguageId" = "3:0" + "Exclude" = "11:FALSE" + "Folder" = "8:" + "Feature" = "8:" + "IsolateTo" = "8:" + } + "{AC8774A4-3E09-11D3-8E14-00C04F6837D0}:_EA103882E96D426BA9A4B9971881F6D5" + { + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:TRUE" + "SourcePath" = "8:vc_mfc.msm" + "ModuleSignature" = "8:VC_User_MFC.BA9B6D6E_0DE0_11D5_A548_0090278A1BB8" + "Properties" + { + "DIR_RETARGET_TARGETDIR" + { + "Name" = "8:DIR_RETARGET_TARGETDIR" + "DisplayName" = "8:Module Retargetable Folder" + "Description" = "8:" + "Type" = "3:10" + "ContextData" = "8:IsolationDir" + "Attributes" = "3:6" + "Setting" = "3:1" + "UsePlugInResources" = "11:FALSE" + } + } + "LanguageId" = "3:0" + "Exclude" = "11:FALSE" + "Folder" = "8:" + "Feature" = "8:" + "IsolateTo" = "8:" + } } "UserInterface" |