Exemple #1
0
		public CodeBlockEntry(int index, int parent, CodeBlockEntry.Type type, int start_offset)
		{
			this.Index = index;
			this.Parent = parent;
			this.BlockType = type;
			this.StartOffset = start_offset;
		}
Exemple #2
0
		internal CodeBlockEntry(int index, MyBinaryReader reader)
		{
			this.Index = index;
			int type_flag = reader.ReadLeb128();
			this.BlockType = (CodeBlockEntry.Type)(type_flag & 63);
			this.Parent = reader.ReadLeb128();
			this.StartOffset = reader.ReadLeb128();
			this.EndOffset = reader.ReadLeb128();
			if ((type_flag & 64) != 0)
			{
				int data_size = (int)reader.ReadInt16();
				reader.BaseStream.Position += (long)data_size;
			}
		}
        public void StartBlock(CodeBlockEntry.Type type, int start_offset, int scopeIndex)
        {
            if (_block_stack == null)
            {
                _block_stack = new Stack <CodeBlockEntry> ();
            }

            if (_blocks == null)
            {
                _blocks = new List <CodeBlockEntry> ();
            }

            int parent = CurrentBlock != null ? CurrentBlock.Index : -1;

            CodeBlockEntry block = new CodeBlockEntry(
                scopeIndex, parent, type, start_offset);

            _block_stack.Push(block);
            _blocks.Add(block);
        }
Exemple #4
0
        public void StartBlock(CodeBlockEntry.Type type, int start_offset)
        {
            if (_block_stack == null)
            {
#if NET_2_1
                _block_stack = new System.Collections.Stack();
#else
                _block_stack = new Stack <CodeBlockEntry> ();
#endif
            }

            if (_blocks == null)
            {
                _blocks = new List <CodeBlockEntry> ();
            }

            int parent = CurrentBlock != null ? CurrentBlock.Index : -1;

            CodeBlockEntry block = new CodeBlockEntry(
                _blocks.Count + 1, parent, type, start_offset);

            _block_stack.Push(block);
            _blocks.Add(block);
        }
Exemple #5
0
 public void StartBlock(CodeBlockEntry.Type type, int start_offset)
 {
     StartBlock(type, start_offset, _blocks == null ? 1 : _blocks.Count + 1);
 }