Package EDU.purdue.jtb.parser.syntaxtree
Class NodeChoice
java.lang.Object
EDU.purdue.jtb.parser.syntaxtree.NodeChoice
- All Implemented Interfaces:
INode
,Serializable
Represents a grammar choice (|), e.g. ' ( A | B ) '.
The class stores the node and the "which" choice indicator (0, 1, ...).
The class stores the node and the "which" choice indicator (0, 1, ...).
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe real nodeint
The total number of choicesint
The "which" choice indicator -
Constructor Summary
ConstructorsConstructorDescriptionNodeChoice
(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
Modifier and TypeMethodDescriptionint
accept
(IIntVisitor vis) Accepts aIIntVisitor
visitor with user return data.void
accept
(IVoidVisitor vis) Accepts aIVoidVisitor
visitor} visitor with user return data.
-
Field Details
-
choice
The real node -
which
public int whichThe "which" choice indicator -
total
public int totalThe total number of choices
-
-
Constructor Details
-
NodeChoice
Constructs theNodeChoice
with a given node and non standard (-1) which choice and total number of choices.- Parameters:
node
- - the node
-
NodeChoice
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 Details
-
accept
Accepts aIIntVisitor
visitor with user return data. -
accept
Accepts aIVoidVisitor
visitor} visitor with user return data.
-