Example #1
0
 public override void visit(FloatDcl n)
 {
     if (!AST.SymbolTable.ContainsKey(n.id))
     {
         AST.SymbolTable.Add(n.id, AST.FLTTYPE);
     }
     else
     {
         error("variable " + n.id + " is already declared");
     }
 }
Example #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);
     }
 }
Example #3
0
File: Visitor.cs Project: mkju19/P4
 public abstract void visit(FloatDcl n);
Example #4
0
 public override void visit(FloatDcl n)
 {
     //throw new NotImplementedException();
 }
Example #5
0
 public override void visit(FloatDcl n)
 {
     //Console.Write($"f {n.id} ");
     Console.WriteLine($"f {n.id} ");
 }
Example #6
0
 public override void visit(FloatDcl n)
 {
     emit("float " + n.id + ";\n");
 }