Lines Matching refs:binary

51 binary operators. An example of this is:
63 def binary> 10 (LHS RHS)
67 def binary| 5 (LHS RHS)
76 def binary= 9 (LHS RHS)
84 implementing support for user-defined binary operators and adding unary
90 Adding support for user-defined binary operators is pretty simple with
91 our current framework. We'll first add support for the unary/binary
109 if (IdentifierStr == "binary")
115 This just adds lexer support for the unary and binary keywords, like we
117 about our current AST, is that we represent binary operators with full
123 these new operators, in the "def binary\| 5" part of the function
138 unsigned Precedence; // Precedence if a binary op.
161 level the operator is at. The precedence is only used for binary
170 /// ::= binary LETTER number? (id, id)
174 unsigned Kind = 0; // 0 = identifier, 1 = unary, 2 = binary.
188 return ErrorP("Expected binary operator");
189 FnName = "binary";
226 code above is the couple lines that set up ``FnName`` for binary
227 operators. This builds names like "binary@" for a newly defined "@"
232 The next interesting thing to add, is codegen support for these binary
234 default case for our existing binary operator node:
260 // If it wasn't a builtin binary operator, it must be a user defined one. Emit
262 Function *F = TheModule->getFunction(std::string("binary") + Op);
263 assert(F && "binary operator not found!");
298 operator, we register it in the precedence table. This allows the binary
303 Now we have useful user-defined binary operators. This builds a lot on
330 binary operator AST node, except that it only has one child. With this,
356 unary operators can't have ambiguous parses like binary operators can,
370 // Parse the unary expression after the binary operator.
389 prototypes, to parse the unary operator prototype. We extend the binary
396 /// ::= binary LETTER number? (id, id)
401 unsigned Kind = 0; // 0 = identifier, 1 = unary, 2 = binary.
424 As with binary operators, we name unary operators with a name that
443 This code is similar to, but simpler than, the code for binary
463 ready> def binary : 1 (x y) 0; # Low-precedence operator that ignores operands.
487 def binary> 10 (LHS RHS)
491 def binary| 5 (LHS RHS)
500 def binary& 6 (LHS RHS)
507 def binary = 9 (LHS RHS)
512 def binary : 1 (x y) y;