// Path: src/main/java/com/pidanic/saral/domain/CalledArgument.java
// public class CalledArgument {
//     private final String name;
// 
//     public CalledArgument(String name) {
//         this.name = name;
//     }
// 
//     public String getName() {
//         return name;
//     }
// }
// 
// Path: src/main/java/com/pidanic/saral/exception/VariableNotFound.java
// public class VariableNotFound extends RuntimeException {
//     public VariableNotFound(Scope scope, String varName) {
//         super("No local variable found for name " + varName + " found in scope " + scope);
//     }
// }
// 
// Path: src/main/java/com/pidanic/saral/scope/LocalVariable.java
// public class LocalVariable {
// 
//     public static final String SYSTEM_IN = "SYSTEM_IN";
// 
//     private final String name;
//     private final Type type;
//     private boolean initialized;
//     private boolean constant;
// 
//     public LocalVariable(String name, Type type, boolean initialized) {
//         this(name, type, initialized, false);
//     }
// 
//     LocalVariable(String name, Type type, boolean initialized, boolean constant) {
//         this.name = name;
//         this.type = type;
//         this.initialized = initialized;
//         this.constant = constant;
//     }
// 
//     public Type type() {
//         return type;
//     }
// 
//     public String name() {
//         return name;
//     }
// 
//     public boolean isInitialized() {
//         return initialized;
//     }
// 
//     LocalVariable initialize() {
//         return new LocalVariable(name(), type(), true, isConstant());
//     }
// 
//     public boolean isConstant() {
//         return constant;
//     }
// }
// 
// Path: src/main/java/com/pidanic/saral/exception/VariableNotInitialized.java
// public class VariableNotInitialized extends RuntimeException {
//     public VariableNotInitialized(Scope scope, String varName) {
//         super("Variable " + varName + " is not initialized in scope " + scope);
//     }
// }
// 
// Path: src/main/java/com/pidanic/saral/scope/Scope.java
// public class Scope {
// 
//     private static final LocalVariable EMPTY = new LocalVariable("empty", BuiltInType.BOOLEAN, true);
// 
//     private List<LocalVariable> localVariables;
//     private List<Function> functions;
//     private String className;
// 
//     public Scope(String className) {
//         localVariables = new ArrayList<>();
//         functions = new ArrayList<>();
//         this.className = className;
//     }
// 
//     public Scope(Scope scope) {
//         localVariables = new ArrayList<>(scope.localVariables);
//         functions = new ArrayList<>(scope.functions);
//         className = scope.className;
//     }
// 
//     public List<LocalVariable> getLocalVariables() {
//         return Collections.unmodifiableList(localVariables);
//     }
// 
//     public void addLocalVariable(LocalVariable localVariable) {
//         localVariables.add(localVariable);
//         if(localVariable.type() == BuiltInType.LONG || localVariable.type() == BuiltInType.DOUBLE) {
//             localVariables.add(EMPTY);
//         }
//     }
// 
//     public boolean existsLocalVariable(String variableName) {
//         return localVariables.stream().anyMatch(variable -> variable.name().equals(variableName));
//     }
// 
//     public Optional<LocalVariable> getLocalVariable(String varName) {
//         return localVariables.stream()
//                 .filter(variable -> variable.name().equals(varName))
//                 .findFirst();
//     }
// 
//     public int getLocalVariableIndex(String varName) {
//         return localVariables.stream().map(LocalVariable::name).collect(Collectors.toList()).indexOf(varName);
//     }
// 
//     public Optional<Function> getFunction(String functionName) {
//         return functions.stream().filter(proc -> proc.getName().equals(functionName))
//                 .findFirst();
//     }
// 
//     public String getClassName() {
//         return className;
//     }
// 
//     public void addFunction(Function function) {
//         this.functions.add(function);
//     }
// 
//     public LocalVariable initializeLocalVariableAtIndex(int index) {
//         LocalVariable localVariable = this.localVariables.get(index);
//         LocalVariable initializedLocalVar = localVariable.initialize();
//         this.localVariables.set(index, initializedLocalVar);
//         return initializedLocalVar;
//     }
// 
//     public LocalVariable initializeLocalVariable(String name) {
//         LocalVariable localVariable = getLocalVariable(name).get();
//         int index = getLocalVariableIndex(name);
//         LocalVariable initializedLocalVar = localVariable.initialize();
//         this.localVariables.set(index, initializedLocalVar);
//         return initializedLocalVar;
//     }
// 
//     public int localVariablesCount() {
//         return localVariables.size();
//     }
// }


import com.pidanic.saral.domain.CalledArgument;
import com.pidanic.saral.exception.VariableNotFound;
import com.pidanic.saral.scope.LocalVariable;
import com.pidanic.saral.exception.VariableNotInitialized;
import com.pidanic.saral.grammar.SaralBaseVisitor;
import com.pidanic.saral.grammar.SaralParser;
import com.pidanic.saral.scope.Scope;
import java.util.Optional;
package com.pidanic.saral.visitor;



public class CalledArgumentVisitor extends SaralBaseVisitor<CalledArgument> {

    private Scope scope;

    public CalledArgumentVisitor(Scope scope) {
        this.scope = scope;
    }

// Path: src/main/java/com/pidanic/saral/domain/CalledArgument.java
// public class CalledArgument {
//     private final String name;
// 
//     public CalledArgument(String name) {
//         this.name = name;
//     }
// 
//     public String getName() {
//         return name;
//     }
// }
// 
// Path: src/main/java/com/pidanic/saral/exception/VariableNotFound.java
// public class VariableNotFound extends RuntimeException {
//     public VariableNotFound(Scope scope, String varName) {
//         super("No local variable found for name " + varName + " found in scope " + scope);
//     }
// }
// 
// Path: src/main/java/com/pidanic/saral/scope/LocalVariable.java
// public class LocalVariable {
// 
//     public static final String SYSTEM_IN = "SYSTEM_IN";
// 
//     private final String name;
//     private final Type type;
//     private boolean initialized;
//     private boolean constant;
// 
//     public LocalVariable(String name, Type type, boolean initialized) {
//         this(name, type, initialized, false);
//     }
// 
//     LocalVariable(String name, Type type, boolean initialized, boolean constant) {
//         this.name = name;
//         this.type = type;
//         this.initialized = initialized;
//         this.constant = constant;
//     }
// 
//     public Type type() {
//         return type;
//     }
// 
//     public String name() {
//         return name;
//     }
// 
//     public boolean isInitialized() {
//         return initialized;
//     }
// 
//     LocalVariable initialize() {
//         return new LocalVariable(name(), type(), true, isConstant());
//     }
// 
//     public boolean isConstant() {
//         return constant;
//     }
// }
// 
// Path: src/main/java/com/pidanic/saral/exception/VariableNotInitialized.java
// public class VariableNotInitialized extends RuntimeException {
//     public VariableNotInitialized(Scope scope, String varName) {
//         super("Variable " + varName + " is not initialized in scope " + scope);
//     }
// }
// 
// Path: src/main/java/com/pidanic/saral/scope/Scope.java
// public class Scope {
// 
//     private static final LocalVariable EMPTY = new LocalVariable("empty", BuiltInType.BOOLEAN, true);
// 
//     private List<LocalVariable> localVariables;
//     private List<Function> functions;
//     private String className;
// 
//     public Scope(String className) {
//         localVariables = new ArrayList<>();
//         functions = new ArrayList<>();
//         this.className = className;
//     }
// 
//     public Scope(Scope scope) {
//         localVariables = new ArrayList<>(scope.localVariables);
//         functions = new ArrayList<>(scope.functions);
//         className = scope.className;
//     }
// 
//     public List<LocalVariable> getLocalVariables() {
//         return Collections.unmodifiableList(localVariables);
//     }
// 
//     public void addLocalVariable(LocalVariable localVariable) {
//         localVariables.add(localVariable);
//         if(localVariable.type() == BuiltInType.LONG || localVariable.type() == BuiltInType.DOUBLE) {
//             localVariables.add(EMPTY);
//         }
//     }
// 
//     public boolean existsLocalVariable(String variableName) {
//         return localVariables.stream().anyMatch(variable -> variable.name().equals(variableName));
//     }
// 
//     public Optional<LocalVariable> getLocalVariable(String varName) {
//         return localVariables.stream()
//                 .filter(variable -> variable.name().equals(varName))
//                 .findFirst();
//     }
// 
//     public int getLocalVariableIndex(String varName) {
//         return localVariables.stream().map(LocalVariable::name).collect(Collectors.toList()).indexOf(varName);
//     }
// 
//     public Optional<Function> getFunction(String functionName) {
//         return functions.stream().filter(proc -> proc.getName().equals(functionName))
//                 .findFirst();
//     }
// 
//     public String getClassName() {
//         return className;
//     }
// 
//     public void addFunction(Function function) {
//         this.functions.add(function);
//     }
// 
//     public LocalVariable initializeLocalVariableAtIndex(int index) {
//         LocalVariable localVariable = this.localVariables.get(index);
//         LocalVariable initializedLocalVar = localVariable.initialize();
//         this.localVariables.set(index, initializedLocalVar);
//         return initializedLocalVar;
//     }
// 
//     public LocalVariable initializeLocalVariable(String name) {
//         LocalVariable localVariable = getLocalVariable(name).get();
//         int index = getLocalVariableIndex(name);
//         LocalVariable initializedLocalVar = localVariable.initialize();
//         this.localVariables.set(index, initializedLocalVar);
//         return initializedLocalVar;
//     }
// 
//     public int localVariablesCount() {
//         return localVariables.size();
//     }
// }


// Path: src/main/java/com/pidanic/saral/visitor/CalledArgumentVisitor.java
import com.pidanic.saral.domain.CalledArgument;
import com.pidanic.saral.exception.VariableNotFound;
import com.pidanic.saral.scope.LocalVariable;
import com.pidanic.saral.exception.VariableNotInitialized;
import com.pidanic.saral.grammar.SaralBaseVisitor;
import com.pidanic.saral.grammar.SaralParser;
import com.pidanic.saral.scope.Scope;
import java.util.Optional;

package com.pidanic.saral.visitor;



public class CalledArgumentVisitor extends SaralBaseVisitor<CalledArgument> {

    private Scope scope;

    public CalledArgumentVisitor(Scope scope) {
        this.scope = scope;
    }

    @Override