Home | History | Annotate | Download | only in tutorial

Lines Matching full:operator

69 The "operator overloading" that we will add to Kaleidoscope is more general than
79 operator precedence parsing for the expressions. See <a
80 href="LangImpl2.html">Chapter 2</a> for details. Without using operator
170 /// which captures its argument names as well as if it is an operator.
197 of whether it was an operator, and if it was, what precedence level the operator
200 the prototype for a user-defined operator, we need to parse it:</p>
224 return ErrorP("Expected binary operator");
252 <b>// Verify right number of names for operator.
254 return ErrorP("Invalid number of operands for operator");
264 like "binary@" for a newly defined "@" operator. This then takes advantage of the
270 existing binary operator node:</p>
291 <b>// If it wasn't a builtin binary operator, it must be a user defined one. Emit
294 assert(F &amp;&amp; "binary operator not found!");
304 a lookup for the appropriate operator in the symbol table and generates a
320 <b>// If this is an operator, install it.
333 <p>Basically, before codegening a function, if it is a user-defined operator, we
334 register it in the precedence table. This allows the binary operator parsing
335 logic we already have in place to handle it. Since we are working on a fully-general operator precedence parser, this is all we need to do to "extend the grammar".</p>
357 /// UnaryExprAST - Expression class for a unary operator.
370 binary operator AST node, except that it only has one child. With this, we
371 need to add the parsing logic. Parsing a unary operator is pretty simple: we'll
380 // If the current token is not an operator, it must be a primary expr.
384 // If this is a unary operator, read it.
395 operator when parsing a primary operator, we eat the operator as a prefix and
396 parse the remaining piece as another unary operator. This allows us to handle
411 <b>// Parse the unary expression after the binary operator.
430 the unary operator prototype. We extend the binary operator code above
456 return ErrorP("Expected unary operator");
468 the operator character. This assists us at code generation time. Speaking of,
480 operator");
502 things. For example, we can now add a nice sequencing operator (printd is
511 ready&gt; <b>def binary : 1 (x y) 0; # Low-precedence operator that ignores operands.</b>
560 # Define ':' for sequencing: as a low-precedence operator that ignores operands
960 /// UnaryExprAST - Expression class for a unary operator.
970 /// BinaryExprAST - Expression class for a binary operator.
1012 /// of arguments the function takes), as well as if it is an operator.
1059 /// BinopPrecedence - This holds the precedence for each binary operator that is
1063 /// GetTokPrecedence - Get the precedence of the pending binary operator token.
1223 // If the current token is not an operator, it must be a primary expr.
1227 // If this is a unary operator, read it.
1251 // Parse the unary expression after the binary operator.
1255 // If BinOp binds less tightly with RHS than the operator after RHS, let
1256 // the pending operator take RHS as its LHS.
1299 return ErrorP("Expected unary operator");
1308 return ErrorP("Expected binary operator");
1336 // Verify right number of names for operator.
1338 return ErrorP("Invalid number of operands for operator");
1397 return ErrorV("Unknown unary operator");
1419 // If it wasn't a builtin binary operator, it must be a user defined one. Emit
1422 assert(F &amp;&amp; "binary operator not found!");
1640 // If this is an operator, install it.