@Override
 public void visitMethodInvocation(MethodInvocation methodInvocation) {
   for (ExpressionStatement statement : methodInvocation.getArguments()) {
     statement.accept(this);
   }
   for (FunctionInvocation invocation : methodInvocation.getAnonymousFunctionInvocations()) {
     invocation.accept(this);
   }
 }
Example #2
0
 @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();
 }
Example #3
0
 @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);
   }
 }
Example #5
0
 @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();
 }
Example #6
0
 @Override
 public void walk(GoloIrVisitor visitor) {
   expressionStatement.accept(visitor);
 }
 @Override
 public void visitCollectionLiteral(CollectionLiteral collectionLiteral) {
   for (ExpressionStatement statement : collectionLiteral.getExpressions()) {
     statement.accept(this);
   }
 }