Exemple #1
0
 public NameSupply(IImSet<string> globals, NameSupply parent)
 {
     this.globals = globals ?? Constants.EmptyStringSet;
     boundInThisScope = new Set<string>();
     boundInChildScope = new Set<string>();
     this.parent = parent;
 }
Exemple #2
0
 public NameSupply(IImSet <string> globals, NameSupply parent)
 {
     this.globals      = globals ?? Constants.EmptyStringSet;
     boundInThisScope  = new Set <string>();
     boundInChildScope = new Set <string>();
     this.parent       = parent;
 }
            protected TranslationContext(TranslationContext parent, int start)
            {
                Parent = parent;
                Start = start;

                ResultType = parent.ResultType;
                Instructions = parent.Instructions;
                OffsetToIndex = parent.OffsetToIndex;
                TryOffsets = parent.TryOffsets;
                IndexToHandler = parent.IndexToHandler;
                IndexToFilter = parent.IndexToFilter;
                Handlers = parent.Handlers;
            }
Exemple #4
0
 public NameSupply(IImSet<string> globals) : this(globals, null) { }
            public TranslationContext(TypeRef resultType, PE.Instruction[] instructions, IImSeq<PE.ExceptionHandlingClause> handlers)
            {
                Parent = null;
                Start = 0;

                ResultType = resultType;
                Instructions = instructions;
                Handlers = handlers;

                var offsetToIndex = new Map<int, int>();
                for (var i = 0; i < instructions.Length; i++)
                {
                    if (offsetToIndex.ContainsKey(instructions[i].Offset))
                        throw new InvalidOperationException("instructions share same offset");
                    offsetToIndex.Add(instructions[i].Offset, i);
                }
                OffsetToIndex = offsetToIndex;

                var tryOffsets = new Set<int>();
                var indexToHandler = new Map<int, PE.ExceptionHandlingClause>();
                var indexToFilter = new Map<int, PE.ExceptionHandlingClause>();
                foreach (var ehc in handlers)
                {
                    if (!tryOffsets.Contains(ehc.TryOffset))
                        tryOffsets.Add(ehc.TryOffset);
                    var i = OffsetToIndex[ehc.HandlerOffset];
                    indexToHandler.Add(i, ehc);
                    if (ehc.Flags == PE.CorILExceptionClause.Filter)
                    {
                        var j = OffsetToIndex[ehc.FilterOffset];
                        indexToHandler.Add(j, ehc);
                    }
                }
                TryOffsets = tryOffsets;
                IndexToHandler = indexToHandler;
                IndexToFilter = indexToFilter;
            }
Exemple #6
0
 public SetDebugView(IImSet <T> set)
 {
     this.set = set;
 }
Exemple #7
0
 public NameSupply(IImSet <string> globals) : this(globals, null)
 {
 }