Esempio n. 1
0
 /* VariableExpression perhaps ought to be called IdentifierExpression as it is used for both constants and variables. */
 public void visit(VariableExpression that)
 {
     Console.Write(that.Name);
 }
Esempio n. 2
0
 /* VariableExpression perhaps ought to be called IdentifierExpression as it is used for both constants and variables. */
 public void visit(VariableExpression that)
 {
     Declaration declaration = _symbols.Lookup(that.Name);
     if (declaration == null)
         throw new CheckerError(that.Position, "Undefined constant or variable '" + that.Name + "' in expression");
     that.Type = declaration.Type;
 }