private IAstNode Shift(IAstNode left, int level) { AstLeaf op = new AstLeaf(_lexer.Read()); IAstNode right = Factor(); Precedence next; while ((next = NextOperator()) != null && RightFirst(level, next)) { right = Shift(right, next.Level); } return(new ExpressionNode(new Collection <IAstNode>() { left, op, right })); }
private IAstNode Shift(IAstNode left, int level) { AstLeaf op = new AstLeaf(_lexer.Read()); IAstNode right = Factor(); Precedence next; while ((next = NextOperator()) != null && RightFirst(level, next)) right = Shift(right, next.Level); return new ExpressionNode(new Collection<IAstNode>() { left, op, right }); }