Home | History | Annotate | Download | only in Chapter5

Lines Matching refs:ExprAST

99 /// ExprAST - Base class for all expression nodes.
100 class ExprAST {
102 virtual ~ExprAST() {}
107 class NumberExprAST : public ExprAST {
115 class VariableExprAST : public ExprAST {
123 class BinaryExprAST : public ExprAST {
125 ExprAST *LHS, *RHS;
127 BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs)
133 class CallExprAST : public ExprAST {
135 std::vector<ExprAST*> Args;
137 CallExprAST(const std::string &callee, std::vector<ExprAST*> &args)
143 class IfExprAST : public ExprAST {
144 ExprAST *Cond, *Then, *Else;
146 IfExprAST(ExprAST *cond, ExprAST *then, ExprAST *_else)
152 class ForExprAST : public ExprAST {
154 ExprAST *Start, *End, *Step, *Body;
156 ForExprAST(const std::string &varname, ExprAST *start, ExprAST *end,
157 ExprAST *step, ExprAST *body)
178 ExprAST *Body;
180 FunctionAST(PrototypeAST *proto, ExprAST *body)
214 ExprAST *Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str);return 0;}
218 static ExprAST *ParseExpression();
223 static ExprAST *ParseIdentifierExpr() {
233 std::vector<ExprAST*> Args;
236 ExprAST *Arg = ParseExpression();
255 static ExprAST *ParseNumberExpr() {
256 ExprAST *Result = new NumberExprAST(NumVal);
262 static ExprAST *ParseParenExpr() {
264 ExprAST *V = ParseExpression();
274 static ExprAST *ParseIfExpr() {
278 ExprAST *Cond = ParseExpression();
285 ExprAST *Then = ParseExpression();
293 ExprAST *Else = ParseExpression();
300 static ExprAST *ParseForExpr() {
314 ExprAST *Start = ParseExpression();
320 ExprAST *End = ParseExpression();
324 ExprAST *Step = 0;
335 ExprAST *Body = ParseExpression();
347 static ExprAST *ParsePrimary() {
360 static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) {
375 ExprAST *RHS = ParsePrimary();
394 static ExprAST *ParseExpression() {
395 ExprAST *LHS = ParsePrimary();
431 if (ExprAST *E = ParseExpression())
438 if (ExprAST *E = ParseExpression()) {