Home | History | Annotate | Download | only in Chapter5

Lines Matching refs:ExprAST

100 /// ExprAST - Base class for all expression nodes.
101 class ExprAST {
103 virtual ~ExprAST() {}
108 class NumberExprAST : public ExprAST {
116 class VariableExprAST : public ExprAST {
124 class BinaryExprAST : public ExprAST {
126 ExprAST *LHS, *RHS;
128 BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs)
134 class CallExprAST : public ExprAST {
136 std::vector<ExprAST*> Args;
138 CallExprAST(const std::string &callee, std::vector<ExprAST*> &args)
144 class IfExprAST : public ExprAST {
145 ExprAST *Cond, *Then, *Else;
147 IfExprAST(ExprAST *cond, ExprAST *then, ExprAST *_else)
153 class ForExprAST : public ExprAST {
155 ExprAST *Start, *End, *Step, *Body;
157 ForExprAST(const std::string &varname, ExprAST *start, ExprAST *end,
158 ExprAST *step, ExprAST *body)
179 ExprAST *Body;
181 FunctionAST(PrototypeAST *proto, ExprAST *body)
216 ExprAST *Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str);return 0;}
220 static ExprAST *ParseExpression();
225 static ExprAST *ParseIdentifierExpr() {
235 std::vector<ExprAST*> Args;
238 ExprAST *Arg = ParseExpression();
257 static ExprAST *ParseNumberExpr() {
258 ExprAST *Result = new NumberExprAST(NumVal);
264 static ExprAST *ParseParenExpr() {
266 ExprAST *V = ParseExpression();
276 static ExprAST *ParseIfExpr() {
280 ExprAST *Cond = ParseExpression();
287 ExprAST *Then = ParseExpression();
295 ExprAST *Else = ParseExpression();
302 static ExprAST *ParseForExpr() {
316 ExprAST *Start = ParseExpression();
322 ExprAST *End = ParseExpression();
326 ExprAST *Step = 0;
337 ExprAST *Body = ParseExpression();
349 static ExprAST *ParsePrimary() {
362 static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) {
377 ExprAST *RHS = ParsePrimary();
396 static ExprAST *ParseExpression() {
397 ExprAST *LHS = ParsePrimary();
433 if (ExprAST *E = ParseExpression())
440 if (ExprAST *E = ParseExpression()) {