oops.parser
Class Seq

java.lang.Object
  |
  +--oops.parser.Node
        |
        +--oops.parser.Seq

public class Seq
extends Node

represents a sequence of nodes.

See Also:
Serialized Form

Field Summary
protected  java.util.Vector nodes
          sequence of subtrees.
 
Fields inherited from class oops.parser.Node
follow, lookahead
 
Constructor Summary
Seq(Node node)
           
 
Method Summary
 void add(Node node)
          extends tree.
 boolean checkDeadLoop()
           
 void checkLL1(Parser parser)
          check LL(1); must be sent to subtrees.
 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)
          each element gets successor's lookahead.
 Set setLookahead(Parser parser)
          lookahead is union including first element that does not accept empty input; it includes empty input only if there is no such element.
 java.lang.Object sub(int n)
           
 java.lang.String toString()
           
 
Methods inherited from class oops.parser.Node
getLookahead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nodes

protected java.util.Vector nodes
sequence of subtrees.
Constructor Detail

Seq

public Seq(Node node)
Method Detail

add

public void add(Node node)
Description copied from class: Node
extends tree.
Overrides:
add in class Node

node

public Node node()
Description copied from class: Node
simplifies tree.
Overrides:
node in class Node
Returns:
nodes.elementAt(0) if only one.

setLookahead

public Set setLookahead(Parser parser)
lookahead is union including first element that does not accept empty input; it includes empty input only if there is no such element.
Overrides:
setLookahead in class Node
Tags copied from class: Node
Returns:
lookahead.

setFollow

public Set setFollow(Parser parser,
                     Set succ)
each element gets successor's lookahead.
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)
Description copied from class: Node
check LL(1); must be sent to subtrees.
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.