Example #1
0
 public void visit(VariableSymbol n)
 {
     throw new NotImplementedException();
 }
 public override void visit(VarDeclaration n)
 {
     Table scope = n.Scope;
     VariableSymbol sym = new VariableSymbol(n.Name.Name, n.Type);
     if (n.Type == null)
         sym.Type = n.TypeByAssignment.RHS.accept(new TypeVisitor());
     scope.Insert(sym);
 }
Example #3
0
 public void Insert(VariableSymbol n)
 {
     n.StackLocation = GetStackSize() + 1;
     dictionary.Add(Tuple.Create<string, List<ASTType>>(n.Name, null), n);
 }
 public virtual void visit(VariableSymbol n)
 {
     // Do nothing; leave the implementation to the main class
 }
 public ASTType visit(VariableSymbol n)
 {
     return n.Type;
 }