コード例 #1
0
        public void Load(injectionParser.FileContext file)
        {
            CurrentScript = new ScriptFile("<script>", file.GetText(), file);
            interpreter   = new ThreadLocal <Interpreter>(()
                                                          => new Interpreter(Metadata, CurrentScript.FileName, debuggerServer.Create(), retrieveCancellationToken));

            Metadata.Reset();
            var collector = new DefinitionCollector(Metadata);

            collector.Visit(file);
        }
コード例 #2
0
        public MessageCollection Load(string content, string fileName)
        {
            var parser = new Parser();

            CurrentFileSyntax = parser.ParseFile(content, out var errors);
            CurrentFileName   = fileName;

            Metadata.ResetSubrutines();
            var collector = new DefinitionCollector(Metadata);

            collector.Visit(CurrentFileSyntax);

            if (errors.Any())
            {
                return(errors);
            }

            var sanityAnalyzer = new SanityAnalyzer();

            return(sanityAnalyzer.Analyze(CurrentFileSyntax, Metadata));
        }
コード例 #3
0
        public MessageCollection Load(string content, string fileName)
        {
            var parser = new Parser();
            var syntax = parser.ParseFile(content, out var errors);

            CurrentScript = new ScriptFile(fileName, content, syntax);
            interpreter   = new ThreadLocal <Interpreter>(()
                                                          => new Interpreter(Metadata, CurrentScript.FileName, debuggerServer.Create(), retrieveCancellationToken));

            Metadata.Reset();
            var collector = new DefinitionCollector(Metadata);

            collector.Visit(CurrentScript.Syntax);

            if (errors.Any())
            {
                return(errors);
            }

            var sanityAnalyzer = new SanityAnalyzer();

            return(sanityAnalyzer.Analyze(CurrentScript.Syntax, Metadata));
        }
コード例 #4
0
        public void Load(injectionParser.FileContext file)
        {
            var collector = new DefinitionCollector(Metadata);

            collector.Visit(file);
        }