Пример #1
0
        private void FirstPass(LabelStore labelStore, MacroStore macroStore)
        {
            var instructionResolver = new InstructionResolver(labelStore, macroStore);
            var parser = new Parser(instructionResolver);

            parser.Parse(source);
        }
        private string Suggest(string source, int cursorPosition)
        {
            var handler = new AutocompletionParserHandler(cursorPosition);
            var parser = new Parser(handler);

            parser.Parse(source);

            return handler.GetSuggestion();
        }
Пример #3
0
        private MemoryImage SecondPass(LabelStore labelStore, MacroStore macroStore)
        {
            labelStore.ClearReferencedLabels();
            var instructionResolver = new InstructionResolver(labelStore, macroStore);
            var parser = new Parser(instructionResolver);

            parser.Parse(source);

            return instructionResolver.CreateMemoryImage();
        }
Пример #4
0
        public IList<ClassificationSpan> GetClassificationSpans(SnapshotSpan span)
        {
            var handler = new ClassificationParserHandler(span, classificationTypes);
            var parser = new Parser(handler);
            if (parser.Parse(span.GetText()))
            {
                return handler.Result;
            }

            return new List<ClassificationSpan>();
        }
Пример #5
0
        private int EvaluateExpression(string source, LabelStore labelStore)
        {
            var resolver = new ExpressionResolver(labelStore);
            var parser = new Parser(resolver);

            bool success = parser.ParseExpression(source);
            if (!success)
            {
                Assert.Inconclusive("Cannot parse expression " + source);
            }

            return resolver.Evaluate();
        }
Пример #6
0
        private string[] Parse(string source)
        {
            var handler = new TestParserHandler();
            bool success = new Parser(handler).Parse(source);
            Assert.IsTrue(success, "Cannot parse: " + source);

            return handler.Result;
        }
Пример #7
0
        private Label[] ResolveLabels(string source, LabelStore labelStore)
        {
            var resolver = new InstructionResolver(labelStore, new MacroStore());
            var parser = new Parser(resolver);

            parser.Parse(source);

            return labelStore.ToArray();
        }