public override void Visit(FunctionArgumentNode node)
 {
     if (SymbolTable.Retrieve(node.ID) is null)
     {
         if (node.Type == "tensor")
         {
             throw new Exception("Functions cannot take tensors as parameters.");
         }
         SymbolTable.Insert(node.ID, node.Type, false);
     }
     else
     {
         throw new VariableAlreadyDeclaredException(
                   $"The variable \"{node.ID}\" has already been declared. And would hide the variable in the parent scope if declared inside the function.");
     }
 }
Beispiel #2
0
 public override void Visit(FunctionArgumentNode node)
 {
     i += 2;
     Console.WriteLine(node.Type + " " + node.ID);
     i -= 2;
 }
Beispiel #3
0
 public virtual void Visit(FunctionArgumentNode node)
 {
     VisitChildren(node);
 }