Ejemplo n.º 1
0
        /// <summary>
        /// Create a new label at this position in the code buffer
        /// </summary>
        /// <returns>the label at the current position</returns>
        public CILLabel NewCodedLabel()
        {
            CILLabel lab = new CILLabel();

            AddToBuffer(new LabelInstr(lab));
            return(lab);
        }
Ejemplo n.º 2
0
        internal BranchInstr(int inst, CILLabel dst) : base(inst)
        {
            dest = dst;
            dest.AddBranch(this);
            size++;

            if (inst >= (int)BranchOp.br && inst != (int)BranchOp.leave_s)
            {
                shortVer = false;
                size    += 3;
            }
        }
Ejemplo n.º 3
0
		/// <summary>
		/// Create a new filter clause
		/// </summary>
		/// <param name="filterLabel">the label where the filter code starts</param>
		/// <param name="handlerStart">the start of the handler code</param>
		/// <param name="handlerEnd">the end of the handler code</param>
		public Filter(CILLabel filterLabel, CILLabel handlerStart, 
				CILLabel handlerEnd) : base(handlerStart,handlerEnd) 
				{
			this.filterLabel = filterLabel;
		}
Ejemplo n.º 4
0
 /// <summary>
 /// Create a new try block
 /// </summary>
 /// <param name="start">start label for the try block</param>
 /// <param name="end">end label for the try block</param>
 public TryBlock(CILLabel start, CILLabel end) : base(start, end)
 {
 }
Ejemplo n.º 5
0
		public CodeBlock(CILLabel start, CILLabel end) 
		{
			this.start = start;
			this.end = end;
		}
Ejemplo n.º 6
0
		/// <summary>
		/// Create a new label at this position in the code buffer
		/// </summary>
		/// <returns>the label at the current position</returns>
		public CILLabel NewCodedLabel() 
		{
			CILLabel lab = new CILLabel();
			AddToBuffer(new LabelInstr(lab));
			return lab;
		}
Ejemplo n.º 7
0
		/// <summary>
		/// Add a branch instruction
		/// </summary>
		/// <param name="inst">the branch instruction</param>
		/// <param name="lab">the label that is the target of the branch</param>
		public void Branch(BranchOp inst,  CILLabel lab) 
		{
			AddToBuffer(new BranchInstr((int)inst,lab));
		}
Ejemplo n.º 8
0
		internal SwitchInstr(int inst, CILLabel[] dsts) : base(inst) 
		{
			cases = dsts;
			if (cases != null) numCases = (uint)cases.Length;
			size += 4 + (numCases * 4);
			for (int i=0; i < numCases; i++) {
				cases[i].AddBranch(this);
			}
		}
Ejemplo n.º 9
0
		internal LabelInstr(CILLabel lab) 
		{
			label = lab;
			label.AddLabelInstr(this);
		}
Ejemplo n.º 10
0
 internal LabelInstr(CILLabel lab)
 {
     label = lab;
     label.AddLabelInstr(this);
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Create a new fault clause
 /// </summary>
 /// <param name="faultStart">start of the fault code</param>
 /// <param name="faultEnd">end of the fault code</param>
 public Fault(CILLabel faultStart, CILLabel faultEnd)
     : base(faultStart, faultEnd)
 {
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Create a new finally clause
 /// </summary>
 /// <param name="finallyStart">start of finally code</param>
 /// <param name="finallyEnd">end of finally code</param>
 public Finally(CILLabel finallyStart, CILLabel finallyEnd)
     : base(finallyStart, finallyEnd)
 {
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Create a new filter clause
 /// </summary>
 /// <param name="filterLabel">the label where the filter code starts</param>
 /// <param name="handlerStart">the start of the handler code</param>
 /// <param name="handlerEnd">the end of the handler code</param>
 public Filter(CILLabel filterLabel, CILLabel handlerStart,
               CILLabel handlerEnd) : base(handlerStart, handlerEnd)
 {
     this.filterLabel = filterLabel;
 }
Ejemplo n.º 14
0
 public Catch(Type except, CILLabel handlerStart, CILLabel handlerEnd)
     : base(handlerStart, handlerEnd)
 {
     exceptType = except;
 }
Ejemplo n.º 15
0
 public HandlerBlock(CILLabel start, CILLabel end) : base(start, end)
 {
 }
Ejemplo n.º 16
0
		/// <summary>
		/// Create a new finally clause
		/// </summary>
		/// <param name="finallyStart">start of finally code</param>
		/// <param name="finallyEnd">end of finally code</param>
		public Finally(CILLabel finallyStart, CILLabel finallyEnd)
			: base(finallyStart,finallyEnd) { }
Ejemplo n.º 17
0
		/// <summary>
		/// Create a new fault clause
		/// </summary>
		/// <param name="faultStart">start of the fault code</param>
		/// <param name="faultEnd">end of the fault code</param>
		public Fault(CILLabel faultStart, CILLabel faultEnd)
			: base(faultStart,faultEnd) { }
Ejemplo n.º 18
0
 /// <summary>
 /// Add a label to the CIL instructions
 /// </summary>
 /// <param name="lab">the label to be added</param>
 public void CodeLabel(CILLabel lab)
 {
     AddToBuffer(new LabelInstr(lab));
 }
Ejemplo n.º 19
0
		internal BranchInstr(int inst, CILLabel dst) : base(inst) 
		{
			dest = dst;
			dest.AddBranch(this);
			size++;

			if (inst >= (int) BranchOp.br && inst != (int) BranchOp.leave_s) {
				shortVer = false;
				size += 3;
			}
		}
Ejemplo n.º 20
0
 /// <summary>
 /// Add a branch instruction
 /// </summary>
 /// <param name="inst">the branch instruction</param>
 /// <param name="lab">the label that is the target of the branch</param>
 public void Branch(BranchOp inst, CILLabel lab)
 {
     AddToBuffer(new BranchInstr((int)inst, lab));
 }
Ejemplo n.º 21
0
		/// <summary>
		/// Add a label to the CIL instructions
		/// </summary>
		/// <param name="lab">the label to be added</param>
		public void CodeLabel(CILLabel lab) 
		{
			AddToBuffer(new LabelInstr(lab));
		}
Ejemplo n.º 22
0
        /// <summary>
        /// Mark this position as the end of the last started block and
        /// make it a filter block.  This filter block is associated with the
        /// specified try block.
        /// </summary>
        /// <param name="filterLab">the label where the filter code is</param>
        /// <param name="tryBlock">the try block associated with this filter block</param>
        public void EndFilterBlock(CILLabel filterLab, TryBlock tryBlock)
        {
            Filter filBlock = new Filter(filterLab, (CILLabel)blockStack[0], NewCodedLabel());

            tryBlock.AddHandler(filBlock);
        }
Ejemplo n.º 23
0
		/// <summary>
		/// Add a switch instruction
		/// </summary>
		/// <param name="labs">the target labels for the switch</param>
		public void Switch(CILLabel[] labs) 
		{
			AddToBuffer(new SwitchInstr(0x45,labs));
		}
Ejemplo n.º 24
0
		public HandlerBlock(CILLabel start, CILLabel end) : base(start,end) { }
Ejemplo n.º 25
0
		/// <summary>
		/// Mark this position as the end of the last started block and
		/// make it a filter block.  This filter block is associated with the
		/// specified try block.
		/// </summary>
		/// <param name="filterLab">the label where the filter code is</param>
		/// <param name="tryBlock">the try block associated with this filter block</param>
		public void EndFilterBlock(CILLabel filterLab, TryBlock tryBlock) 
		{
			Filter filBlock = new Filter(filterLab,(CILLabel)blockStack[0],NewCodedLabel());
			tryBlock.AddHandler(filBlock);
		}
Ejemplo n.º 26
0
		public Catch(Type except, CILLabel handlerStart, CILLabel handlerEnd)
			: base(handlerStart,handlerEnd) 
		{
			exceptType = except;
		}
Ejemplo n.º 27
0
		/// <summary>
		/// Create a new try block
		/// </summary>
		/// <param name="start">start label for the try block</param>
		/// <param name="end">end label for the try block</param>
		public TryBlock(CILLabel start, CILLabel end) : base(start,end) { }
Ejemplo n.º 28
0
 public CodeBlock(CILLabel start, CILLabel end)
 {
     this.start = start;
     this.end   = end;
 }