public class ASTPtUnionConstructNode extends ASTPtRootNode
{|foo = "abc"|}
. The result of
parsing and evaluating this expression is a union token with the label
foo, and the corresponding value is a StringToken of value "abc".
When using an expression to specify a union type, multiple labels
are allowed: {|foo = string, bar = int|}
, which is a union
type with two alternatives: one labeled foo with type string, one
labeled bar with type integer.
FIXME: ambiguityASTPtRootNode
,
PtParser
,
Token
Modifier and Type | Field and Description |
---|---|
protected java.util.LinkedList |
_labelNames
The list of field names for the record.
|
_children, _id, _isConstant, _parent, _ptToken, _ptType
Constructor and Description |
---|
ASTPtUnionConstructNode(int id) |
ASTPtUnionConstructNode(PtParser p,
int id) |
Modifier and Type | Method and Description |
---|---|
java.util.List |
getLabelNames()
Return the list of label names for this union construct.
|
boolean |
isCongruent(ASTPtRootNode node,
java.util.Map renaming)
Return true if this node is (hierarchically) congruent to the
given node, under the given renaming of bound identifiers.
|
void |
visit(ParseTreeVisitor visitor)
Traverse this node with the given visitor.
|
clone, displayParseTree, evaluateParseTree, getToken, getType, isConstant, isEvaluated, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, setConstant, setToken, setType, toString, toString
protected java.util.LinkedList _labelNames
public ASTPtUnionConstructNode(int id)
public ASTPtUnionConstructNode(PtParser p, int id)
public java.util.List getLabelNames()
public boolean isCongruent(ASTPtRootNode node, java.util.Map renaming)
isCongruent
in class ASTPtRootNode
node
- The node to compare to.renaming
- A map from String to String that gives a
renaming from identifiers in this node to identifiers in the
given node.public void visit(ParseTreeVisitor visitor) throws IllegalActionException
visit
in class ASTPtRootNode
visitor
- The visitor.IllegalActionException
- Always thrown in this base
class the visit() method is not implemented here.