Example #1
0
        public HLInstructionBlock CreateBlock(HLLabel pStartLabel)
        {
            HLInstructionBlock block = HLInstructionBlock.Create(this, pStartLabel);

            mBlocks.Add(block);
            return(block);
        }
Example #2
0
        public static HLLabel Create(int pIdentifier)
        {
            HLLabel label = new HLLabel();

            label.mIdentifier = pIdentifier;
            return(label);
        }
Example #3
0
        public HLLabel CreateLabel()
        {
            HLLabel label = HLLabel.Create(mLabels.Count);

            mLabels.Add(label);
            return(label);
        }
 public static HLInstructionBlock Create(HLMethod pMethod, HLLabel pStartLabel)
 {
     HLInstructionBlock block = new HLInstructionBlock();
     block.mMethod = pMethod;
     block.mStartLabel = pStartLabel;
     block.EmitLabel(pStartLabel);
     return block;
 }
Example #5
0
        public static HLInstructionBlock Create(HLMethod pMethod, HLLabel pStartLabel)
        {
            HLInstructionBlock block = new HLInstructionBlock();

            block.mMethod     = pMethod;
            block.mStartLabel = pStartLabel;
            block.EmitLabel(pStartLabel);
            return(block);
        }
Example #6
0
        private void ProcessLabeledStatement(ILabeledStatement pStatement)
        {
            HLLabel labelTarget = null;

            if (!mRemappedLabels.TryGetValue(pStatement.Label.Value, out labelTarget))
            {
                labelTarget = CreateLabel();
                mRemappedLabels.Add(pStatement.Label.Value, labelTarget);
            }
            mCurrentBlock.Terminate(labelTarget);
            mCurrentBlock = CreateBlock(labelTarget);
            ProcessStatement(pStatement.Statement);
        }
Example #7
0
 public void Terminate(HLLabel pNextBlockStartLabel)
 {
     if (!mTerminated)
     {
         if (pNextBlockStartLabel == null)
         {
             EmitReturn(null);
         }
         else
         {
             EmitGoto(pNextBlockStartLabel);
         }
     }
 }
Example #8
0
        private void ProcessGotoStatement(IGotoStatement pStatement)
        {
            if (mCurrentBlock.Terminated)
            {
                mCurrentBlock = CreateBlock(CreateLabel());
            }

            HLLabel labelTarget = null;

            if (!mRemappedLabels.TryGetValue(pStatement.TargetStatement.Label.Value, out labelTarget))
            {
                labelTarget = CreateLabel();
                mRemappedLabels.Add(pStatement.TargetStatement.Label.Value, labelTarget);
            }
            mCurrentBlock.EmitGoto(labelTarget);
        }
Example #9
0
 public void EmitBranch(HLLocation pConditionSource, HLLabel pTrueLabel, HLLabel pFalseLabel)
 {
     Emit(HLBranchInstruction.Create(mMethod, pConditionSource, pTrueLabel, pFalseLabel));
 }
 public void EmitBranch(HLLocation pConditionSource, HLLabel pTrueLabel, HLLabel pFalseLabel)
 {
     Emit(HLBranchInstruction.Create(mMethod, pConditionSource, pTrueLabel, pFalseLabel));
 }
Example #11
0
 public HLInstructionBlock CreateBlock(HLLabel pStartLabel)
 {
     HLInstructionBlock block = HLInstructionBlock.Create(this, pStartLabel);
     mBlocks.Add(block);
     return block;
 }
Example #12
0
 public void EmitSwitch(HLLocation pConditionSource, HLLabel pDefaultLabel, List <Tuple <HLLiteralLocation, HLLabel> > pCases)
 {
     Emit(HLSwitchInstruction.Create(mMethod, pConditionSource, pDefaultLabel, pCases));
 }
 public void EmitLabel(HLLabel pLabel)
 {
     Emit(HLLabelInstruction.Create(mMethod, pLabel));
 }
 public void EmitGoto(HLLabel pTargetLabel)
 {
     Emit(HLGotoInstruction.Create(mMethod, pTargetLabel));
 }
Example #15
0
 public void EmitGoto(HLLabel pTargetLabel)
 {
     Emit(HLGotoInstruction.Create(mMethod, pTargetLabel));
 }
Example #16
0
 public void EmitLabel(HLLabel pLabel)
 {
     Emit(HLLabelInstruction.Create(mMethod, pLabel));
 }
 public void EmitSwitch(HLLocation pConditionSource, HLLabel pDefaultLabel, List<Tuple<HLLiteralLocation, HLLabel>> pCases)
 {
     Emit(HLSwitchInstruction.Create(mMethod, pConditionSource, pDefaultLabel, pCases));
 }
 public void Terminate(HLLabel pNextBlockStartLabel)
 {
     if (!mTerminated)
     {
         if (pNextBlockStartLabel == null) EmitReturn(null);
         else EmitGoto(pNextBlockStartLabel);
     }
 }
Example #19
0
 public static HLLabel Create(int pIdentifier)
 {
     HLLabel label = new HLLabel();
     label.mIdentifier = pIdentifier;
     return label;
 }