public virtual void visit(Int32Literal n) { throw new NotImplementedException(); }
public abstract void visit(Int32Literal n);
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; }