コード例 #1
0
ファイル: CodeBlockEntry.cs プロジェクト: qq1792/LSharp
		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;
		}
コード例 #2
0
ファイル: CodeBlockEntry.cs プロジェクト: qq1792/LSharp
		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;
			}
		}
コード例 #3
0
        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);
        }
コード例 #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);
        }
コード例 #5
0
 public void StartBlock(CodeBlockEntry.Type type, int start_offset)
 {
     StartBlock(type, start_offset, _blocks == null ? 1 : _blocks.Count + 1);
 }