Lines Matching refs:ExprAST
133 /// ExprAST - Base class for all expression nodes.
134 class ExprAST {
136 virtual ~ExprAST() {}
141 class NumberExprAST : public ExprAST {
149 class VariableExprAST : public ExprAST {
158 class UnaryExprAST : public ExprAST {
160 ExprAST *Operand;
162 UnaryExprAST(char opcode, ExprAST *operand)
168 class BinaryExprAST : public ExprAST {
170 ExprAST *LHS, *RHS;
172 BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs)
178 class CallExprAST : public ExprAST {
180 std::vector<ExprAST*> Args;
182 CallExprAST(const std::string &callee, std::vector<ExprAST*> &args)
188 class IfExprAST : public ExprAST {
189 ExprAST *Cond, *Then, *Else;
191 IfExprAST(ExprAST *cond, ExprAST *then, ExprAST *_else)
197 class ForExprAST : public ExprAST {
199 ExprAST *Start, *End, *Step, *Body;
201 ForExprAST(const std::string &varname, ExprAST *start, ExprAST *end,
202 ExprAST *step, ExprAST *body)
208 class VarExprAST : public ExprAST {
209 std::vector<std::pair<std::string, ExprAST*> > VarNames;
210 ExprAST *Body;
212 VarExprAST(const std::vector<std::pair<std::string, ExprAST*> > &varnames,
213 ExprAST *body)
249 ExprAST *Body;
251 FunctionAST(PrototypeAST *proto, ExprAST *body)
285 ExprAST *Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str);return 0;}
289 static ExprAST *ParseExpression();
294 static ExprAST *ParseIdentifierExpr() {
304 std::vector<ExprAST*> Args;
307 ExprAST *Arg = ParseExpression();
326 static ExprAST *ParseNumberExpr() {
327 ExprAST *Result = new NumberExprAST(NumVal);
333 static ExprAST *ParseParenExpr() {
335 ExprAST *V = ParseExpression();
345 static ExprAST *ParseIfExpr() {
349 ExprAST *Cond = ParseExpression();
356 ExprAST *Then = ParseExpression();
364 ExprAST *Else = ParseExpression();
371 static ExprAST *ParseForExpr() {
385 ExprAST *Start = ParseExpression();
391 ExprAST *End = ParseExpression();
395 ExprAST *Step = 0;
406 ExprAST *Body = ParseExpression();
414 static ExprAST *ParseVarExpr() {
417 std::vector<std::pair<std::string, ExprAST*> > VarNames;
428 ExprAST *Init = 0;
451 ExprAST *Body = ParseExpression();
464 static ExprAST *ParsePrimary() {
479 static ExprAST *ParseUnary() {
487 if (ExprAST *Operand = ParseUnary())
494 static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) {
509 ExprAST *RHS = ParseUnary();
528 static ExprAST *ParseExpression() {
529 ExprAST *LHS = ParseUnary();
606 if (ExprAST *E = ParseExpression())
613 if (ExprAST *E = ParseExpression()) {
1261 ExprAST *Init = VarNames[i].second;