Home | History | Annotate | Download | only in Chapter6

Lines Matching refs:ExprAST

105 /// ExprAST - Base class for all expression nodes.
106 class ExprAST {
108 virtual ~ExprAST() {}
113 class NumberExprAST : public ExprAST {
121 class VariableExprAST : public ExprAST {
129 class UnaryExprAST : public ExprAST {
131 ExprAST *Operand;
133 UnaryExprAST(char opcode, ExprAST *operand)
139 class BinaryExprAST : public ExprAST {
141 ExprAST *LHS, *RHS;
143 BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs)
149 class CallExprAST : public ExprAST {
151 std::vector<ExprAST*> Args;
153 CallExprAST(const std::string &callee, std::vector<ExprAST*> &args)
159 class IfExprAST : public ExprAST {
160 ExprAST *Cond, *Then, *Else;
162 IfExprAST(ExprAST *cond, ExprAST *then, ExprAST *_else)
168 class ForExprAST : public ExprAST {
170 ExprAST *Start, *End, *Step, *Body;
172 ForExprAST(const std::string &varname, ExprAST *start, ExprAST *end,
173 ExprAST *step, ExprAST *body)
207 ExprAST *Body;
209 FunctionAST(PrototypeAST *proto, ExprAST *body)
244 ExprAST *Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str);return 0;}
248 static ExprAST *ParseExpression();
253 static ExprAST *ParseIdentifierExpr() {
263 std::vector<ExprAST*> Args;
266 ExprAST *Arg = ParseExpression();
285 static ExprAST *ParseNumberExpr() {
286 ExprAST *Result = new NumberExprAST(NumVal);
292 static ExprAST *ParseParenExpr() {
294 ExprAST *V = ParseExpression();
304 static ExprAST *ParseIfExpr() {
308 ExprAST *Cond = ParseExpression();
315 ExprAST *Then = ParseExpression();
323 ExprAST *Else = ParseExpression();
330 static ExprAST *ParseForExpr() {
344 ExprAST *Start = ParseExpression();
350 ExprAST *End = ParseExpression();
354 ExprAST *Step = 0;
365 ExprAST *Body = ParseExpression();
377 static ExprAST *ParsePrimary() {
391 static ExprAST *ParseUnary() {
399 if (ExprAST *Operand = ParseUnary())
406 static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) {
421 ExprAST *RHS = ParseUnary();
440 static ExprAST *ParseExpression() {
441 ExprAST *LHS = ParseUnary();
518 if (ExprAST *E = ParseExpression())
525 if (ExprAST *E = ParseExpression()) {