Constructor and Description |
---|
IRFactory(TokenStream ts) |
Modifier and Type | Method and Description |
---|---|
void |
addChildToBack(Object parent,
Object child)
Add a child to the back of the given node.
|
Object |
createArrayLiteral(Object obj)
Array Literal
|
Object |
createAssignment(int nodeOp,
Node left,
Node right,
Class convert,
boolean postfix) |
Object |
createBinary(int nodeType,
int nodeOp,
Object left,
Object right) |
Object |
createBinary(int nodeType,
Object left,
Object right)
Binary
|
Object |
createBlock(int lineno)
Statement block
Creates the empty statement block
Must make subsequent calls to add statements to the node
|
Object |
createBreak(String label,
int lineno)
Break (possibly labeled)
|
Object |
createCatch(String varName,
Object catchCond,
Object stmts,
int lineno)
Catch clause of try/catch/finally
|
Object |
createContinue(String label,
int lineno)
Continue (possibly labeled)
|
Object |
createDebugger(int lineno)
debugger
|
Object |
createDoWhile(Object body,
Object cond,
int lineno)
DoWhile
|
Object |
createExprStatement(Object expr,
int lineno) |
Object |
createFor(Object init,
Object test,
Object incr,
Object body,
int lineno)
For
|
Object |
createForIn(Object lhs,
Object obj,
Object body,
int lineno)
For ..
|
Object |
createFunction(String name,
Object args,
Object statements,
String sourceName,
int baseLineno,
int endLineno,
Object source,
boolean isExpr) |
Object |
createIf(Object cond,
Object ifTrue,
Object ifFalse,
int lineno)
If statement
|
Object |
createLabel(String label,
int lineno)
Label
|
Object |
createLeaf(int nodeType)
Leaf
|
Object |
createLeaf(int nodeType,
int nodeOp) |
Object |
createName(String name)
Name
|
Object |
createNumber(double number)
Number (for literals)
|
Object |
createObjectLiteral(Object obj)
Object Literals
|
Object |
createRegExp(String string,
String flags)
Regular expressions
|
Object |
createReturn(Object expr,
int lineno)
Return
|
Object |
createScript(Object body,
String sourceName,
int baseLineno,
int endLineno,
Object source)
Script (for associating file/url names with toplevel scripts.)
|
Object |
createString(String string)
String (for literals)
|
Object |
createSwitch(int lineno)
Statement leaf nodes.
|
Object |
createTernary(Object cond,
Object ifTrue,
Object ifFalse) |
Object |
createThrow(Object expr,
int lineno)
Throw
|
Object |
createTryCatchFinally(Object tryblock,
Object catchblocks,
Object finallyblock,
int lineno)
Try/Catch/Finally
|
Object |
createUnary(int nodeType,
int nodeOp,
Object child) |
Object |
createUnary(int nodeType,
Object child)
Unary
|
Object |
createVariables(int lineno) |
Object |
createWhile(Object cond,
Object body,
int lineno)
While
|
Object |
createWith(Object obj,
Object body,
int lineno)
With
|
int |
getLeafType(Object leaf) |
static boolean |
hasSideEffects(Node exprTree) |
public IRFactory(TokenStream ts)
public Object createScript(Object body, String sourceName, int baseLineno, int endLineno, Object source)
public Object createLeaf(int nodeType)
public Object createLeaf(int nodeType, int nodeOp)
public int getLeafType(Object leaf)
public Object createSwitch(int lineno)
public Object createVariables(int lineno)
public Object createNumber(double number)
public Object createCatch(String varName, Object catchCond, Object stmts, int lineno)
varName
- the name of the variable to bind to the exceptioncatchCond
- the condition under which to catch the exception.
May be null if no condition is given.stmts
- the statements in the catch clauselineno
- the starting line number of the catch clausepublic Object createDebugger(int lineno)
public Object createBlock(int lineno)
public Object createFunction(String name, Object args, Object statements, String sourceName, int baseLineno, int endLineno, Object source, boolean isExpr)
public void addChildToBack(Object parent, Object child)
public Object createFor(Object init, Object test, Object incr, Object body, int lineno)
public Object createTryCatchFinally(Object tryblock, Object catchblocks, Object finallyblock, int lineno)
public Object createIf(Object cond, Object ifTrue, Object ifFalse, int lineno)
public Object createAssignment(int nodeOp, Node left, Node right, Class convert, boolean postfix)
public static boolean hasSideEffects(Node exprTree)
Copyright © 2018. All rights reserved.