Dresden OCL Toolkit

tudresden.ocl
Class OnlyNameFinder

java.lang.Object
  extended bytudresden.ocl.parser.analysis.AnalysisAdapter
      extended bytudresden.ocl.parser.analysis.DepthFirstAdapter
          extended bytudresden.ocl.OnlyNameFinder
All Implemented Interfaces:
Analysis, Switch

public class OnlyNameFinder
extends DepthFirstAdapter

A tree traversal class that searchs for a name in a expression, asserting that there is nothing else in the expression than the name; whether name means TName or APathName can be configured.


Field Summary
(package private)  AExpression expr
           
(package private)  boolean pathName
           
(package private)  TName resultName
           
(package private)  APathName resultPathName
           
 
Fields inherited from class tudresden.ocl.parser.analysis.AnalysisAdapter
 
Constructor Summary
OnlyNameFinder(boolean pathName)
           
 
Method Summary
protected  void assertTrue(boolean b)
           
 void caseANamePathNameBegin(ANamePathNameBegin npnb)
           
 void caseATypeNamePathNameBegin(ATypeNamePathNameBegin tnpnb)
           
 TName getName()
           
 APathName getPathName()
           
 void inAAdditiveExpression(AAdditiveExpression ae)
           
 void inAExpression(AExpression e)
           
 void inAFeaturePrimaryExpression(AFeaturePrimaryExpression fpe)
           
 void inALogicalExpression(ALogicalExpression le)
           
 void inAMultiplicativeExpression(AMultiplicativeExpression me)
           
 void inAPathName(APathName pn)
           
 void inAPostfixExpression(APostfixExpression pe)
           
 void inARelationalExpression(ARelationalExpression re)
           
 void inAUnaryUnaryExpression(AUnaryUnaryExpression uue)
           
 
Methods inherited from class tudresden.ocl.parser.analysis.DepthFirstAdapter
caseAActualParameterList, caseAActualParameterListTail, caseAAdditiveExpression, caseAAdditiveExpressionTail, caseAAndLogicalOperator, caseAArrowPostfixExpressionTailBegin, caseABagCollectionKind, caseABagCollectionType, caseABarFcpHelper, caseABooleanLiteral, caseAClassifierContext, caseAClassifierContextBody, caseAClassifierHead, caseACollectionCollectionKind, caseACollectionCollectionType, caseACollectionTypeName, caseAColonFcpHelper, caseACommaFcpHelper, caseAConcreteFeatureCallParameters, caseAConstraint, caseAConstraintBody, caseAContextDeclaration, caseADeclaratorTail, caseADeclaratorTypeDeclaration, caseADivMultiplyOperator, caseADotPostfixExpressionTailBegin, caseAEmptyFeatureCallParameters, caseAEnumerationType, caseAEnumerationTypeTail, caseAEnumLiteral, caseAEnumSimpleTypeSpecifier, caseAEqualRelationalOperator, caseAExpression, caseAExpressionListOrRange, caseAExpressionListTail, caseAFeatureCall, caseAFeatureCallParameters, caseAFeaturePrimaryExpression, caseAFormalParameter, caseAFormalParameterList, caseAFormalParameterListTail, caseAGteqRelationalOperator, caseAGtRelationalOperator, caseAIfExpression, caseAIfPrimaryExpression, caseAImpliesLogicalOperator, caseAIntegerLiteral, caseAInvStereotype, caseAIterateDeclarator, caseAIterateFcpHelper, caseALetExpression, caseALetExpressionTypeDeclaration, caseAListExpressionListOrRangeTail, caseALitColPrimaryExpression, caseALiteralCollection, caseALiteralPrimaryExpression, caseALogicalExpression, caseALogicalExpressionTail, caseALteqRelationalOperator, caseALtRelationalOperator, caseAMinusAddOperator, caseAMinusUnaryOperator, caseAMultiplicativeExpression, caseAMultiplicativeExpressionTail, caseAMultMultiplyOperator, caseANamePathNameEnd, caseANEqualRelationalOperator, caseANonCollectionTypeName, caseANotUnaryOperator, caseAOperationContext, caseAOperationContextBody, caseAOrLogicalOperator, caseAParenthesesPrimaryExpression, caseAPathName, caseAPathNameTail, caseAPathSimpleTypeSpecifier, caseAPathTypeName, caseAPathTypeNameTail, caseAPlusAddOperator, caseAPostfixExpression, caseAPostfixExpressionTail, caseAPostfixUnaryExpression, caseAPostStereotype, caseAPreStereotype, caseAQualifiers, caseARangeExpressionListOrRangeTail, caseARealLiteral, caseARelationalExpression, caseARelationalExpressionTail, caseAReturnTypeDeclaration, caseASequenceCollectionKind, caseASequenceCollectionType, caseASetCollectionKind, caseASetCollectionType, caseAStandardDeclarator, caseAStringLiteral, caseATimeExpression, caseATypeNamePathNameEnd, caseAUnaryUnaryExpression, caseAXorLogicalOperator, caseStart, defaultIn, defaultOut, inAActualParameterList, inAActualParameterListTail, inAAdditiveExpressionTail, inAAndLogicalOperator, inAArrowPostfixExpressionTailBegin, inABagCollectionKind, inABagCollectionType, inABarFcpHelper, inABooleanLiteral, inAClassifierContext, inAClassifierContextBody, inAClassifierHead, inACollectionCollectionKind, inACollectionCollectionType, inACollectionTypeName, inAColonFcpHelper, inACommaFcpHelper, inAConcreteFeatureCallParameters, inAConstraint, inAConstraintBody, inAContextDeclaration, inADeclaratorTail, inADeclaratorTypeDeclaration, inADivMultiplyOperator, inADotPostfixExpressionTailBegin, inAEmptyFeatureCallParameters, inAEnumerationType, inAEnumerationTypeTail, inAEnumLiteral, inAEnumSimpleTypeSpecifier, inAEqualRelationalOperator, inAExpressionListOrRange, inAExpressionListTail, inAFeatureCall, inAFeatureCallParameters, inAFormalParameter, inAFormalParameterList, inAFormalParameterListTail, inAGteqRelationalOperator, inAGtRelationalOperator, inAIfExpression, inAIfPrimaryExpression, inAImpliesLogicalOperator, inAIntegerLiteral, inAInvStereotype, inAIterateDeclarator, inAIterateFcpHelper, inALetExpression, inALetExpressionTypeDeclaration, inAListExpressionListOrRangeTail, inALitColPrimaryExpression, inALiteralCollection, inALiteralPrimaryExpression, inALogicalExpressionTail, inALteqRelationalOperator, inALtRelationalOperator, inAMinusAddOperator, inAMinusUnaryOperator, inAMultiplicativeExpressionTail, inAMultMultiplyOperator, inANamePathNameBegin, inANamePathNameEnd, inANEqualRelationalOperator, inANonCollectionTypeName, inANotUnaryOperator, inAOperationContext, inAOperationContextBody, inAOrLogicalOperator, inAParenthesesPrimaryExpression, inAPathNameTail, inAPathSimpleTypeSpecifier, inAPathTypeName, inAPathTypeNameTail, inAPlusAddOperator, inAPostfixExpressionTail, inAPostfixUnaryExpression, inAPostStereotype, inAPreStereotype, inAQualifiers, inARangeExpressionListOrRangeTail, inARealLiteral, inARelationalExpressionTail, inAReturnTypeDeclaration, inASequenceCollectionKind, inASequenceCollectionType, inASetCollectionKind, inASetCollectionType, inAStandardDeclarator, inAStringLiteral, inATimeExpression, inATypeNamePathNameBegin, inATypeNamePathNameEnd, inAXorLogicalOperator, inStart, outAActualParameterList, outAActualParameterListTail, outAAdditiveExpression, outAAdditiveExpressionTail, outAAndLogicalOperator, outAArrowPostfixExpressionTailBegin, outABagCollectionKind, outABagCollectionType, outABarFcpHelper, outABooleanLiteral, outAClassifierContext, outAClassifierContextBody, outAClassifierHead, outACollectionCollectionKind, outACollectionCollectionType, outACollectionTypeName, outAColonFcpHelper, outACommaFcpHelper, outAConcreteFeatureCallParameters, outAConstraint, outAConstraintBody, outAContextDeclaration, outADeclaratorTail, outADeclaratorTypeDeclaration, outADivMultiplyOperator, outADotPostfixExpressionTailBegin, outAEmptyFeatureCallParameters, outAEnumerationType, outAEnumerationTypeTail, outAEnumLiteral, outAEnumSimpleTypeSpecifier, outAEqualRelationalOperator, outAExpression, outAExpressionListOrRange, outAExpressionListTail, outAFeatureCall, outAFeatureCallParameters, outAFeaturePrimaryExpression, outAFormalParameter, outAFormalParameterList, outAFormalParameterListTail, outAGteqRelationalOperator, outAGtRelationalOperator, outAIfExpression, outAIfPrimaryExpression, outAImpliesLogicalOperator, outAIntegerLiteral, outAInvStereotype, outAIterateDeclarator, outAIterateFcpHelper, outALetExpression, outALetExpressionTypeDeclaration, outAListExpressionListOrRangeTail, outALitColPrimaryExpression, outALiteralCollection, outALiteralPrimaryExpression, outALogicalExpression, outALogicalExpressionTail, outALteqRelationalOperator, outALtRelationalOperator, outAMinusAddOperator, outAMinusUnaryOperator, outAMultiplicativeExpression, outAMultiplicativeExpressionTail, outAMultMultiplyOperator, outANamePathNameBegin, outANamePathNameEnd, outANEqualRelationalOperator, outANonCollectionTypeName, outANotUnaryOperator, outAOperationContext, outAOperationContextBody, outAOrLogicalOperator, outAParenthesesPrimaryExpression, outAPathName, outAPathNameTail, outAPathSimpleTypeSpecifier, outAPathTypeName, outAPathTypeNameTail, outAPlusAddOperator, outAPostfixExpression, outAPostfixExpressionTail, outAPostfixUnaryExpression, outAPostStereotype, outAPreStereotype, outAQualifiers, outARangeExpressionListOrRangeTail, outARealLiteral, outARelationalExpression, outARelationalExpressionTail, outAReturnTypeDeclaration, outASequenceCollectionKind, outASequenceCollectionType, outASetCollectionKind, outASetCollectionType, outAStandardDeclarator, outAStringLiteral, outATimeExpression, outATypeNamePathNameBegin, outATypeNamePathNameEnd, outAUnaryUnaryExpression, outAXorLogicalOperator, outStart
 
Methods inherited from class tudresden.ocl.parser.analysis.AnalysisAdapter
caseEOF, caseTAnd, caseTApostroph, caseTArrow, caseTAt, caseTBar, caseTBlank, caseTBool, caseTChannel, caseTColon, caseTComma, caseTComment, caseTContext, caseTDcolon, caseTDdot, caseTDiv, caseTDot, caseTEndif, caseTEnum, caseTEqual, caseTGt, caseTGteq, caseTImplies, caseTInt, caseTLBrace, caseTLBracket, caseTLPar, caseTLt, caseTLteq, caseTMinus, caseTMult, caseTName, caseTNEqual, caseTNewLine, caseTNot, caseTOr, caseTPlus, caseTRBrace, caseTRBracket, caseTReal, caseTRPar, caseTSemicolon, caseTSimpleTypeName, caseTStringLit, caseTTab, caseTTBag, caseTTCollection, caseTTElse, caseTTIf, caseTTIn, caseTTInv, caseTTLet, caseTTPost, caseTTPre, caseTTSequence, caseTTSet, caseTTThen, caseTXor, defaultCase, getIn, getOut, setIn, setOut
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

expr

AExpression expr

resultName

TName resultName

resultPathName

APathName resultPathName

pathName

boolean pathName
Constructor Detail

OnlyNameFinder

public OnlyNameFinder(boolean pathName)
Parameters:
pathName - indicates whether a path name should be searched, rather than a TName
Method Detail

inAExpression

public void inAExpression(AExpression e)
Overrides:
inAExpression in class DepthFirstAdapter

inALogicalExpression

public void inALogicalExpression(ALogicalExpression le)
Overrides:
inALogicalExpression in class DepthFirstAdapter

inARelationalExpression

public void inARelationalExpression(ARelationalExpression re)
Overrides:
inARelationalExpression in class DepthFirstAdapter

inAAdditiveExpression

public void inAAdditiveExpression(AAdditiveExpression ae)
Overrides:
inAAdditiveExpression in class DepthFirstAdapter

inAMultiplicativeExpression

public void inAMultiplicativeExpression(AMultiplicativeExpression me)
Overrides:
inAMultiplicativeExpression in class DepthFirstAdapter

inAUnaryUnaryExpression

public void inAUnaryUnaryExpression(AUnaryUnaryExpression uue)
Overrides:
inAUnaryUnaryExpression in class DepthFirstAdapter

inAPostfixExpression

public void inAPostfixExpression(APostfixExpression pe)
Overrides:
inAPostfixExpression in class DepthFirstAdapter

inAFeaturePrimaryExpression

public void inAFeaturePrimaryExpression(AFeaturePrimaryExpression fpe)
Overrides:
inAFeaturePrimaryExpression in class DepthFirstAdapter

inAPathName

public void inAPathName(APathName pn)
Overrides:
inAPathName in class DepthFirstAdapter

caseATypeNamePathNameBegin

public void caseATypeNamePathNameBegin(ATypeNamePathNameBegin tnpnb)
Specified by:
caseATypeNamePathNameBegin in interface Analysis
Overrides:
caseATypeNamePathNameBegin in class DepthFirstAdapter

caseANamePathNameBegin

public void caseANamePathNameBegin(ANamePathNameBegin npnb)
Specified by:
caseANamePathNameBegin in interface Analysis
Overrides:
caseANamePathNameBegin in class DepthFirstAdapter

getName

public TName getName()

getPathName

public APathName getPathName()

assertTrue

protected void assertTrue(boolean b)

Dresden OCL Toolkit

Submit a bug
Developed at the Dresden University of Technology.
This software is published under the GNU Lesser General Public License.