예제 #1
0
        public Tokenizer(SourceReader source, ParsingContext context)
        {
            Require.NotNull(source, "source");
            Require.NotNull(context, "context");

            _source = source;
            _context = context;
        }
예제 #2
0
파일: Parser.cs 프로젝트: Kooboo/Ecommerce
        public Expression Parse(string source, IEnumerable<string> registeredComparisonOperators)
        {
            Require.NotNullOrEmpty(source, "source");

            _context = new ParsingContext(registeredComparisonOperators);
            _tokenzier = new Tokenizer(source, _context);

            var exp = Expression();

            if (_context.Errors.Count > 0)
                throw new ParserException("Failed parsing condition expression.", _context.Errors);

            _context = null;
            _tokenzier = null;

            return exp;
        }
예제 #3
0
 public Tokenizer(string source, ParsingContext context)
     : this(new SourceReader(source), context)
 {
 }