Package EDU.purdue.jtb.parser.syntaxtree
Class NodeChoice
- java.lang.Object
-
- EDU.purdue.jtb.parser.syntaxtree.NodeChoice
-
- All Implemented Interfaces:
INode
,java.io.Serializable
public class NodeChoice extends java.lang.Object implements INode
Represents a grammar choice (|), e.g. ' ( A | B ) '.
The class stores the node and the "which" choice indicator (0, 1, ...).- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NodeChoice(INode node)
Constructs theNodeChoice
with a given node and non standard (-1) which choice and total number of choices.NodeChoice(INode node, int whichChoice, int totalChoices)
Constructs theNodeChoice
with a given node, a which choice and a total (not controlled).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
accept(IIntVisitor vis)
Accepts aIIntVisitor
visitor with user return data.void
accept(IVoidVisitor vis)
Accepts aIVoidVisitor
visitor} visitor with user return data.
-
-
-
Field Detail
-
choice
public INode choice
The real node
-
which
public int which
The "which" choice indicator
-
total
public int total
The total number of choices
-
-
Constructor Detail
-
NodeChoice
public NodeChoice(INode node)
Constructs theNodeChoice
with a given node and non standard (-1) which choice and total number of choices.- Parameters:
node
- - the node
-
NodeChoice
public NodeChoice(INode node, int whichChoice, int totalChoices)
Constructs theNodeChoice
with a given node, a which choice and a total (not controlled).- Parameters:
node
- - the nodewhichChoice
- - the which choicetotalChoices
- - the total number of choices
-
-
Method Detail
-
accept
public int accept(IIntVisitor vis)
Accepts aIIntVisitor
visitor with user return data.
-
accept
public void accept(IVoidVisitor vis)
Accepts aIVoidVisitor
visitor} visitor with user return data.
-
-