com.caucho.es.parser
Class Expr

java.lang.Object
|
+--com.caucho.es.parser.Expr
Direct Known Subclasses:
AssignExpr, BinaryExpr, BooleanExpr, CallExpr, CastExpr, ConditionalExpr, DeleteExpr, FieldExpr, IdExpr, JavaClassExpr, LiteralExpr, PackageExpr, PlusExpr, PostfixExpr, RegexpExpr, SpecialExpr, TopExpr, TypeExpr, UnaryExpr

class Expr
extends java.lang.Object

Expr is an intermediate form representing an expression.


Field Summary
protected  Block block
           
protected  ParseClass cl
           
private  java.lang.String filename
           
protected  Function function
           
protected  boolean isTop
           
protected  java.lang.Class javaType
           
private  int line
           
protected  boolean noValue
           
protected  int type
           
protected static int TYPE_BOOLEAN
           
protected static int TYPE_ES
           
protected static int TYPE_INTEGER
           
protected static int TYPE_JAVA
           
protected static int TYPE_LONG
           
protected static int TYPE_NUMBER
           
protected static int TYPE_STRING
           
protected static int TYPE_UNKNOWN
           
protected static int TYPE_VOID
           
protected  int withDepth
           
 
Constructor Summary
(package private) Expr(Block block)
           
 
Method Summary
(package private)  Expr assign(Expr value)
          The assignment operator
(package private)  Expr binaryOp(int lex, int op, Expr rexpr)
          A binary op
(package private)  Expr cast(Expr castType)
           
(package private)  Expr conditional(Expr mexpr, Expr rexpr)
          The conditional ? : operation
(package private)  Expr delete()
          The delete operator
(package private)  Expr doVoid()
          A unary op
private  ESException error(java.lang.String msg)
           
(package private)  void exprStatement(Function fun)
           
(package private)  Expr fieldReference(ESId id)
          Gets the field of the current expr
(package private)  Expr fieldReference(Expr expr)
          Gets the field of the current expr
(package private)  java.lang.String getFilename()
           
(package private)  java.lang.Class getJavaClass()
          Returns the Java class representing this type.
(package private)  int getLine()
           
(package private)  int getType()
          Returns the javascript type of the expression.
(package private)  Expr getTypeExpr()
           
(package private)  boolean isNum()
           
(package private)  boolean isNumeric()
          True if the type of this expression is easily converted to a number.
(package private)  boolean isSimple()
           
(package private)  void killValue()
           
(package private)  Expr next(java.lang.String iter, Expr lhs)
           
(package private)  Expr postfix(int op)
          Handle autoincrement
(package private)  Expr prefix(int op)
          Handle autoincrement
(package private)  void print()
           
(package private)  void printBoolean()
           
(package private)  void printBooleanImpl()
           
(package private)  void printExpr()
           
(package private)  void printImpl()
           
(package private)  void printInt32()
           
(package private)  void printInt32Impl()
           
(package private)  void printInt64()
           
(package private)  void printInt64Impl()
           
(package private)  void printJava()
          Prints the expression as a java object.
(package private)  void printJavaClass(java.lang.Class type)
           
(package private)  void printJavaImpl()
           
(package private)  void printJavaString()
           
(package private)  void printLiteral(ESBase literal)
           
(package private)  void printNum()
           
(package private)  void printNumImpl()
           
(package private)  void printStr()
          Prints a string value
(package private)  void printString()
          Print where the result is a string.
(package private)  void printStringImpl()
           
(package private)  Expr setBoolean()
          This expression will be used in a boolean context.
(package private)  void setTop()
           
(package private)  void setUsed()
           
(package private)  CallExpr startCall()
           
(package private)  CallExpr startNew()
           
(package private)  Expr typeof()
          The typeof operator
(package private)  Expr unaryOp(int op)
          A unary op
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

TYPE_UNKNOWN

protected static final int TYPE_UNKNOWN

TYPE_ES

protected static final int TYPE_ES

TYPE_STRING

protected static final int TYPE_STRING

TYPE_NUMBER

protected static final int TYPE_NUMBER

TYPE_LONG

protected static final int TYPE_LONG

TYPE_INTEGER

protected static final int TYPE_INTEGER

TYPE_BOOLEAN

protected static final int TYPE_BOOLEAN

TYPE_JAVA

protected static final int TYPE_JAVA

TYPE_VOID

protected static final int TYPE_VOID

cl

protected ParseClass cl

block

protected Block block

function

protected Function function

type

protected int type

javaType

protected java.lang.Class javaType

isTop

protected boolean isTop

noValue

protected boolean noValue

filename

private java.lang.String filename

line

private int line

withDepth

protected int withDepth
Constructor Detail

Expr

Expr(Block block)
Method Detail

getFilename

java.lang.String getFilename()

getLine

int getLine()

killValue

void killValue()

setUsed

void setUsed()

setTop

void setTop()

getType

int getType()
Returns the javascript type of the expression.

getTypeExpr

Expr getTypeExpr()

getJavaClass

java.lang.Class getJavaClass()
Returns the Java class representing this type.

isSimple

boolean isSimple()

isNumeric

boolean isNumeric()
True if the type of this expression is easily converted to a number.

isNum

boolean isNum()

setBoolean

Expr setBoolean()
This expression will be used in a boolean context.

next

Expr next(java.lang.String iter,
Expr lhs)
throws ESException

fieldReference

Expr fieldReference(Expr expr)
Gets the field of the current expr

fieldReference

Expr fieldReference(ESId id)
throws ESException
Gets the field of the current expr

unaryOp

Expr unaryOp(int op)
A unary op

doVoid

Expr doVoid()
A unary op

typeof

Expr typeof()
The typeof operator

delete

Expr delete()
throws ESException
The delete operator

assign

Expr assign(Expr value)
throws ESException
The assignment operator

startCall

CallExpr startCall()
throws ESException

startNew

CallExpr startNew()
throws ESException

prefix

Expr prefix(int op)
throws ESException
Handle autoincrement

postfix

Expr postfix(int op)
Handle autoincrement

binaryOp

Expr binaryOp(int lex,
int op,
Expr rexpr)
throws ESException
A binary op

cast

Expr cast(Expr castType)
throws ESException

conditional

Expr conditional(Expr mexpr,
Expr rexpr)
The conditional ? : operation

printExpr

void printExpr()
throws java.io.IOException

print

void print()
throws java.io.IOException

printBoolean

void printBoolean()
throws java.io.IOException

printInt32

void printInt32()
throws java.io.IOException

printInt64

void printInt64()
throws java.io.IOException

printNum

void printNum()
throws java.io.IOException

printJava

void printJava()
throws java.io.IOException
Prints the expression as a java object.

printStr

void printStr()
throws java.io.IOException
Prints a string value

printJavaString

void printJavaString()
throws java.io.IOException

printJavaClass

void printJavaClass(java.lang.Class type)
throws java.io.IOException

printString

void printString()
throws java.io.IOException
Print where the result is a string.

printImpl

void printImpl()
throws java.io.IOException

printBooleanImpl

void printBooleanImpl()
throws java.io.IOException

printNumImpl

void printNumImpl()
throws java.io.IOException

printInt32Impl

void printInt32Impl()
throws java.io.IOException

printInt64Impl

void printInt64Impl()
throws java.io.IOException

printStringImpl

void printStringImpl()
throws java.io.IOException

printJavaImpl

void printJavaImpl()
throws java.io.IOException

printLiteral

void printLiteral(ESBase literal)
throws java.io.IOException

exprStatement

void exprStatement(Function fun)
throws ESException

error

private ESException error(java.lang.String msg)