Lines Matching refs:precedence

71 Note that there is no discussion about precedence of binary operators,
242 (multiplication) has higher *precedence* than "+" (addition).
247 This parsing technique uses the precedence of binary operators to guide
252 (* binop_precedence - This holds the precedence for each binary operator that is
256 (* precedence - Get the precedence of the pending binary operator token. *)
257 let precedence c = try Hashtbl.find binop_precedence c with Not_found -> -1
263 * 1 is the lowest precedence. *)
272 reader). The ``Parser.precedence`` function returns the precedence for
277 comparisons in the ``Parser.precedence`` function. (Or just use a
281 expressions. The basic idea of operator precedence parsing is to break
284 Operator precedence parsing considers this as a stream of primary
302 pairs for us. It takes a precedence and a pointer to an expression for
309 The precedence value passed into ``Parser.parse_bin_rhs`` indicates the
310 *minimal operator precedence* that the function is allowed to eat. For
312 ``Parser.parse_bin_rhs`` is passed in a precedence of 40, it will not
313 consume any tokens (because the precedence of '+' is only 20). With this
322 (* If this is a binop, find its precedence. *)
324 let token_prec = precedence c in
330 This code gets the precedence of the current token and checks to see if
331 if is too low. Because we defined invalid tokens to have a precedence of
358 precedence and compare it to BinOp's precedence (which is '+' in this
365 let next_prec = precedence c2 in
368 If the precedence of the binop to the right of "RHS" is lower or equal
369 to the precedence of our current operator, then we know that the
372 same precedence. In this case we'll create the AST node for "a+b", and
390 primary. In this case, the precedence of "\*" is higher than the
391 precedence of "+" so the if condition will be entered.
405 if token_prec < precedence c2
417 primary has higher precedence than the binop we are currently parsing.
419 higher precedence than "+" should be parsed together and returned as
421 function specifying "token\_prec+1" as the minimum precedence required
716 (* binop_precedence - This holds the precedence for each binary operator that is
720 (* precedence - Get the precedence of the pending binary operator token. *)
721 let precedence c = try Hashtbl.find binop_precedence c with Not_found -> -1
764 (* If this is a binop, find its precedence. *)
766 let token_prec = precedence c in
783 let next_prec = precedence c2 in
882 * 1 is the lowest precedence. *)