/cpp/src/main/java/com/google/test/metric/cpp/Builder.java
http://testability-explorer.googlecode.com/ · Java · 313 lines · 83 code · 58 blank · 172 comment · 0 complexity · 6825e402634d1e55d1a88a0b449bf7f0 MD5 · raw file
- package com.google.test.metric.cpp;
- import java.util.List;
- /**
- * The Builder receives calls from some reverse engineering system and is able
- * to transform this information into model elements. It expects to receive
- * calls in a logic sequence:
- * <ol>
- * <li>beginClassDeclaration</li>
- * <li>beginMemberDeclaration</li>
- * <li>endMemberDeclaration</li>
- * <li>endClassDeclaration</li>
- * </ol>
- *
- * Originally, this class was called Modeler and was used in ArgoUML
- * modeling tool. Original author: Luis Sergio Oliveira
- */
- interface Builder {
- /**
- * Signals the begin of the translation unit.
- */
- void beginTranslationUnit();
- /**
- * Signals the end of the translation unit.
- */
- void endTranslationUnit();
- /**
- * Signals that we entered the given namespace scope.
- *
- * @param ns The namespace identifier. For unnamed namespaces it is an empty
- * <code>String</code>.
- */
- void enterNamespaceScope(String ns);
- /**
- * Signals the exit of the namespace scope.
- */
- void exitNamespaceScope();
- /**
- * Signal a new alias for the given namespace.
- *
- * @param ns Identifier of the namespace for which an alias will be created.
- * @param alias Identifier of the new namespace alias.
- */
- void makeNamespaceAlias(String ns, String alias);
- /**
- * Signal the begin of a new class definition
- *
- * @param oType The type of the specifier from the CPPvariables class, it is
- * one of the "OT_*" values, e.g., OT_CLASS.
- * @param identifier The class identifier (name).
- */
- void beginClassDefinition(String oType, String identifier);
- /**
- * Signals the end of a class definition.
- */
- void endClassDefinition();
- /**
- * Signals that the given access specifier was found.
- *
- * @param accessSpec The access specifier, e.g., "public".
- */
- void accessSpecifier(String accessSpec);
- /**
- * Signals the begin of a function declaration.
- */
- void beginFunctionDeclaration();
- /**
- * Signals the end of a function declaration.
- */
- void endFunctionDeclaration();
- /**
- * Reports the declaration specifiers; "inline", "virtual", "friend", etc.
- *
- * @param declSpecs The declaration specifiers for the current declaration.
- */
- void declarationSpecifiers(List<String> declSpecs);
- /**
- * Reports the type simple type specifiers (buit-in, like int, char, unsigned
- * char, etc).
- *
- * @param sts The simple type specifiers,
- */
- void simpleTypeSpecifier(List<String> sts);
- /**
- * Reports the declarator, of the entity being declared.
- *
- * @param id The identifier of the construct being declared.
- */
- void directDeclarator(String id);
- /**
- * Reports the storage class specifier.
- *
- * @param storageClassSpec The storage class specifier.
- */
- void storageClassSpecifier(String storageClassSpec);
- /**
- * Reports the type qualifier.
- *
- * @param typeQualifier "const" or "volatile".
- */
- void typeQualifier(String typeQualifier);
- /**
- * Signals the begin of a function definition.
- * @param line
- */
- void beginFunctionDefinition(int line);
- /**
- * Signals the end of a function definition.
- */
- void endFunctionDefinition();
- /**
- * Reports the identifier of the function being declared or defined.
- *
- * @param identifier the function identifier.
- */
- void functionDirectDeclarator(String identifier);
- /**
- * Signals the begin of a parameter declaration.
- */
- void beginParameterDeclaration();
- /**
- * Signals the end of a parameter declaration.
- */
- void endParameterDeclaration();
- /**
- *
- */
- void beginInitializer();
- /**
- *
- */
- void endInitializer();
- /**
- * Signals the begin of a member declaration.
- */
- void beginMemberDeclaration();
- /**
- * Signals the end of a member declaration.
- */
- void endMemberDeclaration();
- /**
- * Signals the begin of a compound statement.
- */
- void beginCompoundStatement();
- /**
- * Signals the end of a compound statement.
- */
- void endCompoundStatement();
- /**
- * Receives a pointer symbol from the ptr_operator rule. In simple cases
- * should be a "&" or a "*".
- *
- * @param ptrSymbol the pointer symbol found
- */
- void ptrOperator(String ptrSymbol);
- /**
- * Signals the begin of the ptr_operator rule.
- */
- void beginPtrOperator();
- /**
- * Signals the end of the ptr_operator rule.
- */
- void endPtrOperator();
- /**
- * Found a pointer to member construct. Partial results, being the rest (if
- * existing) delivered in a typeQualifier() call.
- *
- * @param scopedItem The scoped item, such as A::B::C::
- * @param star The "*" symbol, just that the call is clear. In the future may
- * be removed.
- */
- void ptrToMember(String scopedItem, String star);
- /**
- * Signals the start of a class's base specification.
- */
- void beginBaseSpecifier();
- /**
- * Signals the end of a class's base specification.
- */
- void endBaseSpecifier();
- /**
- * The base specification.
- *
- * @param identifier The name of the base class.
- * @param isVirtual Is the inheritance virtual.
- */
- void baseSpecifier(String identifier, boolean isVirtual);
- /**
- * Signals the start of a constructor definition.
- */
- void beginCtorDefinition();
- /**
- * Signals the end of a constructor definition.
- */
- void endCtorDefinition();
- /**
- * The qualified constructor identifier.
- *
- * @param identifier of the ctor
- */
- void qualifiedCtorId(String identifier);
- /**
- * Signals the start of a destructor head statement.
- */
- void beginDtorHead();
- /**
- * Signals the end of a destructor head statement.
- */
- void endDtorHead();
- /**
- * The destructor declarator.
- *
- * @param identifier the destructor identifier
- */
- void dtorDeclarator(String identifier);
- void beginIfStatement();
- void endIfStatement();
- void beginElseStatement();
- void endElseStatement();
- void gotoStatement();
- void continueStatement();
- void breakStatement();
- void beginWhileStatement();
- void endWhileStatement();
- void beginDoStatement();
- void endDoStatement();
- void beginForStatement();
- void endForStatement();
- void beginSwitchStatement();
- void endSwitchStatement();
- void beginCaseStatement();
- void endCaseStatement();
- void beginDefaultStatement();
- void endDefaultStatement();
- void beginTernaryOperator();
- void endTernaryOperator();
- void beginReturnStatement(int lineNumber);
- void endReturnStatement();
- void idExpression(String text);
- void beginPostfixExpression();
- void endPostfixExpression();
- void beginPrimaryExpression();
- void endPrimaryExpression();
- void beginParameterList();
- void endParameterList();
- void beginAssignmentExpression(int line);
- void endAssignmentExpression();
- void beginMemberAccess();
- void endMemberAccess();
- void beginInitDeclaratorList();
- void endInitDeclaratorList();
- void beginExpression();
- void endExpression();
- void beginExpressionStatement();
- void endExpressionStatement();
- }