Home | History | Annotate | Download | only in Chapter6

Lines Matching refs:ExprAST

104 /// ExprAST - Base class for all expression nodes.
105 class ExprAST {
107 virtual ~ExprAST() {}
112 class NumberExprAST : public ExprAST {
120 class VariableExprAST : public ExprAST {
128 class UnaryExprAST : public ExprAST {
130 ExprAST *Operand;
132 UnaryExprAST(char opcode, ExprAST *operand)
138 class BinaryExprAST : public ExprAST {
140 ExprAST *LHS, *RHS;
142 BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs)
148 class CallExprAST : public ExprAST {
150 std::vector<ExprAST*> Args;
152 CallExprAST(const std::string &callee, std::vector<ExprAST*> &args)
158 class IfExprAST : public ExprAST {
159 ExprAST *Cond, *Then, *Else;
161 IfExprAST(ExprAST *cond, ExprAST *then, ExprAST *_else)
167 class ForExprAST : public ExprAST {
169 ExprAST *Start, *End, *Step, *Body;
171 ForExprAST(const std::string &varname, ExprAST *start, ExprAST *end,
172 ExprAST *step, ExprAST *body)
206 ExprAST *Body;
208 FunctionAST(PrototypeAST *proto, ExprAST *body)
242 ExprAST *Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str);return 0;}
246 static ExprAST *ParseExpression();
251 static ExprAST *ParseIdentifierExpr() {
261 std::vector<ExprAST*> Args;
264 ExprAST *Arg = ParseExpression();
283 static ExprAST *ParseNumberExpr() {
284 ExprAST *Result = new NumberExprAST(NumVal);
290 static ExprAST *ParseParenExpr() {
292 ExprAST *V = ParseExpression();
302 static ExprAST *ParseIfExpr() {
306 ExprAST *Cond = ParseExpression();
313 ExprAST *Then = ParseExpression();
321 ExprAST *Else = ParseExpression();
328 static ExprAST *ParseForExpr() {
342 ExprAST *Start = ParseExpression();
348 ExprAST *End = ParseExpression();
352 ExprAST *Step = 0;
363 ExprAST *Body = ParseExpression();
375 static ExprAST *ParsePrimary() {
389 static ExprAST *ParseUnary() {
397 if (ExprAST *Operand = ParseUnary())
404 static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) {
419 ExprAST *RHS = ParseUnary();
438 static ExprAST *ParseExpression() {
439 ExprAST *LHS = ParseUnary();
516 if (ExprAST *E = ParseExpression())
523 if (ExprAST *E = ParseExpression()) {