예제 #1
0
 public ScriptMyLabel DefineLabel(ScriptMyLabel myLabel)
 {
     objFileWriter.Write((byte)ScriptObjWriterCode.DclLabel);
     objFileWriter.Write(myLabel.number);
     objFileWriter.Write(myLabel.name);
     return(myLabel);
 }
예제 #2
0
        /**
         * @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));
        }
예제 #3
0
        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);
        }
예제 #4
0
 public void MarkLabel(ScriptMyLabel myLabel)
 {
 }
예제 #5
0
 public void Emit(Token errorAt, OpCode opcode, ScriptMyLabel myLabel)
 {
 }
예제 #6
0
 /**
  * @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);
 }
예제 #7
0
 public void Emit(Token errorAt, OpCode opcode, ScriptMyLabel myLabel)
 {
     objFileWriter.Write((byte)ScriptObjWriterCode.EmitLabel);
     WriteOpCode(errorAt, opcode);
     objFileWriter.Write(myLabel.number);
 }