com.jeffpalm.cop5555.parse
Class Parser

java.lang.Object
  extended by com.jeffpalm.cop5555.parse.Parser

public class Parser
extends java.lang.Object


Field Summary
static int BAD_TOKEN_ERR
           
static int COMMAND_ERR
           
protected  Token errTok
           
static int FACTOR_ERR
           
protected  java.lang.String file
           
protected  TreeNode head
           
static java.lang.String[] msgs
           
protected  Scanner sc
           
protected  com.jeffpalm.cop5555.parse.TreeNodeStack stack
           
static int STUFF_ON_STACK_ERR
           
protected  Token tok
           
 
Constructor Summary
Parser(java.lang.String file)
           
 
Method Summary
protected  void demand(int type)
           
protected  boolean eat(int type)
           
protected  void error(int errNum)
           
protected  void error(int errNum, java.lang.String str)
           
 java.lang.String getFile()
           
 java.util.Vector getText()
           
protected  TreeNode makeTree(int nonTermType, int num)
           
protected  TreeNode makeTree(TreeNode node, int num)
           
protected  TreeNode makeTree(TreeNode t, int num, Pos p)
           
 TreeNode parse()
           
protected  boolean peek(int type)
           
protected  Pos pos()
           
protected  void push(TreeNode node)
           
protected  Token tok()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tok

protected Token tok

errTok

protected Token errTok

head

protected TreeNode head

sc

protected Scanner sc

stack

protected com.jeffpalm.cop5555.parse.TreeNodeStack stack

file

protected java.lang.String file

msgs

public static final java.lang.String[] msgs

COMMAND_ERR

public static final int COMMAND_ERR
See Also:
Constant Field Values

FACTOR_ERR

public static final int FACTOR_ERR
See Also:
Constant Field Values

BAD_TOKEN_ERR

public static final int BAD_TOKEN_ERR
See Also:
Constant Field Values

STUFF_ON_STACK_ERR

public static final int STUFF_ON_STACK_ERR
See Also:
Constant Field Values
Constructor Detail

Parser

public Parser(java.lang.String file)
       throws java.io.IOException
Throws:
java.io.IOException
Method Detail

parse

public TreeNode parse()
               throws java.io.IOException
Throws:
java.io.IOException

push

protected void push(TreeNode node)

peek

protected boolean peek(int type)

eat

protected boolean eat(int type)
               throws java.io.IOException
Throws:
java.io.IOException

demand

protected void demand(int type)
               throws java.io.IOException
Throws:
java.io.IOException

makeTree

protected TreeNode makeTree(TreeNode node,
                            int num)

makeTree

protected TreeNode makeTree(int nonTermType,
                            int num)

makeTree

protected TreeNode makeTree(TreeNode t,
                            int num,
                            Pos p)

error

protected void error(int errNum,
                     java.lang.String str)

error

protected void error(int errNum)

pos

protected Pos pos()

tok

protected Token tok()

getText

public java.util.Vector getText()

getFile

public java.lang.String getFile()