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 programmatically 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
117 about our current AST, is that we represent binary operators with full
119 operators, we'll use this same representation, so we don't need any new
123 these new operators, in the "def binary\| 5" part of the function
126 ``PrototypeAST`` AST node. To represent our new user-defined operators
163 operators (as you'll see below, it just doesn't apply for unary
164 operators). Now that we have a way to represent the prototype for a
228 operators. This builds names like "binary@" for a newly defined "@"
234 operators. Given our current structure, this is a simple addition of a
272 generates a function call to it. Since user-defined operators are just
303 Now we have useful user-defined binary operators. This builds a lot on
304 the previous framework we built for other operators. Adding unary
305 operators is a bit more challenging, because we don't have any framework
311 Since we don't currently support unary operators in the Kaleidoscope
356 allows us to handle multiple unary operators (e.g. "!!x"). Note that
357 unary operators can't have ambiguous parses like binary operators can,
388 With these two simple changes, we are now able to parse unary operators
425 As with binary operators, we name unary operators with a name that
428 unary operators. It looks like this:
445 operators. It is simpler primarily because it doesn't need to handle any
446 predefined operators.
727 With this, we conclude the "adding user-defined operators" chapter of
745 the support for user-defined operators. To build this example, use: