kmy.jint.tree
Class PrintContext

java.lang.Object
  |
  +--kmy.jint.tree.Context
        |
        +--kmy.jint.tree.PrintContext

public class PrintContext
extends Context
implements TokenConst


Field Summary
(package private)  java.io.CharArrayWriter buffer
           
static int DEBUG_CALLS
           
static int DEBUG_IDENTIFIERS
           
(package private)  int flags
           
(package private)  boolean newLine
           
(package private)  java.lang.String offset
           
(package private)  java.io.PrintWriter out
           
(package private)  int pri
           
 
Fields inherited from interface kmy.jint.constants.TokenConst
TOK_OPT_BUFFERONLY, TOK_OPT_DECLARE, TOK_OPT_GLOBAL, TOK_OPT_IGNORE, TOK_OPT_MULTILINE, TOK_OPT_OFFLINE, TOK_OPT_RETAINALL, TOK_OPT_SINGLELINE, TOK_OPT_STANDALONE, TOKEN_ABSTRACT, TOKEN_AE, TOKEN_AND, TOKEN_ANDE, TOKEN_BOOLEAN, TOKEN_BREAK, TOKEN_BYTE, TOKEN_BYVALUE, TOKEN_CASE, TOKEN_CATCH, TOKEN_CHAR, TOKEN_CLASS, TOKEN_CONST, TOKEN_CONTINUE, TOKEN_DEFAULT, TOKEN_DO, TOKEN_DOUBLE, TOKEN_EE, TOKEN_ELSE, TOKEN_EOF, TOKEN_EXTENDS, TOKEN_FALSE, TOKEN_FINAL, TOKEN_FINALLY, TOKEN_FLOAT, TOKEN_FOR, TOKEN_GE, TOKEN_GG, TOKEN_GGE, TOKEN_GGG, TOKEN_GGGE, TOKEN_GOTO, TOKEN_IF, TOKEN_IMPLEMENTS, TOKEN_IMPORT, TOKEN_INSTANCEOF, TOKEN_INT, TOKEN_INTERFACE, TOKEN_LE, TOKEN_LL, TOKEN_LLE, TOKEN_LONG, TOKEN_ME, TOKEN_MM, TOKEN_NATIVE, TOKEN_NE, TOKEN_NEW, TOKEN_NONE, TOKEN_NULL, TOKEN_OR, TOKEN_ORE, TOKEN_PACKAGE, TOKEN_PCE, TOKEN_PE, TOKEN_PP, TOKEN_PRIVATE, TOKEN_PROTECTED, TOKEN_PUBLIC, TOKEN_RETURN, TOKEN_SE, TOKEN_SHORT, TOKEN_SS, TOKEN_STATIC, TOKEN_SUPER, TOKEN_SWITCH, TOKEN_SYNCHRONIZED, TOKEN_TE, TOKEN_THIS, TOKEN_THREADSAFE, TOKEN_THROW, TOKEN_THROWS, TOKEN_TRANSIENT, TOKEN_TRUE, TOKEN_TRY, TOKEN_V_BOUND, TOKEN_V_CHAR, TOKEN_V_DOUBLE, TOKEN_V_FLOAT, TOKEN_V_FORM, TOKEN_V_INT, TOKEN_V_LONG, TOKEN_V_PATT, TOKEN_V_REGEX, TOKEN_V_STRING, TOKEN_V_SUBST, TOKEN_V_TRANS, TOKEN_VOID, TOKEN_VOLATILE, TOKEN_WHERE, TOKEN_WHILE, TOKEN_WORD, TOKEN_XE, UNARY_MINUS
 
Constructor Summary
PrintContext()
           
PrintContext(java.io.PrintWriter out)
           
 
Method Summary
private  void decOffset()
           
private  void dumpHeader(DefinitionNode def)
           
 java.lang.Object evalArrayValue(ArrayValueNode arrayValueNode)
           
 java.lang.Object evalBody(BodyNode bodyNode)
           
 java.lang.Object evalBreak(BreakNode breakNode)
           
 java.lang.Object evalCall(CallNode callNode)
           
 java.lang.Object evalCase(CaseNode caseNode)
           
 java.lang.Object evalCast(CastNode castNode)
           
 java.lang.Object evalCatch(CatchNode catchNode)
           
 java.lang.Object evalClass(ClassNode classNode)
           
 java.lang.Object evalCond(CondNode condNode)
           
 java.lang.Object evalConst(ConstNode constNode)
           
 java.lang.Object evalContinue(ContinueNode continueNode)
           
 java.lang.Object evalDo(DoNode doNode)
           
 java.lang.Object evalExpressionStatement(ExpressionStatementNode esNode)
           
 java.lang.Object evalFor(ForNode forNode)
           
 java.lang.Object evalFormat(FormatNode formatNode)
           
 java.lang.Object evalIdentifier(IdentifierNode identifierNode)
           
 java.lang.Object evalIf(IfNode ifNode)
           
 java.lang.Object evalImportStatement(ImportStatementNode importStatement)
           
 java.lang.Object evalInfix(InfixNode infixNode)
           
 java.lang.Object evalLabeled(LabeledNode labeledNode)
           
 java.lang.Object evalMember(MemberNode memberNode)
           
 java.lang.Object evalMethod(MethodNode methodNode)
           
 java.lang.Object evalNew(NewNode newNode)
           
 java.lang.Object evalPackageStatement(PackageStatementNode packageStatement)
           
 java.lang.Object evalParameter(ParameterNode parameterNode)
           
 java.lang.Object evalPostfix(PostfixNode postfixNode)
           
 java.lang.Object evalPrefix(PrefixNode prefixNode)
           
 java.lang.Object evalRegex(RegexNode regexNode)
           
 java.lang.Object evalReplacer(ReplacerNode replacerNode)
           
 java.lang.Object evalReturn(ReturnNode returnNode)
           
 java.lang.Object evalSwitch(SwitchNode switchNode)
           
 java.lang.Object evalSynchronized(SynchronizedNode synchronizedNode)
           
 java.lang.Object evalThrow(ThrowNode throwNode)
           
 java.lang.Object evalTry(TryNode tryNode)
           
 java.lang.Object evalWhile(WhileNode whileNode)
           
 int getFlags()
           
private  int getPriority(int token)
           
private  void incOffset()
           
private  void print(char c)
           
private  void print(java.lang.String s)
           
private  void println()
           
private  void println(java.lang.String s)
           
 void printToken(int token)
           
 void setFlags(int flags)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

buffer

java.io.CharArrayWriter buffer

out

java.io.PrintWriter out

offset

java.lang.String offset

newLine

boolean newLine

pri

int pri

flags

int flags

DEBUG_IDENTIFIERS

public static final int DEBUG_IDENTIFIERS

DEBUG_CALLS

public static final int DEBUG_CALLS
Constructor Detail

PrintContext

public PrintContext()

PrintContext

public PrintContext(java.io.PrintWriter out)
Method Detail

toString

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

setFlags

public void setFlags(int flags)

getFlags

public int getFlags()

incOffset

private void incOffset()

decOffset

private void decOffset()

println

private void println(java.lang.String s)

println

private void println()

print

private void print(java.lang.String s)

print

private void print(char c)

dumpHeader

private void dumpHeader(DefinitionNode def)

getPriority

private int getPriority(int token)

printToken

public void printToken(int token)

evalArrayValue

public java.lang.Object evalArrayValue(ArrayValueNode arrayValueNode)
Overrides:
evalArrayValue in class Context

evalBody

public java.lang.Object evalBody(BodyNode bodyNode)
Overrides:
evalBody in class Context

evalBreak

public java.lang.Object evalBreak(BreakNode breakNode)
Overrides:
evalBreak in class Context

evalCall

public java.lang.Object evalCall(CallNode callNode)
Overrides:
evalCall in class Context

evalCase

public java.lang.Object evalCase(CaseNode caseNode)
Overrides:
evalCase in class Context

evalCast

public java.lang.Object evalCast(CastNode castNode)
Overrides:
evalCast in class Context

evalCatch

public java.lang.Object evalCatch(CatchNode catchNode)
Overrides:
evalCatch in class Context

evalClass

public java.lang.Object evalClass(ClassNode classNode)
Overrides:
evalClass in class Context

evalCond

public java.lang.Object evalCond(CondNode condNode)
Overrides:
evalCond in class Context

evalConst

public java.lang.Object evalConst(ConstNode constNode)
Overrides:
evalConst in class Context

evalContinue

public java.lang.Object evalContinue(ContinueNode continueNode)
Overrides:
evalContinue in class Context

evalDo

public java.lang.Object evalDo(DoNode doNode)
Overrides:
evalDo in class Context

evalExpressionStatement

public java.lang.Object evalExpressionStatement(ExpressionStatementNode esNode)
Overrides:
evalExpressionStatement in class Context

evalFor

public java.lang.Object evalFor(ForNode forNode)
Overrides:
evalFor in class Context

evalFormat

public java.lang.Object evalFormat(FormatNode formatNode)
Overrides:
evalFormat in class Context

evalIdentifier

public java.lang.Object evalIdentifier(IdentifierNode identifierNode)
Overrides:
evalIdentifier in class Context

evalIf

public java.lang.Object evalIf(IfNode ifNode)
Overrides:
evalIf in class Context

evalImportStatement

public java.lang.Object evalImportStatement(ImportStatementNode importStatement)
Overrides:
evalImportStatement in class Context

evalInfix

public java.lang.Object evalInfix(InfixNode infixNode)
Overrides:
evalInfix in class Context

evalLabeled

public java.lang.Object evalLabeled(LabeledNode labeledNode)
Overrides:
evalLabeled in class Context

evalMember

public java.lang.Object evalMember(MemberNode memberNode)
Overrides:
evalMember in class Context

evalMethod

public java.lang.Object evalMethod(MethodNode methodNode)
Overrides:
evalMethod in class Context

evalNew

public java.lang.Object evalNew(NewNode newNode)
Overrides:
evalNew in class Context

evalPackageStatement

public java.lang.Object evalPackageStatement(PackageStatementNode packageStatement)
Overrides:
evalPackageStatement in class Context

evalParameter

public java.lang.Object evalParameter(ParameterNode parameterNode)
Overrides:
evalParameter in class Context

evalPostfix

public java.lang.Object evalPostfix(PostfixNode postfixNode)
Overrides:
evalPostfix in class Context

evalPrefix

public java.lang.Object evalPrefix(PrefixNode prefixNode)
Overrides:
evalPrefix in class Context

evalRegex

public java.lang.Object evalRegex(RegexNode regexNode)
Overrides:
evalRegex in class Context

evalReplacer

public java.lang.Object evalReplacer(ReplacerNode replacerNode)
Overrides:
evalReplacer in class Context

evalReturn

public java.lang.Object evalReturn(ReturnNode returnNode)
Overrides:
evalReturn in class Context

evalSwitch

public java.lang.Object evalSwitch(SwitchNode switchNode)
Overrides:
evalSwitch in class Context

evalSynchronized

public java.lang.Object evalSynchronized(SynchronizedNode synchronizedNode)
Overrides:
evalSynchronized in class Context

evalThrow

public java.lang.Object evalThrow(ThrowNode throwNode)
Overrides:
evalThrow in class Context

evalTry

public java.lang.Object evalTry(TryNode tryNode)
Overrides:
evalTry in class Context

evalWhile

public java.lang.Object evalWhile(WhileNode whileNode)
Overrides:
evalWhile in class Context