oops.parser
Class Opt
java.lang.Object
|
+--oops.parser.Node
|
+--oops.parser.Many
|
+--oops.parser.Opt
- public class Opt
- extends Many
represents zero or one occurrence: [ alt ].
- See Also:
- Serialized Form
| Fields inherited from class oops.parser.Many |
node |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Opt
public Opt(Node node)
node
public Node node()
- Description copied from class: Node
- simplifies tree.
- Overrides:
- node in class Many
- Tags copied from class: Node
- Returns:
- this, subtree, or suitable node.
setFollow
public Set setFollow(Parser parser,
Set succ)
- subtree gets succ.
- Overrides:
- setFollow in class Many
- Tags copied from class: Node
- Parameters:
parser - Parser for token setup.succ - lookahead of successor.- Returns:
- lookahead, i.e., follow for
predecessor.
toString
public java.lang.String toString()
- Overrides:
- toString in class Many
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 Many
- Parameters:
scanner - delivers input tokens.goal - represents current nonterminal and is informed about shifts/reduces.caller - Activation frame.