public abstract class AbstractVisitor<T,C,O,P,EL,PM,S,COA,SSA,CT> extends Object implements Visitor<T,C,O,P,EL,PM,S,COA,SSA,CT>
An abstract implementation of the Visitor
API, in which subclasses
need only selectively override handleXxx(...)
methods for
internal AST nodes and visitXxx(...)
methods for leaf nodes.
The result
value is convenient for accumulating the result of the
visitation. In the subclass, simply assign/modify the result value as
necessary in the overridden visitation methods, and this framework will
ensure that it is returned as the overall value of the
Visitable.accept(Visitor)
call.
Modifier and Type | Method and Description |
---|---|
T |
visitAssociationClassCallExp(AssociationClassCallExp<C,P> callExp)
Visits the association-class-call source and then its qualifiers (if any).
|
T |
visitBooleanLiteralExp(BooleanLiteralExp<C> literalExp)
Simply returns
result . |
T |
visitCollectionItem(CollectionItem<C> item)
Visits the item's item expression.
|
T |
visitCollectionLiteralExp(CollectionLiteralExp<C> literalExp)
Visits the collection literal's parts.
|
T |
visitCollectionRange(CollectionRange<C> range)
Visits the range's first and last expressions.
|
T |
visitConstraint(CT constraint)
Visits the constraint's specification, if any (and if the
getSpecification(Object) method is overridden). |
T |
visitEnumLiteralExp(EnumLiteralExp<C,EL> literalExp)
Simply returns
result . |
T |
visitExpressionInOCL(ExpressionInOCL<C,PM> expression)
Visits the expressions context variable, its parameter variables (if any),
its result variable (if any), and finally its body expression.
|
T |
visitIfExp(IfExp<C> ifExp)
Visits the if expression's condition, then, and else expressions.
|
T |
visitIntegerLiteralExp(IntegerLiteralExp<C> literalExp)
Simply returns
result . |
T |
visitInvalidLiteralExp(InvalidLiteralExp<C> literalExp)
Simply returns
result . |
T |
visitIterateExp(IterateExp<C,PM> callExp)
Visits the iterate's source, then its iterator variables,
result variable, and body expression.
|
T |
visitIteratorExp(IteratorExp<C,PM> callExp)
Visits the iterator's source, then its variables, followed by its body
expression.
|
T |
visitLetExp(LetExp<C,PM> letExp)
Visits the let's variable declaration then its 'in' expression.
|
T |
visitMessageExp(MessageExp<C,COA,SSA> messageExp)
Visits the message expression's target and then its arguments.
|
T |
visitNullLiteralExp(NullLiteralExp<C> literalExp)
Simply returns
result . |
T |
visitOperationCallExp(OperationCallExp<C,O> callExp)
Visits the operation-call source and then its arguments.
|
T |
visitPropertyCallExp(PropertyCallExp<C,P> callExp)
Visits the property-call source and then its qualifiers (if any).
|
T |
visitRealLiteralExp(RealLiteralExp<C> literalExp)
Simply returns
result . |
T |
visitStateExp(StateExp<C,S> stateExp)
Simply returns
result . |
T |
visitStringLiteralExp(StringLiteralExp<C> literalExp)
Simply returns
result . |
T |
visitTupleLiteralExp(TupleLiteralExp<C,P> literalExp)
Visits the tuple literal's parts.
|
T |
visitTupleLiteralPart(TupleLiteralPart<C,P> part)
Visits the tuple literal part's value, if any.
|
T |
visitTypeExp(TypeExp<C> t)
Simply returns
result . |
T |
visitUnlimitedNaturalLiteralExp(UnlimitedNaturalLiteralExp<C> literalExp)
Simply returns
result . |
T |
visitUnspecifiedValueExp(UnspecifiedValueExp<C> unspecExp)
Simply returns
result . |
T |
visitVariable(Variable<C,PM> variable)
Visits the variable's initialization expression (if any).
|
T |
visitVariableExp(VariableExp<C,PM> v)
Simply returns
result . |
public T visitOperationCallExp(OperationCallExp<C,O> callExp)
handleOperationCallExp(OperationCallExp, Object, List)
.public T visitVariableExp(VariableExp<C,PM> v)
result
.public T visitPropertyCallExp(PropertyCallExp<C,P> callExp)
handlePropertyCallExp(PropertyCallExp, Object, List)
.public T visitAssociationClassCallExp(AssociationClassCallExp<C,P> callExp)
handleAssociationClassCallExp(AssociationClassCallExp, Object, List)
.public T visitVariable(Variable<C,PM> variable)
handleVariable(Variable, Object)
.public T visitIfExp(IfExp<C> ifExp)
handleIfExp(IfExp, Object, Object, Object)
.public T visitMessageExp(MessageExp<C,COA,SSA> messageExp)
handleMessageExp(MessageExp, Object, List)
.public T visitUnspecifiedValueExp(UnspecifiedValueExp<C> unspecExp)
result
.public T visitIntegerLiteralExp(IntegerLiteralExp<C> literalExp)
result
.public T visitUnlimitedNaturalLiteralExp(UnlimitedNaturalLiteralExp<C> literalExp)
result
.public T visitRealLiteralExp(RealLiteralExp<C> literalExp)
result
.public T visitStringLiteralExp(StringLiteralExp<C> literalExp)
result
.public T visitBooleanLiteralExp(BooleanLiteralExp<C> literalExp)
result
.public T visitNullLiteralExp(NullLiteralExp<C> literalExp)
result
.public T visitInvalidLiteralExp(InvalidLiteralExp<C> literalExp)
result
.public T visitTupleLiteralExp(TupleLiteralExp<C,P> literalExp)
handleTupleLiteralExp(TupleLiteralExp, List)
.public T visitTupleLiteralPart(TupleLiteralPart<C,P> part)
handleTupleLiteralPart(TupleLiteralPart, Object)
.public T visitLetExp(LetExp<C,PM> letExp)
handleLetExp(LetExp, Object, Object)
.public T visitEnumLiteralExp(EnumLiteralExp<C,EL> literalExp)
result
.public T visitCollectionLiteralExp(CollectionLiteralExp<C> literalExp)
handleCollectionLiteralExp(CollectionLiteralExp, List)
.public T visitCollectionItem(CollectionItem<C> item)
handleCollectionItem(CollectionItem, Object)
public T visitCollectionRange(CollectionRange<C> range)
handleCollectionRange(CollectionRange, Object, Object)
.public T visitIteratorExp(IteratorExp<C,PM> callExp)
handleIteratorExp(IteratorExp, Object, List, Object)
.public T visitIterateExp(IterateExp<C,PM> callExp)
handleIterateExp(IterateExp, Object, List, Object, Object)
.public T visitExpressionInOCL(ExpressionInOCL<C,PM> expression)
handleExpressionInOCL(ExpressionInOCL, Object, Object, List, Object)
.public T visitConstraint(CT constraint)
getSpecification(Object)
method is overridden).
Returns the result of handleConstraint(Object, Object)
.Copyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.