Lines Matching defs:ExprAST

127 /// ExprAST - Base class for all expression nodes.
128 class ExprAST {
130 virtual ~ExprAST() {}
135 class NumberExprAST : public ExprAST {
143 class VariableExprAST : public ExprAST {
152 class UnaryExprAST : public ExprAST {
154 ExprAST *Operand;
156 UnaryExprAST(char opcode, ExprAST *operand)
162 class BinaryExprAST : public ExprAST {
164 ExprAST *LHS, *RHS;
166 BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs)
172 class CallExprAST : public ExprAST {
174 std::vector<ExprAST*> Args;
176 CallExprAST(const std::string &callee, std::vector<ExprAST*> &args)
182 class IfExprAST : public ExprAST {
183 ExprAST *Cond, *Then, *Else;
185 IfExprAST(ExprAST *cond, ExprAST *then, ExprAST *_else)
191 class ForExprAST : public ExprAST {
193 ExprAST *Start, *End, *Step, *Body;
195 ForExprAST(const std::string &varname, ExprAST *start, ExprAST *end,
196 ExprAST *step, ExprAST *body)
202 class VarExprAST : public ExprAST {
203 std::vector<std::pair<std::string, ExprAST*> > VarNames;
204 ExprAST *Body;
206 VarExprAST(const std::vector<std::pair<std::string, ExprAST*> > &varnames,
207 ExprAST *body)
243 ExprAST *Body;
245 FunctionAST(PrototypeAST *proto, ExprAST *body)
279 ExprAST *Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str);return 0;}
283 static ExprAST *ParseExpression();
288 static ExprAST *ParseIdentifierExpr() {
298 std::vector<ExprAST*> Args;
301 ExprAST *Arg = ParseExpression();
320 static ExprAST *ParseNumberExpr() {
321 ExprAST *Result = new NumberExprAST(NumVal);
327 static ExprAST *ParseParenExpr() {
329 ExprAST *V = ParseExpression();
339 static ExprAST *ParseIfExpr() {
343 ExprAST *Cond = ParseExpression();
350 ExprAST *Then = ParseExpression();
358 ExprAST *Else = ParseExpression();
365 static ExprAST *ParseForExpr() {
379 ExprAST *Start = ParseExpression();
385 ExprAST *End = ParseExpression();
389 ExprAST *Step = 0;
400 ExprAST *Body = ParseExpression();
408 static ExprAST *ParseVarExpr() {
411 std::vector<std::pair<std::string, ExprAST*> > VarNames;
422 ExprAST *Init = 0;
445 ExprAST *Body = ParseExpression();
458 static ExprAST *ParsePrimary() {
473 static ExprAST *ParseUnary() {
481 if (ExprAST *Operand = ParseUnary())
488 static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) {
503 ExprAST *RHS = ParseUnary();
522 static ExprAST *ParseExpression() {
523 ExprAST *LHS = ParseUnary();
600 if (ExprAST *E = ParseExpression())
607 if (ExprAST *E = ParseExpression()) {
897 ExprAST *Init = VarNames[i].second;