|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.go.tea.parsetree.Node
|
+--com.go.tea.parsetree.Expression
|
+--com.go.tea.parsetree.ParenExpression
A ParenExpression is a thin wrapper around an Expression that was delimited by parenthesis in the source code. A parse tree does not necessarily need a ParenExpression, but it is useful when reconstructing something that resembles the source code.
| Inner classes inherited from class com.go.tea.parsetree.Expression |
Expression.Conversion |
| Constructor Summary | |
ParenExpression(SourceInfo info,
Expression expr)
|
|
| Method Summary | |
java.lang.Object |
accept(NodeVisitor visitor)
Every subclass of Node must override this method with the following: return visitor.visit(this). |
java.lang.Object |
clone()
Returns a clone of this Node and all its children. |
void |
convertTo(Type toType,
boolean preferCast)
Applies a type conversion to this expression which is chained to all previous conversions. |
java.util.LinkedList |
getConversionChain()
Returns a list of Conversion objects representing the all the conversions that have been applied to this Expression. |
Expression |
getExpression()
|
Type |
getInitialType()
Returns the type of this expression before any conversions were applied, or null if the type isn't set. |
Type |
getType()
The type of an expression is not necessarily set by a parser. |
java.lang.Object |
getValue()
Most expressions can't generate a value at compile-time, so this method simply returns null. |
boolean |
isExceptionPossible()
Returns true if an exception can be thrown while executing this Expression. |
boolean |
isValueKnown()
Returns true if the value generated by this expression is known at compile-time. |
void |
setExpression(Expression expr)
|
void |
setInitialType(Type type)
Sets the intial type in the conversion chain, but does not clear the conversions. |
void |
setType(Type type)
Sets the type of this expression, clearing the conversion chain. |
| Methods inherited from class com.go.tea.parsetree.Expression |
convertTo |
| Methods inherited from class com.go.tea.parsetree.Node |
getSourceInfo, toString |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ParenExpression(SourceInfo info,
Expression expr)
| Method Detail |
public java.lang.Object accept(NodeVisitor visitor)
Nodereturn visitor.visit(this).accept in class Expressioncom.go.tea.parsetree.Nodevisitor - A visitor of this NodeNodeVisitorpublic java.lang.Object clone()
Nodeclone in class Expressionpublic boolean isExceptionPossible()
ExpressionisExceptionPossible in class Expressionpublic Type getType()
ExpressiongetType in class Expressioncom.go.tea.parsetree.Expressionpublic Type getInitialType()
ExpressiongetInitialType in class Expression
public void convertTo(Type toType,
boolean preferCast)
ExpressionconvertTo in class Expressioncom.go.tea.parsetree.ExpressiontoType - the type to convert to.preferCast - a hint that the conversion should be performed by a
type cast operation, by default is true.java.lang.IllegalArgumentException - when the conversion is illegal.public java.util.LinkedList getConversionChain()
ExpressionExpression.convertTo(com.go.tea.compiler.Type).getConversionChain in class Expressionpublic void setType(Type type)
ExpressionsetType in class Expressionpublic void setInitialType(Type type)
ExpressionsetInitialType in class Expressionpublic boolean isValueKnown()
ExpressionisValueKnown in class Expressioncom.go.tea.parsetree.ExpressionLiteralpublic java.lang.Object getValue()
ExpressiongetValue in class Expressionpublic Expression getExpression()
public void setExpression(Expression expr)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||