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.
 
Fields inherited from class oops.parser.Node
follow, lookahead
 
Constructor Summary
Many(Node node)
           
 
Method Summary
 boolean checkDeadLoop()
           
 void checkLL1(Parser parser)
          subtree is checked.
 int degree()
           
 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 lookahead without empty and succ.
 Set setLookahead(Parser parser)
          lookahead includes empty.
 java.lang.Object sub(int n)
           
 java.lang.String toString()
           
 
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
 

Field Detail

node

protected Node node
subtree to be repeated.
Constructor Detail

Many

public Many(Node node)
Method Detail

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.