Пример #1
0
 public virtual void visit(Int32Literal n)
 {
     throw new NotImplementedException();
 }
Пример #2
0
 public abstract void visit(Int32Literal n);
Пример #3
0
 private Exp EatPrimary()
 {
     switch (tokens[0].type)
     {
         case Global.DataType.IDENTIFIER:
             return EatIdentifier();
         case Global.DataType.INT:
             switch (architecture)
             {
                 case Global.InstructionSets.X86: Exp result = new Int32Literal(context[0], tokens[0].value); CutData(1); return result;
                 case Global.InstructionSets.X86_64: result = new Int64Literal(context[0], tokens[0].value); CutData(1); return result;
             }
             break;
         case Global.DataType.DOUBLE:
             switch (architecture)
             {
                 case Global.InstructionSets.X86: Exp result = new FloatLiteral(context[0], tokens[0].value); CutData(1); return result;
                 case Global.InstructionSets.X86_64: result = new DoubleLiteral(context[0], tokens[0].value); CutData(1); return result;
             }
             break;
         case Global.DataType.STRING:
             Exp literal = EatStringLiteral(new StringLiteral(context[0]));
             return literal;
         case Global.DataType.TRUE:
             CutData(1);
             return new BoolLiteral(context[0], "true");
         case Global.DataType.FALSE:
             CutData(1);
             return new BoolLiteral(context[0], "false");
     }
     return null;
 }