oops.parser
Class Many
java.lang.Object
|
+--oops.parser.Node
|
+--oops.parser.Many
- Direct Known Subclasses:
- Opt, Some
- public class Many
- extends Node
represents zero or more occurrences: [{ alt }].
This is the base class for Some and for Opt.
- See Also:
- Serialized Form
Field Summary |
protected Node |
node
subtree to be repeated. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
node
protected Node node
- subtree to be repeated.
Many
public Many(Node node)
node
public Node node()
- Description copied from class: Node
- simplifies tree.
- Overrides:
- node in class Node
- Tags copied from class: Node
- Returns:
- this, subtree, or suitable node.
setLookahead
public Set setLookahead(Parser parser)
- lookahead includes empty.
- Overrides:
- setLookahead in class Node
- Tags copied from class: Node
- Returns:
- lookahead.
setFollow
public Set setFollow(Parser parser,
Set succ)
- subtree gets lookahead without empty and succ.
- Overrides:
- setFollow in class Node
- Tags copied from class: Node
- Parameters:
parser
- Parser for token setup.succ
- lookahead of successor.- Returns:
- lookahead, i.e., follow for
predecessor.
checkLL1
public void checkLL1(Parser parser)
- subtree is checked.
- Overrides:
- checkLL1 in class Node
checkDeadLoop
public boolean checkDeadLoop()
- Overrides:
- checkDeadLoop in class Node
toString
public java.lang.String toString()
- Overrides:
- toString in class java.lang.Object
degree
public int degree()
- Overrides:
- degree in class Node
sub
public java.lang.Object sub(int n)
- Overrides:
- sub in class Node
parse
public void parse(Scanner scanner,
Goal goal,
Parser parser,
oops.parser.Activation caller)
throws java.io.IOException,
oops.parser.Activation
- performs recognition.
- Overrides:
- parse in class Node
- Parameters:
scanner
- delivers input tokens.goal
- represents current nonterminal and is informed about shifts/reduces.caller
- Activation frame.