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
 
Fields inherited from class oops.parser.Node
follow, lookahead
 
Constructor Summary
Opt(Node node)
           
 
Method Summary
 Node node()
          simplifies tree.
 void parse(Scanner scanner, Goal goal, Parser parser, oops.parser.Activation caller)
          performs recognition.
 Set setFollow(Parser parser, Set succ)
          subtree gets succ.
 java.lang.String toString()
           
 
Methods inherited from class oops.parser.Many
checkDeadLoop, checkLL1, degree, setLookahead, sub
 
Methods inherited from class oops.parser.Node
add, getLookahead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Opt

public Opt(Node node)
Method Detail

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.