protected IReaderResult<Expression, TokenStream> ParseFirstExpression( Expression left, int priority, TokenStream stream) { for (var level = 0; level < priority; level++) { foreach (var parser in ParsersPriorityList[level]) { var result = parser.Parse(this, left, level, stream); if (result != null) return result; } } return null; }
public IReaderResult<Expression, TokenStream> Parse(Expression left, int priority, TokenStream stream) { IReaderResult<Expression, TokenStream> lastResult = null; while (true) { var result = ParseFirstExpression(lastResult?.Value ?? left, priority, stream); if (result != null) { lastResult = result; stream = result.Stream; } else { return lastResult; } } }
public FieldStatement(TypeStatement type, LiteralToken name, Expression expression) { Type = type; Name = name; Expression = expression; }
public ParenthesisExpression(OperatorToken left, Expression expression, OperatorToken right) { Left = left; Expression = expression; Right = right; }