Exemplo n.º 1
0
        public IAstElement Process(IAstElement element, ProcessingOptions options = null)
        {
            options = options ?? new ProcessingOptions();

            var context = new ProcessingContext(options);
            foreach (var source in topLevelNameSources) {
                context.Scope.Add(source);
            }
            var steps = this.allSteps.Where(s => options.Stages.Contains(s.Stage)).ToArray();
            return Process(element, context, steps);
        }
Exemplo n.º 2
0
        public ProcessingContext(ProcessingOptions options)
        {
            Argument.RequireNotNull("options", options);

            this.Options = options;
            this.FreeData = new Dictionary<object, object>();

            this.ElementStack = new Stack<IAstElement>();

            this.ScopeStack = new Stack<Scope>();
            this.ScopeStack.Push(new Scope());
        }