com.voytechs.jnetstream.npl
Class PrintStatement

java.lang.Object
  extended by com.voytechs.jnetstream.npl.Node
      extended by com.voytechs.jnetstream.npl.StatementNode
          extended by com.voytechs.jnetstream.npl.PrintStatement
All Implemented Interfaces:
Visitable

public class PrintStatement
extends StatementNode
implements Visitable


Field Summary
static int PACKET
           
static int STDOUT
           
protected  StringNode stringExpression
           
protected  int whereToPrint
           
 
Fields inherited from class com.voytechs.jnetstream.npl.StatementNode
code, modifiers, perm, statement, sym, token, type, typePrimitive, value
 
Fields inherited from class com.voytechs.jnetstream.npl.Node
parent
 
Constructor Summary
PrintStatement()
           
 
Method Summary
protected  boolean acceptModifier(Token token)
           
 boolean getNewlineFlag()
          Returns the state of the newline flag.
 boolean getPrefixFlag()
          Returns the state of the display prefix flag.
 StringNode getStringExpression()
           
 int getWhereToPrint()
          Returns where to print.
static void main(java.lang.String[] args)
          Test function for PrintStatement
 Node parse(ExpTokenizer tokens)
           
protected  void parseStringExpression(ExpTokenizer tokens)
           
 boolean visit(Visitor visitor, java.lang.Object user1, java.lang.Object user2)
           
 
Methods inherited from class com.voytechs.jnetstream.npl.StatementNode
acceptCode, acceptLValue, acceptStatement, canOptimize, getCode, getLineNumber, getName, getPermTable, getStatement, getSymTable, getType, getTypePrimitive, optimize, parseCode, parseLValue, parseModifiers, parsePostModifiers, setSymTable, setTypePrimitive, 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

PACKET

public static final int PACKET
See Also:
Constant Field Values

STDOUT

public static final int STDOUT
See Also:
Constant Field Values

stringExpression

protected StringNode stringExpression

whereToPrint

protected int whereToPrint
Constructor Detail

PrintStatement

public PrintStatement()
Parameters:
-
Throws:
Method Detail

parse

public Node parse(ExpTokenizer tokens)
           throws SyntaxError
Overrides:
parse in class StatementNode
Throws:
SyntaxError

visit

public boolean visit(Visitor visitor,
                     java.lang.Object user1,
                     java.lang.Object user2)
              throws NodeException
Specified by:
visit in interface Visitable
Throws:
NodeException

parseStringExpression

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

getStringExpression

public StringNode getStringExpression()

acceptModifier

protected boolean acceptModifier(Token token)
Overrides:
acceptModifier in class StatementNode

getNewlineFlag

public boolean getNewlineFlag()
Returns the state of the newline flag. If true print the newline at end of the string, or if false do not.

Returns:
true print newline, false do not.

getPrefixFlag

public boolean getPrefixFlag()
Returns the state of the display prefix flag. If true a prefix should be displayed, if false then not. Prefix is displayer specific but usually is the name of the protocol with appropriate amount of spaces for alignment.

Returns:
Display prefix if true, otherwise not.

getWhereToPrint

public int getWhereToPrint()
Returns where to print.


main

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

Parameters:
args - command line arguments