com.jeffpalm.cop5555.parse
Class Parser
java.lang.Object
com.jeffpalm.cop5555.parse.Parser
public class Parser
- extends java.lang.Object
Constructor Summary |
Parser(java.lang.String file)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
Parser
public Parser(java.lang.String file)
throws java.io.IOException
- Throws:
java.io.IOException
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()