Example #1
0
 private void InitializeParser(SourceCode sourceCode, IEnumerable <Token> tokens, MonitorScriptParserOptions options)
 {
     _sourceCode = sourceCode;
     _tokens     = tokens.Where(g => !g.IsTrivia()).ToArray();
     _options    = options;
     _index      = 0;
 }
Example #2
0
        public SyntaxNode ParseStatement(SourceCode sourceCode, IEnumerable <Token> tokens, MonitorScriptParserOptions options)
        {
            InitializeParser(sourceCode, tokens, options);

            try
            {
                return(ParseStatement());
            }
            catch (SyntaxException)
            {
                return(null);
            }
        }