Пример #1
0
        public static BuildResult <Parser <ExpressionToken, int> > buildSimpleExpressionParserWithContext()
        {
            var StartingRule   = $"{typeof(SimpleExpressionParserWithContext).Name}_expressions";
            var parserInstance = new SimpleExpressionParserWithContext();
            var builder        = new ParserBuilder <ExpressionToken, int>();
            var Parser         = builder.BuildParser(parserInstance, ParserType.LL_RECURSIVE_DESCENT, StartingRule);

            return(Parser);
        }
Пример #2
0
        private BuildResult <Parser <ExpressionToken, int> > buildSimpleExpressionParserWithContext(ParserType parserType = ParserType.EBNF_LL_RECURSIVE_DESCENT)
        {
            var startingRule   = $"{typeof(SimpleExpressionParserWithContext).Name}_expressions";
            var parserInstance = new SimpleExpressionParserWithContext();
            var builder        = new ParserBuilder <ExpressionToken, int>();
            var parser         = builder.BuildParser(parserInstance, parserType, startingRule);

            return(parser);
        }