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.
162 level the operator is at. The precedence is only used for binary
171 /// ::= binary LETTER number? (id, id)
175 unsigned Kind = 0; // 0 = identifier, 1 = unary, 2 = binary.
189 return LogErrorP("Expected binary operator");
190 FnName = "binary";
227 code above is the couple lines that set up ``FnName`` for binary
228 operators. This builds names like "binary@" for a newly defined "@"
233 The next interesting thing to add, is codegen support for these binary
235 default case for our existing binary operator node:
261 // If it wasn't a builtin binary operator, it must be a user defined one. Emit
263 Function *F = getFunction(std::string("binary") + Op);
264 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
331 binary operator AST node, except that it only has one child. With this,
357 unary operators can't have ambiguous parses like binary operators can,
371 // Parse the unary expression after the binary operator.
390 prototypes, to parse the unary operator prototype. We extend the binary
397 /// ::= binary LETTER number? (id, id)
402 unsigned Kind = 0; // 0 = identifier, 1 = unary, 2 = binary.
425 As with binary operators, we name unary operators with a name that
444 This code is similar to, but simpler than, the code for binary
464 ready> def binary : 1 (x y) 0; # Low-precedence operator that ignores operands.
488 def binary> 10 (LHS RHS)
492 def binary| 5 (LHS RHS)
501 def binary& 6 (LHS RHS)
508 def binary = 9 (LHS RHS)
513 def binary : 1 (x y) y;