agg.attribute.parser.javaExpr
Class Jex

java.lang.Object
  extended by agg.attribute.parser.javaExpr.Jex
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class Jex
extends java.lang.Object
implements java.awt.event.ActionListener


Field Summary
protected  java.io.PrintStream err
           
static int IS_COMPLEX
           
static int IS_CONSTANT
           
static int IS_VARIABLE
           
protected  boolean isOutput
           
protected  java.io.PrintStream out
           
static int PARSE_ERROR
           
protected static JexParser parser
           
protected  java.io.ByteArrayOutputStream redirect
           
protected  java.io.PrintStream redirectOut
           
protected static java.lang.Object refObj
           
protected  java.awt.TextField typeTF
           
protected  java.lang.Object variableExpression
           
 
Constructor Summary
Jex()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
static java.lang.String addMessage(java.lang.Exception ex)
           
protected  void antiRedirect()
           
 void check_(java.lang.String text, java.lang.Class<?> type, SymbolTable symtab)
           
 void check(Node ast, java.lang.Class<?> type, SymbolTable symtab)
           
 void check(java.lang.String text, java.lang.Class<?> type, SymbolTable symtab)
           
 void fullTest(java.lang.String line)
           
 Node getAST()
          returns root node of the abstract syntax tree
protected  int getExprProperty()
           
protected  java.lang.String getPropertyText(int code)
           
 java.lang.Object getVariableExpression()
           
 java.lang.Object interpret_(java.lang.String text, java.lang.Class<?> type, SymbolTable symtab)
           
 java.lang.Object interpret(Node ast, java.lang.Class<?> type, SymbolTable symtab)
          Interprets an expression.
 java.lang.Object interpret(java.lang.String text, java.lang.Class<?> type, SymbolTable symtab)
          Deprecated. Strings are NOT sufficent to represent expressions
protected  boolean isAssignable(java.lang.Class<?> to, java.lang.Class<?> from)
           
static void main(java.lang.String[] args)
           
protected  void newStdErrStream()
           
protected  void newStdOutStream()
           
protected  int parse_(java.lang.String text)
           
 int parse(java.lang.String text)
           
 void parseOutputOff()
           
 void parseOutputOn()
           
protected  void redirectToString()
           
protected  void restoreOutputStream()
           
 void rewrite(Node ast, java.lang.Class<?> type, SymbolTable symtab)
          Rewrites all variables
protected  void swapPrintStream()
          Swaps StdOut and StdErr to ByteStream and vice versa
protected  java.lang.Object test_interpret(java.lang.String text, java.lang.Class<?> type, SymbolTable symtab)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARSE_ERROR

public static final int PARSE_ERROR
See Also:
Constant Field Values

IS_CONSTANT

public static final int IS_CONSTANT
See Also:
Constant Field Values

IS_VARIABLE

public static final int IS_VARIABLE
See Also:
Constant Field Values

IS_COMPLEX

public static final int IS_COMPLEX
See Also:
Constant Field Values

typeTF

protected java.awt.TextField typeTF

parser

protected static JexParser parser

out

protected java.io.PrintStream out

err

protected java.io.PrintStream err

redirect

protected java.io.ByteArrayOutputStream redirect

redirectOut

protected java.io.PrintStream redirectOut

isOutput

protected boolean isOutput

variableExpression

protected java.lang.Object variableExpression

refObj

protected static java.lang.Object refObj
Constructor Detail

Jex

public Jex()
Method Detail

main

public static void main(java.lang.String[] args)

fullTest

public void fullTest(java.lang.String line)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

getExprProperty

protected int getExprProperty()

newStdOutStream

protected void newStdOutStream()

newStdErrStream

protected void newStdErrStream()

antiRedirect

protected void antiRedirect()

swapPrintStream

protected void swapPrintStream()
Swaps StdOut and StdErr to ByteStream and vice versa

See Also:
redirectToString(), restoreOutputStream()

redirectToString

protected void redirectToString()

restoreOutputStream

protected void restoreOutputStream()

addMessage

public static java.lang.String addMessage(java.lang.Exception ex)

parseOutputOn

public void parseOutputOn()

parseOutputOff

public void parseOutputOff()

parse

public int parse(java.lang.String text)
          throws AttrHandlerException
Throws:
AttrHandlerException

getPropertyText

protected java.lang.String getPropertyText(int code)

parse_

protected int parse_(java.lang.String text)
              throws ParseError
Throws:
ParseError

check

public void check(Node ast,
                  java.lang.Class<?> type,
                  SymbolTable symtab)
           throws AttrHandlerException
Throws:
AttrHandlerException

check

public void check(java.lang.String text,
                  java.lang.Class<?> type,
                  SymbolTable symtab)
           throws AttrHandlerException
Throws:
AttrHandlerException

check_

public void check_(java.lang.String text,
                   java.lang.Class<?> type,
                   SymbolTable symtab)
            throws ParseError
Throws:
ParseError

isAssignable

protected boolean isAssignable(java.lang.Class<?> to,
                               java.lang.Class<?> from)

test_interpret

protected java.lang.Object test_interpret(java.lang.String text,
                                          java.lang.Class<?> type,
                                          SymbolTable symtab)
                                   throws AttrHandlerException
Throws:
AttrHandlerException

interpret

public java.lang.Object interpret(Node ast,
                                  java.lang.Class<?> type,
                                  SymbolTable symtab)
                           throws AttrHandlerException
Interprets an expression.

Throws:
AttrHandlerException

interpret

public java.lang.Object interpret(java.lang.String text,
                                  java.lang.Class<?> type,
                                  SymbolTable symtab)
                           throws AttrHandlerException
Deprecated. Strings are NOT sufficent to represent expressions

Interprets an expression.

Throws:
AttrHandlerException

interpret_

public java.lang.Object interpret_(java.lang.String text,
                                   java.lang.Class<?> type,
                                   SymbolTable symtab)
                            throws ParseError
Throws:
ParseError

rewrite

public void rewrite(Node ast,
                    java.lang.Class<?> type,
                    SymbolTable symtab)
             throws AttrHandlerException
Rewrites all variables

Throws:
AttrHandlerException

getAST

public Node getAST()
returns root node of the abstract syntax tree


getVariableExpression

public java.lang.Object getVariableExpression()