com.voytechs.jnetstream.npl
Class StatementNode

java.lang.Object
  extended by com.voytechs.jnetstream.npl.Node
      extended by com.voytechs.jnetstream.npl.StatementNode
Direct Known Subclasses:
AssertStatement, BreakStatement, BufferStatement, ContinueStatement, EnumStatement, FieldStatement, FilterStatement, FlowentryStatement, FlowkeyStatement, FlowpairStatement, ForStatement, IfStatement, LinkStatement, LocalStatement, PrintStatement, ProcessStatement, PropertyStatement, StatementContainer, VariableStatement, WhileStatement

public class StatementNode
extends Node


Field Summary
protected  Node code
           
protected  java.util.List modifiers
           
protected  java.util.HashMap perm
           
protected  java.lang.String statement
           
protected  SymTable sym
           
protected  Token token
           
protected  java.lang.String type
           
protected  ProtocolPrimitiveFactory typePrimitive
           
protected  java.lang.String value
           
 
Fields inherited from class com.voytechs.jnetstream.npl.Node
parent
 
Constructor Summary
StatementNode(java.lang.String statement)
          Initializer the statement node.
 
Method Summary
protected  boolean acceptCode(Node block)
           
protected  boolean acceptLValue(Token token)
           
protected  boolean acceptModifier(Token token)
           
protected  boolean acceptStatement(Token token)
          Make double sure the name of the statement that parser found is actually this statemeent.
 boolean canOptimize()
           
 Node getCode()
           
 int getLineNumber()
           
 java.lang.String getName()
           
 java.util.Map getPermTable()
           
 java.lang.String getStatement()
           
 SymTable getSymTable()
           
 java.lang.String getType()
           
 ProtocolPrimitiveFactory getTypePrimitive()
           
static void main(java.lang.String[] args)
          Test function for StatementNode
 Node optimize()
           
 Node parse(ExpTokenizer tokens)
           
protected  void parseCode(ExpTokenizer tokens)
           
protected  void parseLValue(ExpTokenizer tokens)
           
protected  void parseModifiers(ExpTokenizer tokens)
           
protected  void parsePostModifiers(ExpTokenizer tokens)
           
 void setSymTable(SymTable table)
           
 void setTypePrimitive(ProtocolPrimitiveFactory primitive)
           
 java.lang.String toString()
           
 
Methods inherited from class com.voytechs.jnetstream.npl.Node
getParent, getToken, setParent, setToken
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

token

protected Token token

statement

protected java.lang.String statement

type

protected java.lang.String type

value

protected java.lang.String value

modifiers

protected java.util.List modifiers

code

protected Node code

typePrimitive

protected ProtocolPrimitiveFactory typePrimitive

perm

protected java.util.HashMap perm

sym

protected SymTable sym
Constructor Detail

StatementNode

public StatementNode(java.lang.String statement)
Initializer the statement node.

Method Detail

parse

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

parsePostModifiers

protected void parsePostModifiers(ExpTokenizer tokens)
                           throws SyntaxError
Throws:
SyntaxError

parseLValue

protected void parseLValue(ExpTokenizer tokens)
                    throws SyntaxError
Throws:
SyntaxError

acceptStatement

protected boolean acceptStatement(Token token)
Make double sure the name of the statement that parser found is actually this statemeent. If correct, it allocates a SymTable entry.


acceptModifier

protected boolean acceptModifier(Token token)

acceptLValue

protected boolean acceptLValue(Token token)

setSymTable

public void setSymTable(SymTable table)

acceptCode

protected boolean acceptCode(Node block)

parseModifiers

protected void parseModifiers(ExpTokenizer tokens)
                       throws SyntaxError
Throws:
SyntaxError

parseCode

protected void parseCode(ExpTokenizer tokens)
                  throws SyntaxError
Throws:
SyntaxError

canOptimize

public boolean canOptimize()
Specified by:
canOptimize in class Node

optimize

public Node optimize()
Specified by:
optimize in class Node

getStatement

public java.lang.String getStatement()

getCode

public Node getCode()

getName

public java.lang.String getName()

getSymTable

public SymTable getSymTable()

getPermTable

public java.util.Map getPermTable()

getType

public java.lang.String getType()

setTypePrimitive

public void setTypePrimitive(ProtocolPrimitiveFactory primitive)

getTypePrimitive

public ProtocolPrimitiveFactory getTypePrimitive()

getLineNumber

public int getLineNumber()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

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

Parameters:
args - command line arguments