polyglot.ast
Class AmbExpr_c
java.lang.Object
polyglot.ast.Node_c
polyglot.ast.Term_c
polyglot.ast.Expr_c
polyglot.ast.AmbExpr_c
- All Implemented Interfaces:
- java.lang.Cloneable, AmbExpr, Ambiguous, Expr, JL, Node, NodeOps, Prefix, Receiver, Term, Typed, Copy
public class AmbExpr_c
- extends Expr_c
- implements AmbExpr
An AmbExpr
is an ambiguous AST node composed of a single
identifier that must resolve to an expression.
Field Summary |
protected java.lang.String |
name
|
Fields inherited from class polyglot.ast.Expr_c |
type |
Methods inherited from class polyglot.ast.Expr_c |
booleanValue, buildTypes, byteValue, charValue, constantValue, constantValueSet, doubleValue, floatValue, intValue, isConstant, isTypeChecked, longValue, printSubExpr, printSubExpr, shortValue, stringValue, type, type |
Methods inherited from class polyglot.ast.Node_c |
addDecls, buildTypesEnter, checkConstants, childExpectedType, copy, del, del, disambiguateEnter, disambiguateOverride, dump, dump, enterChildScope, enterScope, error, error, exceptionCheckEnter, ext, ext, ext, ext, init, isDisambiguated, node, position, position, prettyPrint, prettyPrint, print, printBlock, printSubStmt, throwTypes, typeCheckEnter, typeCheckOverride, visit, visitChild, visitChildren, visitEdge, visitList |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface polyglot.ast.Node |
childExpectedType, del, del, error, error, ext, ext, ext, ext, isDisambiguated, isTypeChecked, position, position, visit, visitChild, visitEdge, visitList |
Methods inherited from interface polyglot.ast.JL |
init, node |
Methods inherited from interface polyglot.ast.NodeOps |
addDecls, buildTypes, buildTypesEnter, checkConstants, disambiguateEnter, disambiguateOverride, dump, dump, enterChildScope, enterScope, exceptionCheckEnter, prettyPrint, prettyPrint, throwTypes, typeCheckEnter, typeCheckOverride, visitChildren |
Methods inherited from interface polyglot.util.Copy |
copy |
Methods inherited from interface polyglot.ast.Typed |
type |
name
protected java.lang.String name
AmbExpr_c
public AmbExpr_c(Position pos,
java.lang.String name)
precedence
public Precedence precedence()
- Get the precedence of the field.
- Specified by:
precedence
in interface Expr
- Overrides:
precedence
in class Expr_c
name
public java.lang.String name()
- Get the name of the expression.
- Specified by:
name
in interface AmbExpr
name
public AmbExpr name(java.lang.String name)
- Set the name of the expression.
- Specified by:
name
in interface AmbExpr
disambiguate
public Node disambiguate(AmbiguityRemover ar)
throws SemanticException
- Disambiguate the expression.
- Specified by:
disambiguate
in interface NodeOps
- Overrides:
disambiguate
in class Node_c
- Parameters:
ar
- The visitor which disambiguates.
- Throws:
SemanticException
typeCheck
public Node typeCheck(TypeChecker tc)
throws SemanticException
- Specified by:
typeCheck
in interface NodeOps
- Overrides:
typeCheck
in class Node_c
- Throws:
SemanticException
exceptionCheck
public Node exceptionCheck(ExceptionChecker ec)
throws SemanticException
- Check exceptions thrown by the expression.
- Specified by:
exceptionCheck
in interface NodeOps
- Overrides:
exceptionCheck
in class Term_c
- Parameters:
ec
- The visitor.
- Throws:
SemanticException
prettyPrint
public void prettyPrint(CodeWriter w,
PrettyPrinter tr)
- Write the expression to an output file.
- Specified by:
prettyPrint
in interface NodeOps
- Overrides:
prettyPrint
in class Node_c
- Parameters:
w
- The code writer to which to write.tr
- The pretty printer. This is not a visitor.
translate
public void translate(CodeWriter w,
Translator tr)
- Description copied from class:
Node_c
- Translate the AST using the given
CodeWriter
.
- Specified by:
translate
in interface NodeOps
- Overrides:
translate
in class Node_c
- Parameters:
w
- The code writer to which to write.tr
- The translation pass. This is not a visitor.
toString
public java.lang.String toString()
- Overrides:
toString
in class Node_c
entry
public Term entry()
- Return the first (sub)term performed when evaluating this
term.
- Specified by:
entry
in interface Term
- Specified by:
entry
in class Term_c
acceptCFG
public java.util.List acceptCFG(CFGBuilder v,
java.util.List succs)
- Visit this term in evaluation order.
- Specified by:
acceptCFG
in interface Term
- Specified by:
acceptCFG
in class Term_c
dump
public void dump(CodeWriter w)
- Description copied from interface:
Node
- Dump the AST node for debugging purposes.
- Specified by:
dump
in interface Node
- Overrides:
dump
in class Expr_c