コード例 #1
0
 int findLabel(int label)
 {
     for (int i = 0; i < ThreeAddressCode.Count(); ++i)
     {
         if (ThreeAddressCode[i].Operation.Token == TranslationToken.GotoLabel && ThreeAddressCode[i].Operation.StringNumber == label)
         {
             return(i);
         }
     }
     return(-1);
 }
コード例 #2
0
        public void exec()
        {
            triadResult = new string[ThreeAddressCode.Count()];
            while (pointer < this.ThreeAddressCode.Count() && !outFlag)
            {
                if (ThreeAddressCode[pointer].Operation.AttributeValue == "OPERATION" || ThreeAddressCode[pointer].Operation.AttributeValue == "COMPARSION")
                {
                    ProcessOperation();
                }
                actionCase();
            }

            Ibuf.Dispose();
        }