Next: , Previous: Precedence Parsing Overview, Up: Precedence Parsing


4.1.2 Rule Types

Here are the higher-level syntax types and an example of each. Precedence considerations are omitted for clarity. See Grammar Rule Definition for full details.

— Grammar: nofix bye exit
          bye

calls the function exit with no arguments.

— Grammar: prefix - negate
          - 42

Calls the function negate with the argument 42.

— Grammar: infix - difference
          x - y

Calls the function difference with arguments x and y.

— Grammar: nary + sum
          x + y + z

Calls the function sum with arguments x, y, and y.

— Grammar: postfix ! factorial
          5 !

Calls the function factorial with the argument 5.

— Grammar: prestfix set set!
          set foo bar

Calls the function set! with the arguments foo and bar.

— Grammar: commentfix /* */
          /* almost any text here */

Ignores the comment delimited by /* and */.

— Grammar: matchfix { list }
          {0, 1, 2}

Calls the function list with the arguments 0, 1, and 2.

— Grammar: inmatchfix ( funcall )
          f(x, y)

Calls the function funcall with the arguments f, x, and y.

— Grammar: delim ;
          set foo bar;

delimits the extent of the restfix operator set.