Пример #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);
 }
Пример #3
0
 public void Insert(VariableSymbol n)
 {
     n.StackLocation = GetStackSize() + 1;
     dictionary.Add(Tuple.Create<string, List<ASTType>>(n.Name, null), n);
 }
Пример #4
0
 public virtual void visit(VariableSymbol n)
 {
     // Do nothing; leave the implementation to the main class
 }
Пример #5
0
 public ASTType visit(VariableSymbol n)
 {
     return n.Type;
 }