| ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
SciExpression represents all possible types of expressions in a source code.
It also provides common methods for all types of expressions, allowing to get information about the kind of
expression, its type, and parent expression.
Each derivative of SciExpression inherits the accept(SciExpressionVisitor) method, which
runs the visitor's visitXXX method corresponding to the kind of expression.
visitReferences(SciReferenceVisitor) and
visitReferences(SciReferenceVisitor, SciElement) methods are used to perform
actions upon references taking place in this expression.
| Method Summary | |
Object | accept(SciExpressionVisitor visitor)"Accepts" a visitor, calling up its visitXXX method corresponding to the kind of expression. |
int | getKind()Returns an integer value representing the kind of expression. |
SciObject | getOwner()Returns an object that owns this expression. |
SciExpression | getParent()Returns an expression in which this expression plays the role of an operand. |
SciType | getType()Returns SciType instance for this expression. |
SciExpressionEnumeration | operands() |
void | visitReferences(SciReferenceVisitor visitor)In this expression, makes a specified visitor perform certain actions on all references. |
void | visitReferences(SciReferenceVisitor visitor, SciElement referencedElement)In this expression, makes a specified visitor perform certain actions on all references to the specified element. |
| Methods inherited from interface com.togethersoft.openapi.sci.SciObject |
canCut, canDelete, canReplace, copy, cut, delete, getContainingFile, getContainingScope, getLanguage, getPositions, getText, getUserProperty, isReadOnly, replace, setUserProperty |
| Method Detail |
public Object accept(SciExpressionVisitor visitor)
visitXXX method corresponding to the kind of expression.SciExpressionVisitor type visitorpublic int getKind()
SciExpressionKind interface.public SciObject getOwner()
getParent and getOwner
SciVariable.getInitialValue() or SciExpressionStatement.getExpression().
This operation may be helpful to get information about the context where the expression appeared, especially when you
get an expression object using an expression visitor.
Note that for SciReferenceExspression this operation is derived from both SciReference and SciExpression interfaces.
public SciExpression getParent()
null
For example, for the SciFunctionCallExpression representing
a call of someMethod() in this line of code:
myObject.someMethod();
getParent() method will return SciExpression being an instance of
SciMemberAccessExpression.public SciType getType()
SciType instance for this expression.SciType instance for this expressionpublic SciExpressionEnumeration operands()
public void visitReferences(SciReferenceVisitor visitor)
SciReferenceVisitor which will perform certain actions
public void visitReferences(SciReferenceVisitor visitor, SciElement referencedElement)
SciReferenceVisitor which will perform certain actions
SciElement, references to which are subject to the actions
| ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||