• Home
  • Raw
  • Download

Lines Matching refs:operators

15 doesn't have many useful operators (like division, logical negation, or
19 user-defined operators to the simple and beautiful Kaleidoscope
35 redefine existing operators: you can't programatically change the
36 grammar, introduce new operators, change precedence levels, etc. In this
38 user round out the set of operators that are supported.
40 The point of going into user-defined operators in a tutorial like this
46 the programmer to introduce new operators into the grammar: the grammar
49 The two specific features we'll add are programmable unary operators
50 (right now, Kaleidoscope has no unary operators at all) as well as
51 binary operators. An example of this is:
84 implementing support for user-defined binary operators and adding unary
85 operators.
90 Adding support for user-defined binary operators is pretty simple with
98 (* operators *)
112 thing about our current AST, is that we represent binary operators with
114 extended operators, we'll use this same representation, so we don't need
118 these new operators, in the "def binary\| 5" part of the function
121 ``Ast.Prototype`` AST node. To represent our new user-defined operators
137 operators (as you'll see below, it just doesn't apply for unary
138 operators). Now that we have a way to represent the prototype for a
191 operators. This builds names like "binary@" for a newly defined "@"
197 operators. Given our current structure, this is a simple addition of a
230 generates a function call to it. Since user-defined operators are just
262 Now we have useful user-defined binary operators. This builds a lot on
263 the previous framework we built for other operators. Adding unary
264 operators is a bit more challenging, because we don't have any framework
270 Since we don't currently support unary operators in the Kaleidoscope
304 allows us to handle multiple unary operators (e.g. "!!x"). Note that
305 unary operators can't have ambiguous parses like binary operators can,
329 With these two simple changes, we are now able to parse unary operators
381 As with binary operators, we name unary operators with a name that
384 unary operators. It looks like this:
401 operators. It is simpler primarily because it doesn't need to handle any
402 predefined operators.
677 With this, we conclude the "adding user-defined operators" chapter of
752 (* operators *)
1380 (* Install standard binary operators.