| java.lang.Object pnuts.compiler.ScopeAnalyzer pnuts.compiler.Preprocessor
Preprocessor | class Preprocessor extends ScopeAnalyzer (Code) | | Preprocessor
This visitor translates AST to a modified AST, so that
function calls could be done faster, by resolving the
function outside a loop;
The translation occurs when:
(1) the call is in a local scope (in a function)
(2) the call is in a loop (while, for, or foreach) or a nested function
e.g. before:
function foo(){
for (i = 0; i < 100; i++){
println("hello")
}
}
after:
function foo(){
println = println
for (i = 0; i < 100; i++){
println("hello")
}
}
|
Methods inherited from pnuts.compiler.ScopeAnalyzer | void acceptChildren(SimpleNode node, Context context)(Code)(Java Doc) public Object addNode(SimpleNode node, Context context)(Code)(Java Doc) public void analyze(Reader reader) throws ParseException, IOException(Code)(Java Doc) public void analyze(PnutsParser parser) throws ParseException, IOException(Code)(Java Doc) public void analyze(SimpleNode node)(Code)(Java Doc) public Object andNode(SimpleNode node, Context context)(Code)(Java Doc) public Object applicationNode(SimpleNode node, Context context)(Code)(Java Doc) public Object arrayType(SimpleNode node, Context context)(Code)(Java Doc) void assignId(SimpleNode lhs, Context context)(Code)(Java Doc) public Object assignment(SimpleNode node, Context context)(Code)(Java Doc) public Object assignmentAA(SimpleNode node, Context context)(Code)(Java Doc) public Object assignmentDA(SimpleNode node, Context context)(Code)(Java Doc) public Object assignmentEA(SimpleNode node, Context context)(Code)(Java Doc) public Object assignmentLA(SimpleNode node, Context context)(Code)(Java Doc) public Object assignmentMA(SimpleNode node, Context context)(Code)(Java Doc) public Object assignmentOA(SimpleNode node, Context context)(Code)(Java Doc) public Object assignmentPA(SimpleNode node, Context context)(Code)(Java Doc) public Object assignmentRA(SimpleNode node, Context context)(Code)(Java Doc) public Object assignmentRAA(SimpleNode node, Context context)(Code)(Java Doc) public Object assignmentSA(SimpleNode node, Context context)(Code)(Java Doc) public Object assignmentTA(SimpleNode node, Context context)(Code)(Java Doc) public Object beanDef(SimpleNode node, Context context)(Code)(Java Doc) public Object blockNode(SimpleNode node, Context context)(Code)(Java Doc) public Object breakNode(SimpleNode node, Context context)(Code)(Java Doc) public Object castExpression(SimpleNode node, Context context)(Code)(Java Doc) public Object catchBlock(SimpleNode node, Context context)(Code)(Java Doc) public Object catchNode(SimpleNode node, Context context)(Code)(Java Doc) public Object characterNode(SimpleNode node, Context context)(Code)(Java Doc) public Object classDef(SimpleNode node, Context context)(Code)(Java Doc) public Object classDefBody(SimpleNode node, Context context)(Code)(Java Doc) public Object className(SimpleNode node, Context context)(Code)(Java Doc) public Object classNode(SimpleNode node, Context context)(Code)(Java Doc) public Object classScript(SimpleNode node, Context context)(Code)(Java Doc) public Object continueNode(SimpleNode node, Context context)(Code)(Java Doc) protected void declared(SimpleNode node, Context context, String symbol)(Code)(Java Doc) public Object divideNode(SimpleNode node, Context context)(Code)(Java Doc) public Object doStatement(SimpleNode node, Context context)(Code)(Java Doc) public Object equalNode(SimpleNode node, Context context)(Code)(Java Doc) public Object expressionList(SimpleNode node, Context context)(Code)(Java Doc) public Object falseNode(SimpleNode node, Context context)(Code)(Java Doc) public Object finallyBlock(SimpleNode node, Context context)(Code)(Java Doc) public Object finallyNode(SimpleNode node, Context context)(Code)(Java Doc) public Object floatingNode(SimpleNode node, Context context)(Code)(Java Doc) public Object forStatement(SimpleNode node, Context context)(Code)(Java Doc) public Object foreachStatement(SimpleNode node, Context context)(Code)(Java Doc) public Object functionStatement(SimpleNode node, Context context)(Code)(Java Doc) public Object geNode(SimpleNode node, Context context)(Code)(Java Doc) public Object global(SimpleNode node, Context context)(Code)(Java Doc) public Object gtNode(SimpleNode node, Context context)(Code)(Java Doc) protected void handleFreeVariable(SimpleNode node, Context context)(Code)(Java Doc) protected void handleLocalVariable(SimpleNode node, Context context)(Code)(Java Doc) public Object idNode(SimpleNode node, Context context)(Code)(Java Doc) public Object ifStatement(SimpleNode node, Context context)(Code)(Java Doc) public Object importNode(SimpleNode node, Context context)(Code)(Java Doc) public Object indexNode(SimpleNode node, Context context)(Code)(Java Doc) public Object instanceofExpression(SimpleNode node, Context context)(Code)(Java Doc) public Object integerNode(SimpleNode node, Context context)(Code)(Java Doc) protected boolean isTargetIdNode(SimpleNode node, Context context)(Code)(Java Doc) public Object leNode(SimpleNode node, Context context)(Code)(Java Doc) public Object listElements(SimpleNode node, Context context)(Code)(Java Doc) public Object logAndNode(SimpleNode node, Context context)(Code)(Java Doc) public Object logNotNode(SimpleNode node, Context context)(Code)(Java Doc) public Object logOrNode(SimpleNode node, Context context)(Code)(Java Doc) public Object ltNode(SimpleNode node, Context context)(Code)(Java Doc) public static void main(String[] args) throws Exception(Code)(Java Doc) public Object mapNode(SimpleNode node, Context context)(Code)(Java Doc) public Object memberNode(SimpleNode node, Context context)(Code)(Java Doc) public Object methodDef(SimpleNode node, Context context)(Code)(Java Doc) public Object methodNode(SimpleNode node, Context context)(Code)(Java Doc) public Object modNode(SimpleNode node, Context context)(Code)(Java Doc) public Object multNode(SimpleNode node, Context context)(Code)(Java Doc) public Object negativeNode(SimpleNode node, Context context)(Code)(Java Doc) public Object newNode(SimpleNode node, Context context)(Code)(Java Doc) public Object notEqNode(SimpleNode node, Context context)(Code)(Java Doc) public Object notNode(SimpleNode node, Context context)(Code)(Java Doc) public Object nullNode(SimpleNode node, Context context)(Code)(Java Doc) public Object orNode(SimpleNode node, Context context)(Code)(Java Doc) public Object packageNode(SimpleNode node, Context context)(Code)(Java Doc) public Object postDecrNode(SimpleNode node, Context context)(Code)(Java Doc) public Object postIncrNode(SimpleNode node, Context context)(Code)(Java Doc) public Object preDecrNode(SimpleNode node, Context context)(Code)(Java Doc) public Object preIncrNode(SimpleNode node, Context context)(Code)(Java Doc) public Object primitiveNode(SimpleNode node, Context context)(Code)(Java Doc) public Object rangeNode(SimpleNode node, Context context)(Code)(Java Doc) public Object returnNode(SimpleNode node, Context context)(Code)(Java Doc) public Object shiftArithmeticNode(SimpleNode node, Context context)(Code)(Java Doc) public Object shiftLeftNode(SimpleNode node, Context context)(Code)(Java Doc) public Object shiftRightNode(SimpleNode node, Context context)(Code)(Java Doc) public Object start(SimpleNode node, Context context)(Code)(Java Doc) public Object startSet(SimpleNode node, Context context)(Code)(Java Doc) public Object staticMemberNode(SimpleNode node, Context context)(Code)(Java Doc) public Object staticMethodNode(SimpleNode node, Context context)(Code)(Java Doc) public Object stringNode(SimpleNode node, Context context)(Code)(Java Doc) public Object subtractNode(SimpleNode node, Context context)(Code)(Java Doc) public Object switchBlock(SimpleNode node, Context context)(Code)(Java Doc) public Object switchStatement(SimpleNode node, Context context)(Code)(Java Doc) public Object ternary(SimpleNode node, Context context)(Code)(Java Doc) public Object throwNode(SimpleNode node, Context context)(Code)(Java Doc) public Object trueNode(SimpleNode node, Context context)(Code)(Java Doc) public Object tryStatement(SimpleNode node, Context context)(Code)(Java Doc) public Object whileStatement(SimpleNode node, Context context)(Code)(Java Doc) public Object xorNode(SimpleNode node, Context context)(Code)(Java Doc) public Object yieldNode(SimpleNode node, Context context)(Code)(Java Doc)
|
|
|