public override void visit(Int64Literal n) { stack.Push(new IntegerConstant(int.Parse(n.Value))); //Add(new Move(new IntegerConstant(int.Parse(n.Value)), regRAX)); //Add(new Move(new IntegerConstant(int.Parse(n.Value)), new RegisterOffset(Global.Registers.STACKBASEPOINTER, --extraStackSize))); }
public virtual void visit(Int64Literal n) { throw new NotImplementedException(); }
public abstract void visit(Int64Literal 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; }