@Override
 public void visitMethodInvocation(MethodInvocation methodInvocation) {
   for (ExpressionStatement statement : methodInvocation.getArguments()) {
     statement.accept(this);
   }
   for (FunctionInvocation invocation : methodInvocation.getAnonymousFunctionInvocations()) {
     invocation.accept(this);
   }
 }
コード例 #2
0
ファイル: IrTreeDumper.java プロジェクト: ncardozo/congolo
 @Override
 public void visitCollectionLiteral(CollectionLiteral collectionLiteral) {
   incr();
   space();
   System.out.println("Collection literal of type: " + collectionLiteral.getType());
   for (ExpressionStatement statement : collectionLiteral.getExpressions()) {
     statement.accept(this);
   }
   decr();
 }
コード例 #3
0
ファイル: IrTreeDumper.java プロジェクト: ncardozo/congolo
 @Override
 public void visitMethodInvocation(MethodInvocation methodInvocation) {
   incr();
   space();
   System.out.println(
       "Method invocation: "
           + methodInvocation.getName()
           + ", null safe? -> "
           + methodInvocation.isNullSafeGuarded());
   for (ExpressionStatement argument : methodInvocation.getArguments()) {
     argument.accept(this);
   }
   for (FunctionInvocation invocation : methodInvocation.getAnonymousFunctionInvocations()) {
     invocation.accept(this);
   }
   decr();
 }
 @Override
 public void visitFunctionInvocation(FunctionInvocation functionInvocation) {
   if (context() != null) {
     Context context = context();
     String name = functionInvocation.getName();
     if (context.allReferences.contains(name)) {
       accessed(name);
       if (context.referenceTableStack.peek().get(name).isModuleState()) {
         functionInvocation.setOnModuleState(true);
       } else {
         functionInvocation.setOnReference(true);
       }
     }
   }
   for (ExpressionStatement statement : functionInvocation.getArguments()) {
     statement.accept(this);
   }
   for (FunctionInvocation invocation : functionInvocation.getAnonymousFunctionInvocations()) {
     invocation.accept(this);
   }
 }
コード例 #5
0
ファイル: IrTreeDumper.java プロジェクト: ncardozo/congolo
 @Override
 public void visitFunctionInvocation(FunctionInvocation functionInvocation) {
   incr();
   space();
   System.out.println(
       "Function call: "
           + functionInvocation.getName()
           + ", on reference? -> "
           + functionInvocation.isOnReference()
           + ", on module state? -> "
           + functionInvocation.isOnModuleState()
           + ", anonymous? -> "
           + functionInvocation.isAnonymous());
   for (ExpressionStatement argument : functionInvocation.getArguments()) {
     space();
     argument.accept(this);
   }
   for (FunctionInvocation invocation : functionInvocation.getAnonymousFunctionInvocations()) {
     invocation.accept(this);
   }
   decr();
 }
コード例 #6
0
ファイル: UnaryOperation.java プロジェクト: k33g/golo-lang
 @Override
 public void walk(GoloIrVisitor visitor) {
   expressionStatement.accept(visitor);
 }
 @Override
 public void visitCollectionLiteral(CollectionLiteral collectionLiteral) {
   for (ExpressionStatement statement : collectionLiteral.getExpressions()) {
     statement.accept(this);
   }
 }