com.voytechs.jnetstream.npl
Class StatementParser

java.lang.Object
  extended by com.voytechs.jnetstream.npl.StatementParser

public class StatementParser
extends java.lang.Object


Field Summary
protected  boolean forceEnumConstants
           
static int MAX_LIST_SIZE
           
 
Constructor Summary
StatementParser()
           
 
Method Summary
static void main(java.lang.String[] args)
          Test function for StatementParser
 NodeList parse(ExpTokenizer tokens)
           
 NodeList parseBlock(ExpTokenizer tokens)
          Parses a block of instructions.
 NodeList parseEnumBlock(ExpTokenizer tokens)
          Parses a block of instructions.
 Node parseEnumInstruction(ExpTokenizer tokens)
           
 Node parseInstruction(ExpTokenizer tokens)
           
 java.util.ArrayList parseListExpression(ExpTokenizer tokens)
          Lists are made up of any number and '-' and ',' characters.
 void setForceEnumConstants(boolean state)
          By setting to true, enum constants will not be assigned labels, but the label constant name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_LIST_SIZE

public static final int MAX_LIST_SIZE
See Also:
Constant Field Values

forceEnumConstants

protected boolean forceEnumConstants
Constructor Detail

StatementParser

public StatementParser()
Parameters:
-
Throws:
Method Detail

parse

public NodeList parse(ExpTokenizer tokens)
               throws SyntaxError
Throws:
SyntaxError

parseBlock

public NodeList parseBlock(ExpTokenizer tokens)
                    throws SyntaxError
Parses a block of instructions. A block is 1 or more instructions. What is returned is a list of Nodes (instructions found). Each instruction has to finished off with a semicolon. This indicates the end of instructions and a new instruction can begin.

Throws:
SyntaxError

parseInstruction

public Node parseInstruction(ExpTokenizer tokens)
                      throws SyntaxError
Throws:
SyntaxError

parseEnumBlock

public NodeList parseEnumBlock(ExpTokenizer tokens)
                        throws SyntaxError
Parses a block of instructions. A block is 1 or more instructions. What is returned is a list of Nodes (instructions found). Each instruction has to finished off with a semicolon. This indicates the end of instructions and a new instruction can begin.

Throws:
SyntaxError

parseEnumInstruction

public Node parseEnumInstruction(ExpTokenizer tokens)
                          throws SyntaxError
Throws:
SyntaxError

parseListExpression

public java.util.ArrayList parseListExpression(ExpTokenizer tokens)
                                        throws SyntaxError
Lists are made up of any number and '-' and ',' characters. '-' means range. ie. 1-10 means all numbers through 10. ',' means a list. ie 1,2,5,6 means 1 & 2 & 5 & 6, excluding all other numbers.

Throws:
SyntaxError

setForceEnumConstants

public void setForceEnumConstants(boolean state)
By setting to true, enum constants will not be assigned labels, but the label constant name.


main

public static void main(java.lang.String[] args)
Test function for StatementParser

Parameters:
args - command line arguments