public class ExprFactory
extends java.lang.Object
Constructor and Description |
---|
ExprFactory() |
Modifier and Type | Method and Description |
---|---|
static ExprFactory |
create() |
Expr |
createAdd(Expr left,
Expr right)
Creates an addition expression.
|
Expr |
createAnd(Expr left,
Expr right)
Creates an and expression.
|
Expr |
createAppend(Expr left,
Expr right)
Creates an append expression
|
protected BinaryAppendExpr |
createAppendImpl(Expr left,
BinaryAppendExpr right) |
Expr |
createArrayFun(java.util.ArrayList<Expr> keys,
java.util.ArrayList<Expr> values)
Creates a array() expression.
|
ArrayGetExpr |
createArrayGet(Location location,
Expr base,
Expr index)
Creates an array get 'a[0]' expression.
|
ArrayTailExpr |
createArrayTail(Location location,
Expr base)
Creates an array tail 'a[]' expression.
|
Expr |
createAssign(AbstractVarExpr left,
Expr right)
Creates an assignment expression.
|
Expr |
createAssignRef(AbstractVarExpr left,
Expr right)
Creates an assignment expression.
|
Expr |
createBinary(BinaryValue value)
Creates a binary literal expression.
|
Expr |
createBitAnd(Expr left,
Expr right)
Creates a bit-and expression.
|
Expr |
createBitNot(Expr expr)
Creates a unary inversion '~a' expression.
|
Expr |
createBitOr(Expr left,
Expr right)
Creates a bit-or expression.
|
Expr |
createBitXor(Expr left,
Expr right)
Creates a bit-xor expression.
|
Statement |
createBlock(Location loc,
java.util.ArrayList<Statement> statementList) |
Statement |
createBlock(Location loc,
Statement[] statementList) |
BlockStatement |
createBlockImpl(Location loc,
java.util.ArrayList<Statement> statementList)
Creates an expr statement
|
BlockStatement |
createBlockImpl(Location loc,
Statement[] statements)
Creates an expr statement
|
BreakStatement |
createBreak(Location location,
Expr target,
java.util.ArrayList<java.lang.String> loopLabelList)
Creates a break statement
|
Expr |
createCall(QuercusParser parser,
StringValue name,
java.util.ArrayList<Expr> args)
Creates a new function call.
|
BinaryCharAtExpr |
createCharAt(Expr base,
Expr index)
Creates a char at 'a{0}' expression.
|
Expr |
createClassConst(Expr className,
Expr name)
Creates an expression class const expression ($class::{$foo}).
|
Expr |
createClassConst(Expr className,
StringValue name)
Creates an expression class const expression ($class::FOO).
|
ClassVarNameConstExpr |
createClassConst(java.lang.String className,
Expr name)
Creates a class const expression.
|
ClassConstExpr |
createClassConst(java.lang.String className,
StringValue name)
Creates a class const expression.
|
Expr |
createClassConstructor(Location loc,
java.lang.String className,
StringValue methodName,
java.util.ArrayList<Expr> args)
Creates a class method call A::foo(...)
|
Statement |
createClassDef(Location loc,
InterpretedClassDef cl)
Creates a new function def statement
|
InterpretedClassDef |
createClassDef(Location location,
java.lang.String name,
java.lang.String parentName,
java.lang.String[] ifaceList,
int index) |
ConstClassExpr |
createClassExpr(Location location,
StringValue funName)
Creates a __CLASS__ expression (for traits).
|
Expr |
createClassField(Expr className,
Expr name)
Creates an class static field '$class::$b' expression.
|
Expr |
createClassField(Expr className,
StringValue name)
Creates an class static field '$a::$b' expression.
|
Expr |
createClassField(java.lang.String className,
Expr name)
Creates an class static field 'a::${b}' expression.
|
Expr |
createClassField(java.lang.String className,
StringValue name)
Creates an class static field 'a::$b' expression.
|
Expr |
createClassMethodCall(Location loc,
Expr className,
Expr methodName,
java.util.ArrayList<Expr> args)
Creates a new method ${class}::$f()
|
Expr |
createClassMethodCall(Location loc,
Expr className,
StringValue methodName,
java.util.ArrayList<Expr> args)
Creates a class method call ${class}::foo(...)
|
Expr |
createClassMethodCall(Location loc,
java.lang.String className,
Expr methodName,
java.util.ArrayList<Expr> args)
Creates a new method A::$f()
|
Expr |
createClassMethodCall(Location loc,
java.lang.String className,
StringValue methodName,
java.util.ArrayList<Expr> args)
Creates a class method call A::foo(...)
|
Statement |
createClassStatic(Location loc,
StringValue staticName,
VarExpr var,
Expr value)
Creates a static statement
|
ClassVarNameVirtualConstExpr |
createClassVirtualConst(Expr name)
Creates a class const expression (static::{$foo}).
|
ClassVirtualConstExpr |
createClassVirtualConst(StringValue name)
Creates a class const expression (static::FOO).
|
Expr |
createClassVirtualField(Expr name)
Creates a class static field 'static::${b}' expression.
|
Expr |
createClassVirtualField(StringValue name)
Creates a class static field 'static::$b' expression.
|
Expr |
createClassVirtualMethodCall(Location loc,
Expr var,
java.util.ArrayList<Expr> args)
Creates a new method static::$f()
|
Expr |
createClassVirtualMethodCall(Location loc,
StringValue methodName,
java.util.ArrayList<Expr> args)
Creates a new function call based on the class context.
|
Expr |
createClone(Expr expr)
Creates a clone 'clone a' expression.
|
ClosureExpr |
createClosure(Location loc,
Function fun,
java.util.ArrayList<VarExpr> useArgs,
boolean isInClassScope)
Creates a new closure.
|
Statement |
createClosureStatic(Location loc,
VarExpr var,
Expr value)
Creates a static statement that is within a closure scope
|
Expr |
createComma(Expr left,
Expr right)
Creates a comma expression.
|
Expr |
createConditional(Expr test,
Expr left,
Expr right)
Creates an conditional expression.
|
ConstExpr |
createConst(java.lang.String name)
Creates a const expression.
|
ContinueStatement |
createContinue(Location location,
Expr target,
java.util.ArrayList<java.lang.String> loopLabelList)
Creates a continue statement
|
Expr |
createCopy(Expr expr)
Creates a clone 'clone a' expression.
|
Expr |
createDefault()
Creates a default
|
Expr |
createDie(Expr expr)
Creates a die 'die("msg")' expression.
|
ConstDirExpr |
createDirExpr(java.lang.String dirName)
Creates a __DIR__ expression.
|
Expr |
createDiv(Expr left,
Expr right)
Creates a division expression.
|
Statement |
createDo(Location loc,
Expr test,
Statement block,
java.lang.String label)
Creates a do-while statement
|
Expr |
createEach(Expr expr)
Creates an each expression.
|
Statement |
createEcho(Location loc,
Expr expr)
Creates an echo statement
|
Expr |
createEmpty(Location location,
Expr expr)
Creates an empty() expression.
|
Expr |
createEq(Expr left,
Expr right)
Creates an eq expression.
|
Expr |
createEquals(Expr left,
Expr right)
Creates an equals expression.
|
Expr |
createExit(Expr expr)
Creates an exit 'exit("msg")' expression.
|
Statement |
createExpr(Location loc,
Expr expr)
Creates an expr statement
|
Expr |
createFieldGet(Expr base,
StringValue name)
Creates an object get '$a->b' expression.
|
Expr |
createFieldVarGet(Expr base,
Expr name)
Creates an object get '$a->$b' expression.
|
ConstFileExpr |
createFileNameExpr(java.lang.String fileName)
Creates a __FILE__ expression.
|
Statement |
createFor(Location loc,
Expr init,
Expr test,
Expr incr,
Statement block,
java.lang.String label)
Creates a for statement
|
Statement |
createForeach(Location loc,
Expr objExpr,
AbstractVarExpr key,
AbstractVarExpr value,
boolean isRef,
Statement block,
java.lang.String label)
Creates a foreach statement
|
Function |
createFunction(Location loc,
java.lang.String name,
FunctionInfo info,
Arg[] argList,
Statement[] statementList)
Creates a new function definition.
|
Statement |
createFunctionDef(Location loc,
Function fun)
Creates a new function definition def.
|
FunctionInfo |
createFunctionInfo(QuercusContext quercus,
ClassDef classDef,
java.lang.String name)
Creates a new FunctionInfo
|
Expr |
createGeq(Expr left,
Expr right)
Creates a geq expression.
|
Statement |
createGlobal(Location loc,
VarExpr var)
Creates a global statement
|
Expr |
createGt(Expr left,
Expr right)
Creates a gt expression.
|
Statement |
createIf(Location loc,
Expr test,
Statement trueBlock,
Statement falseBlock)
Creates an if statement
|
Expr |
createImport(Location loc,
java.lang.String name,
boolean isWildcard)
Creates a Quercus class import.
|
Expr |
createInclude(Location loc,
Path source,
Expr expr)
Creates an include expr
|
Expr |
createIncludeOnce(Location loc,
Path source,
Expr expr)
Creates an include expr
|
Expr |
createInstanceOf(Expr expr,
java.lang.String name)
Creates an instanceof expression.
|
Expr |
createInstanceOfVar(Expr expr,
Expr name)
Creates an instanceof expression.
|
Expr |
createLeftShift(Expr left,
Expr right)
Creates a left-shift expression.
|
Expr |
createLeq(Expr left,
Expr right)
Creates a leq expression.
|
Expr |
createList(ListHeadExpr head,
Expr value)
Creates a list expression.
|
Expr |
createList(QuercusParser parser,
ListHeadExpr head,
Expr value)
Creates a list expression.
|
Expr |
createListEach(ListHeadExpr head,
Expr value)
Creates a list expression.
|
ListHeadExpr |
createListHead(java.util.ArrayList<Expr> keys)
Creates a list expression.
|
Expr |
createLiteral(Value literal)
Creates a string literal expression.
|
Expr |
createLong(long value)
Creates a long literal expression.
|
Expr |
createLt(Expr left,
Expr right)
Creates a lt expression.
|
Expr |
createMethodCall(Location loc,
Expr objExpr,
Expr methodName,
java.util.ArrayList<Expr> args)
Creates a variable method call $a->${"foo"}(...).
|
Expr |
createMethodCall(Location loc,
Expr objExpr,
StringValue methodName,
java.util.ArrayList<Expr> args)
Creates a method call $a->foo(...).
|
Function |
createMethodDeclaration(Location loc,
InterpretedClassDef cl,
java.lang.String name,
FunctionInfo info,
Arg[] argList)
Creates a new object method definition.
|
Expr |
createMinus(Expr expr)
Creates a unary minus '-a' expression.
|
Expr |
createMod(Expr left,
Expr right)
Creates a modulo expression.
|
Expr |
createMul(Expr left,
Expr right)
Creates a multiplication expression.
|
Expr |
createNeq(Expr left,
Expr right)
Creates a neq expression.
|
ObjectNewExpr |
createNew(Location loc,
java.lang.String name,
java.util.ArrayList<Expr> args)
Creates a new function call new foo(...).
|
ObjectNewStaticExpr |
createNewStatic(Location loc,
java.util.ArrayList<Expr> args)
Creates a new function call new static(...).
|
Expr |
createNot(Expr expr)
Creates a unary not '!a' expression.
|
Expr |
createNull()
Creates a null literal expression.
|
Statement |
createNullStatement()
Creates a null literal expression.
|
Function |
createObjectMethod(Location loc,
InterpretedClassDef cl,
java.lang.String name,
FunctionInfo info,
Arg[] argList,
Statement[] statementList)
Creates a new object method definition.
|
Expr |
createOr(Expr left,
Expr right)
Creates an or expression.
|
Expr |
createPlus(Expr expr)
Creates a unary plus '+a' expression.
|
UnaryPostIncrementExpr |
createPostIncrement(Expr expr,
int incr)
Creates a post increment 'a++' expression.
|
UnaryPreIncrementExpr |
createPreIncrement(Expr expr,
int incr)
Creates a pre increment '++a' expression.
|
UnaryRefExpr |
createRef(Expr base)
Creates a ref '&$a' expression.
|
Expr |
createRequire(Location loc,
Path source,
Expr expr)
Creates an include expr
|
Expr |
createRequired()
Creates a required
|
Expr |
createRequireOnce(Location loc,
Path source,
Expr expr)
Creates an include expr
|
Statement |
createReturn(Location loc,
Expr value)
Creates a return statement
|
Statement |
createReturnRef(Location loc,
Expr value)
Creates a return ref statement
|
Expr |
createRightShift(Expr left,
Expr right)
Creates a right-shift expression.
|
Expr |
createShortConditional(Expr test,
Expr right)
Creates an conditional expression.
|
Statement |
createStatic(Location loc,
StringValue uniqueStaticName,
VarExpr var,
Expr value)
Creates a static statement
|
Expr |
createString(StringValue lexeme)
Creates a string (php5) literal expression.
|
Expr |
createSub(Expr left,
Expr right)
Creates a subtraction expression.
|
Expr |
createSuppress(Expr expr)
Creates an error suppression '@a' expression.
|
Statement |
createSwitch(Location loc,
Expr value,
java.util.ArrayList<Expr[]> caseList,
java.util.ArrayList<BlockStatement> blockList,
Statement defaultBlock,
java.lang.String label)
Creates a switch statement
|
Statement |
createText(Location loc,
StringValue text)
Creates a text statement
|
ThisExpr |
createThis(InterpretedClassDef cl)
Creates a this expression.
|
ThisFieldVarExpr |
createThisField(Location location,
ThisExpr qThis,
Expr name)
Creates a "$this->$foo" expression.
|
ThisFieldExpr |
createThisField(Location location,
ThisExpr qThis,
StringValue name)
Creates a "$this->foo" expression.
|
Expr |
createThisMethod(Location loc,
ThisExpr qThis,
Expr methodName,
java.util.ArrayList<Expr> args)
Creates a $this method call $this->foo(...).
|
Expr |
createThisMethod(Location loc,
ThisExpr qThis,
StringValue methodName,
java.util.ArrayList<Expr> args)
Creates a $this method call $this->foo(...).
|
Statement |
createThrow(Location loc,
Expr value)
Creates a throw statement
|
Expr |
createToArray(Expr expr)
Creates an array cast
|
Expr |
createToBinary(Expr expr)
Creates a binary string cast
|
Expr |
createToBoolean(Expr expr)
Creates a boolean cast
|
Expr |
createToDouble(Expr expr)
Creates a double cast
|
Expr |
createToLong(Expr expr)
Creates a long cast
|
Expr |
createToObject(Expr expr)
Creates an object cast
|
Expr |
createToString(Expr expr)
Creates a string cast
|
Expr |
createToUnicode(Expr expr)
Creates a unicode cast
|
TraitParentClassConstExpr |
createTraitParentClassConst(java.lang.String traitName,
StringValue name)
Creates a parent const expression.
|
Expr |
createTraitParentClassMethodCall(Location loc,
java.lang.String traitName,
StringValue methodName,
java.util.ArrayList<Expr> args)
Creates a parent class method call parent::foo(...)
|
TryStatement |
createTry(Location loc,
Statement block)
Creates a try statement
|
Expr |
createUnicode(UnicodeValue lexeme)
Creates a string literal expression.
|
Expr |
createUnsetVar(AbstractVarExpr var)
Creates an unset '$a' expression.
|
VarExpr |
createVar(VarInfo var)
Creates a var expression.
|
CallVarExpr |
createVarFunction(Location loc,
Expr name,
java.util.ArrayList<Expr> args)
Creates a new var function call.
|
Statement |
createVarGlobal(Location loc,
VarVarExpr var)
Creates a global var statement
|
ObjectNewVarExpr |
createVarNew(Location loc,
Expr name,
java.util.ArrayList<Expr> args)
Creates a new function call.
|
VarVarExpr |
createVarVar(Expr var)
Creates a var expression.
|
Statement |
createWhile(Location loc,
Expr test,
Statement block,
java.lang.String label)
Creates a while statement
|
Expr |
createXor(Expr left,
Expr right)
Creates an xor expression.
|
public static ExprFactory create()
public Expr createNull()
public Expr createString(StringValue lexeme)
public Expr createUnicode(UnicodeValue lexeme)
public Expr createBinary(BinaryValue value)
public Expr createLong(long value)
public VarVarExpr createVarVar(Expr var)
public ConstFileExpr createFileNameExpr(java.lang.String fileName)
public ConstDirExpr createDirExpr(java.lang.String dirName)
public ConstClassExpr createClassExpr(Location location, StringValue funName)
public ConstExpr createConst(java.lang.String name)
public ArrayGetExpr createArrayGet(Location location, Expr base, Expr index)
location
- public ArrayTailExpr createArrayTail(Location location, Expr base)
location
- TODOpublic Expr createFieldGet(Expr base, StringValue name)
public Expr createFieldVarGet(Expr base, Expr name)
public ThisExpr createThis(InterpretedClassDef cl)
public ThisFieldExpr createThisField(Location location, ThisExpr qThis, StringValue name)
public ThisFieldVarExpr createThisField(Location location, ThisExpr qThis, Expr name)
public Expr createThisMethod(Location loc, ThisExpr qThis, StringValue methodName, java.util.ArrayList<Expr> args)
public Expr createThisMethod(Location loc, ThisExpr qThis, Expr methodName, java.util.ArrayList<Expr> args)
public ClassConstExpr createClassConst(java.lang.String className, StringValue name)
public TraitParentClassConstExpr createTraitParentClassConst(java.lang.String traitName, StringValue name)
public ClassVarNameConstExpr createClassConst(java.lang.String className, Expr name)
public Expr createClassConst(Expr className, StringValue name)
public Expr createClassConst(Expr className, Expr name)
public ClassVirtualConstExpr createClassVirtualConst(StringValue name)
public ClassVarNameVirtualConstExpr createClassVirtualConst(Expr name)
public Expr createClassField(java.lang.String className, StringValue name)
public Expr createClassField(Expr className, StringValue name)
public Expr createClassVirtualField(StringValue name)
public Expr createClassField(java.lang.String className, Expr name)
public Expr createClassField(Expr className, Expr name)
public Expr createClassVirtualField(Expr name)
public Expr createUnsetVar(AbstractVarExpr var)
public BinaryCharAtExpr createCharAt(Expr base, Expr index)
public UnaryPostIncrementExpr createPostIncrement(Expr expr, int incr)
public UnaryPreIncrementExpr createPreIncrement(Expr expr, int incr)
public Expr createRequired()
public Expr createDefault()
public Expr createRightShift(Expr left, Expr right)
protected BinaryAppendExpr createAppendImpl(Expr left, BinaryAppendExpr right)
public Expr createAssign(AbstractVarExpr left, Expr right)
public Expr createAssignRef(AbstractVarExpr left, Expr right)
public UnaryRefExpr createRef(Expr base)
public Expr createInstanceOf(Expr expr, java.lang.String name)
public Expr createInstanceOfVar(Expr expr, Expr name)
public final Expr createList(QuercusParser parser, ListHeadExpr head, Expr value)
public ListHeadExpr createListHead(java.util.ArrayList<Expr> keys)
public Expr createList(ListHeadExpr head, Expr value)
public Expr createListEach(ListHeadExpr head, Expr value)
public Expr createConditional(Expr test, Expr left, Expr right)
public Expr createShortConditional(Expr test, Expr right)
public Expr createArrayFun(java.util.ArrayList<Expr> keys, java.util.ArrayList<Expr> values)
public Expr createCall(QuercusParser parser, StringValue name, java.util.ArrayList<Expr> args)
public CallVarExpr createVarFunction(Location loc, Expr name, java.util.ArrayList<Expr> args)
public ClosureExpr createClosure(Location loc, Function fun, java.util.ArrayList<VarExpr> useArgs, boolean isInClassScope)
public Expr createMethodCall(Location loc, Expr objExpr, StringValue methodName, java.util.ArrayList<Expr> args)
public Expr createMethodCall(Location loc, Expr objExpr, Expr methodName, java.util.ArrayList<Expr> args)
public Expr createClassMethodCall(Location loc, java.lang.String className, StringValue methodName, java.util.ArrayList<Expr> args)
public Expr createTraitParentClassMethodCall(Location loc, java.lang.String traitName, StringValue methodName, java.util.ArrayList<Expr> args)
public Expr createClassMethodCall(Location loc, Expr className, StringValue methodName, java.util.ArrayList<Expr> args)
public Expr createClassVirtualMethodCall(Location loc, StringValue methodName, java.util.ArrayList<Expr> args)
public Expr createClassMethodCall(Location loc, java.lang.String className, Expr methodName, java.util.ArrayList<Expr> args)
public Expr createClassMethodCall(Location loc, Expr className, Expr methodName, java.util.ArrayList<Expr> args)
public Expr createClassVirtualMethodCall(Location loc, Expr var, java.util.ArrayList<Expr> args)
public Expr createClassConstructor(Location loc, java.lang.String className, StringValue methodName, java.util.ArrayList<Expr> args)
public ObjectNewExpr createNew(Location loc, java.lang.String name, java.util.ArrayList<Expr> args)
public ObjectNewVarExpr createVarNew(Location loc, Expr name, java.util.ArrayList<Expr> args)
public ObjectNewStaticExpr createNewStatic(Location loc, java.util.ArrayList<Expr> args)
public Expr createInclude(Location loc, Path source, Expr expr)
public Expr createRequire(Location loc, Path source, Expr expr)
public Expr createIncludeOnce(Location loc, Path source, Expr expr)
public Expr createRequireOnce(Location loc, Path source, Expr expr)
public Expr createImport(Location loc, java.lang.String name, boolean isWildcard)
public Statement createNullStatement()
public final Statement createBlock(Location loc, java.util.ArrayList<Statement> statementList)
public final BlockStatement createBlockImpl(Location loc, java.util.ArrayList<Statement> statementList)
public BlockStatement createBlockImpl(Location loc, Statement[] statements)
public Statement createText(Location loc, StringValue text)
public Statement createIf(Location loc, Expr test, Statement trueBlock, Statement falseBlock)
public Statement createSwitch(Location loc, Expr value, java.util.ArrayList<Expr[]> caseList, java.util.ArrayList<BlockStatement> blockList, Statement defaultBlock, java.lang.String label)
public Statement createFor(Location loc, Expr init, Expr test, Expr incr, Statement block, java.lang.String label)
public Statement createForeach(Location loc, Expr objExpr, AbstractVarExpr key, AbstractVarExpr value, boolean isRef, Statement block, java.lang.String label)
public Statement createWhile(Location loc, Expr test, Statement block, java.lang.String label)
public Statement createDo(Location loc, Expr test, Statement block, java.lang.String label)
public BreakStatement createBreak(Location location, Expr target, java.util.ArrayList<java.lang.String> loopLabelList)
public ContinueStatement createContinue(Location location, Expr target, java.util.ArrayList<java.lang.String> loopLabelList)
public Statement createVarGlobal(Location loc, VarVarExpr var)
public Statement createClassStatic(Location loc, StringValue staticName, VarExpr var, Expr value)
public Statement createStatic(Location loc, StringValue uniqueStaticName, VarExpr var, Expr value)
public Statement createClosureStatic(Location loc, VarExpr var, Expr value)
public TryStatement createTry(Location loc, Statement block)
public Statement createReturnRef(Location loc, Expr value)
public Statement createFunctionDef(Location loc, Function fun)
public Statement createClassDef(Location loc, InterpretedClassDef cl)
public FunctionInfo createFunctionInfo(QuercusContext quercus, ClassDef classDef, java.lang.String name)
public Function createFunction(Location loc, java.lang.String name, FunctionInfo info, Arg[] argList, Statement[] statementList)
public Function createObjectMethod(Location loc, InterpretedClassDef cl, java.lang.String name, FunctionInfo info, Arg[] argList, Statement[] statementList)
public Function createMethodDeclaration(Location loc, InterpretedClassDef cl, java.lang.String name, FunctionInfo info, Arg[] argList)
public InterpretedClassDef createClassDef(Location location, java.lang.String name, java.lang.String parentName, java.lang.String[] ifaceList, int index)