示例#1
0
文件: CodeGen.cs 项目: bencz/Beryl
 /* 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);
 }
示例#2
0
文件: Checker.cs 项目: bencz/Beryl
 /* 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;
 }