MCPcopy Create free account
hub / github.com/chibash/stone / doShift

Method doShift

src/stone/Parser.java:201–215  ·  view source on GitHub ↗
(Lexer lexer, ASTree left, int prec)

Source from the content-addressed store, hash-verified

199 res.add(right);
200 }
201 private ASTree doShift(Lexer lexer, ASTree left, int prec)
202 throws ParseException
203 {
204 ArrayList<ASTree> list = new ArrayList<ASTree>();
205 list.add(left);
206 list.add(new ASTLeaf(lexer.read()));
207 ASTree right = factor.parse(lexer);
208 Precedence next;
209 while ((next = nextOperator(lexer)) != null
210 && rightIsExpr(prec, next))
211 right = doShift(lexer, right, next.value);
212
213 list.add(right);
214 return factory.make(list);
215 }
216 private Precedence nextOperator(Lexer lexer) throws ParseException {
217 Token t = lexer.peek(0);
218 if (t.isIdentifier())

Callers 1

parseMethod · 0.95

Calls 6

nextOperatorMethod · 0.95
rightIsExprMethod · 0.95
makeMethod · 0.80
readMethod · 0.65
addMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected