oops.parser
Class Token

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

public class Token
extends Node

represents class of terminal symbols.

See Also:
Serialized Form

Field Summary
protected  java.lang.String name
          identifies input token class.
 
Fields inherited from class oops.parser.Node
follow, lookahead
 
Constructor Summary
Token(java.lang.String name, Set lookahead)
           
 
Method Summary
 boolean checkDeadLoop()
           
 void checkLL1(Parser parser)
          follow is not set; nothing to check.
 void parse(Scanner scanner, Goal goal, Parser parser, oops.parser.Activation caller)
          performs recognition.
 Set setFollow(Parser parser, Set succ)
          follow need not be set.
 Set setLookahead(Parser parser)
          initializes lookahead for rules.
 java.lang.String toString()
           
 
Methods inherited from class oops.parser.Node
add, degree, getLookahead, node, sub
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
identifies input token class.
Constructor Detail

Token

public Token(java.lang.String name,
             Set lookahead)
Method Detail

setLookahead

public Set setLookahead(Parser parser)
Description copied from class: Node
initializes lookahead for rules. Does not completely traverse sequences to avoid recursion.
Overrides:
setLookahead in class Node
Returns:
a one-element set, initialized by the parser.

setFollow

public Set setFollow(Parser parser,
                     Set succ)
follow need not be set.
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)
follow is not set; nothing to check.
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

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.