示例#1
0
 public override void visit(IntDcl n)
 {
     if (!AST.SymbolTable.ContainsKey(n.id))
     {
         AST.SymbolTable.Add(n.id, AST.INTTYPE);
     }
     else
     {
         error("variable " + n.id + " is already declared");
     }
 }
示例#2
0
 void dcl(out SymDeclaring e)
 {
     e = null;
     if (la.kind == 3)
     {
         Get();
         Expect(8);
         e = new FloatDcl(t.val);
     }
     else if (la.kind == 4)
     {
         Get();
         Expect(8);
         e = new IntDcl(t.val);
     }
     else
     {
         SynErr(11);
     }
 }
示例#3
0
文件: Visitor.cs 项目: mkju19/P4
 public abstract void visit(IntDcl n);
示例#4
0
文件: TypeChecker.cs 项目: mkju19/P4
 public override void visit(IntDcl n)
 {
     //throw new NotImplementedException();
 }
示例#5
0
 public override void visit(IntDcl n)
 {
     //Console.Write($"i {n.id} ");
     Console.WriteLine($"i {n.id} ");
 }
示例#6
0
 public override void visit(IntDcl n)
 {
     emit("int " + n.id + ";\n");
 }