public ScriptMyLabel DefineLabel(ScriptMyLabel myLabel) { objFileWriter.Write((byte)ScriptObjWriterCode.DclLabel); objFileWriter.Write(myLabel.number); objFileWriter.Write(myLabel.name); return(myLabel); }
/** * @brief Define a label for use by the function */ public ScriptMyLabel DefineLabel(string name) { ScriptMyLabel myLabel = new ScriptMyLabel(); myLabel.name = name; myLabel.number = labelNumber++; return(DefineLabel(myLabel)); }
public override void CodeGen(ScriptCodeGen scg, Token errorAt, CompValuTemp result, CompValu[] args) { ScriptMyLabel itsPosLabel = scg.ilGen.DefineLabel("llAbstemp"); args[0].PushVal(scg, errorAt); scg.ilGen.Emit(errorAt, OpCodes.Dup); scg.ilGen.Emit(errorAt, OpCodes.Ldc_I4_0); scg.ilGen.Emit(errorAt, OpCodes.Bge_S, itsPosLabel); scg.ilGen.Emit(errorAt, OpCodes.Neg); scg.ilGen.MarkLabel(itsPosLabel); result.Pop(scg, errorAt, retType); }
public void MarkLabel(ScriptMyLabel myLabel) { }
public void Emit(Token errorAt, OpCode opcode, ScriptMyLabel myLabel) { }
/** * @brief Declare that the target of a label is the next instruction. */ public void MarkLabel(ScriptMyLabel myLabel) { objFileWriter.Write((byte)ScriptObjWriterCode.MarkLabel); objFileWriter.Write(myLabel.number); }
public void Emit(Token errorAt, OpCode opcode, ScriptMyLabel myLabel) { objFileWriter.Write((byte)ScriptObjWriterCode.EmitLabel); WriteOpCode(errorAt, opcode); objFileWriter.Write(myLabel.number); }