Lines Matching refs:ExprAST
112 class ExprAST { class
114 virtual ~ExprAST() {} in ~ExprAST()
119 class NumberExprAST : public ExprAST {
127 class VariableExprAST : public ExprAST {
136 class UnaryExprAST : public ExprAST {
138 ExprAST *Operand;
140 UnaryExprAST(char opcode, ExprAST *operand) in UnaryExprAST()
146 class BinaryExprAST : public ExprAST {
148 ExprAST *LHS, *RHS;
150 BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs) in BinaryExprAST()
156 class CallExprAST : public ExprAST {
158 std::vector<ExprAST*> Args;
160 CallExprAST(const std::string &callee, std::vector<ExprAST*> &args) in CallExprAST()
166 class IfExprAST : public ExprAST {
167 ExprAST *Cond, *Then, *Else;
169 IfExprAST(ExprAST *cond, ExprAST *then, ExprAST *_else) in IfExprAST()
175 class ForExprAST : public ExprAST {
177 ExprAST *Start, *End, *Step, *Body;
179 ForExprAST(const std::string &varname, ExprAST *start, ExprAST *end, in ForExprAST()
180 ExprAST *step, ExprAST *body) in ForExprAST()
186 class VarExprAST : public ExprAST {
187 std::vector<std::pair<std::string, ExprAST*> > VarNames;
188 ExprAST *Body;
190 VarExprAST(const std::vector<std::pair<std::string, ExprAST*> > &varnames, in VarExprAST()
191 ExprAST *body) in VarExprAST()
227 ExprAST *Body;
229 FunctionAST(PrototypeAST *proto, ExprAST *body) in FunctionAST()
263 ExprAST *Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str);return 0;} in Error()
267 static ExprAST *ParseExpression();
272 static ExprAST *ParseIdentifierExpr() { in ParseIdentifierExpr()
282 std::vector<ExprAST*> Args; in ParseIdentifierExpr()
285 ExprAST *Arg = ParseExpression(); in ParseIdentifierExpr()
304 static ExprAST *ParseNumberExpr() { in ParseNumberExpr()
305 ExprAST *Result = new NumberExprAST(NumVal); in ParseNumberExpr()
311 static ExprAST *ParseParenExpr() { in ParseParenExpr()
313 ExprAST *V = ParseExpression(); in ParseParenExpr()
323 static ExprAST *ParseIfExpr() { in ParseIfExpr()
327 ExprAST *Cond = ParseExpression(); in ParseIfExpr()
334 ExprAST *Then = ParseExpression(); in ParseIfExpr()
342 ExprAST *Else = ParseExpression(); in ParseIfExpr()
349 static ExprAST *ParseForExpr() { in ParseForExpr()
363 ExprAST *Start = ParseExpression(); in ParseForExpr()
369 ExprAST *End = ParseExpression(); in ParseForExpr()
373 ExprAST *Step = 0; in ParseForExpr()
384 ExprAST *Body = ParseExpression(); in ParseForExpr()
392 static ExprAST *ParseVarExpr() { in ParseVarExpr()
395 std::vector<std::pair<std::string, ExprAST*> > VarNames; in ParseVarExpr()
406 ExprAST *Init = 0; in ParseVarExpr()
429 ExprAST *Body = ParseExpression(); in ParseVarExpr()
442 static ExprAST *ParsePrimary() { in ParsePrimary()
457 static ExprAST *ParseUnary() { in ParseUnary()
465 if (ExprAST *Operand = ParseUnary()) in ParseUnary()
472 static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) { in ParseBinOpRHS()
487 ExprAST *RHS = ParseUnary(); in ParseBinOpRHS()
506 static ExprAST *ParseExpression() { in ParseExpression()
507 ExprAST *LHS = ParseUnary(); in ParseExpression()
584 if (ExprAST *E = ParseExpression()) in ParseDefinition()
591 if (ExprAST *E = ParseExpression()) { in ParseTopLevelExpr()
875 ExprAST *Init = VarNames[i].second; in Codegen()