Lines Matching refs:ExprAST
113 class ExprAST { class
115 virtual ~ExprAST() {} in ~ExprAST()
120 class NumberExprAST : public ExprAST {
128 class VariableExprAST : public ExprAST {
137 class UnaryExprAST : public ExprAST {
139 ExprAST *Operand;
141 UnaryExprAST(char opcode, ExprAST *operand) in UnaryExprAST()
147 class BinaryExprAST : public ExprAST {
149 ExprAST *LHS, *RHS;
151 BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs) in BinaryExprAST()
157 class CallExprAST : public ExprAST {
159 std::vector<ExprAST*> Args;
161 CallExprAST(const std::string &callee, std::vector<ExprAST*> &args) in CallExprAST()
167 class IfExprAST : public ExprAST {
168 ExprAST *Cond, *Then, *Else;
170 IfExprAST(ExprAST *cond, ExprAST *then, ExprAST *_else) in IfExprAST()
176 class ForExprAST : public ExprAST {
178 ExprAST *Start, *End, *Step, *Body;
180 ForExprAST(const std::string &varname, ExprAST *start, ExprAST *end, in ForExprAST()
181 ExprAST *step, ExprAST *body) in ForExprAST()
187 class VarExprAST : public ExprAST {
188 std::vector<std::pair<std::string, ExprAST*> > VarNames;
189 ExprAST *Body;
191 VarExprAST(const std::vector<std::pair<std::string, ExprAST*> > &varnames, in VarExprAST()
192 ExprAST *body) in VarExprAST()
228 ExprAST *Body;
230 FunctionAST(PrototypeAST *proto, ExprAST *body) in FunctionAST()
264 ExprAST *Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str);return 0;} in Error()
268 static ExprAST *ParseExpression();
273 static ExprAST *ParseIdentifierExpr() { in ParseIdentifierExpr()
283 std::vector<ExprAST*> Args; in ParseIdentifierExpr()
286 ExprAST *Arg = ParseExpression(); in ParseIdentifierExpr()
305 static ExprAST *ParseNumberExpr() { in ParseNumberExpr()
306 ExprAST *Result = new NumberExprAST(NumVal); in ParseNumberExpr()
312 static ExprAST *ParseParenExpr() { in ParseParenExpr()
314 ExprAST *V = ParseExpression(); in ParseParenExpr()
324 static ExprAST *ParseIfExpr() { in ParseIfExpr()
328 ExprAST *Cond = ParseExpression(); in ParseIfExpr()
335 ExprAST *Then = ParseExpression(); in ParseIfExpr()
343 ExprAST *Else = ParseExpression(); in ParseIfExpr()
350 static ExprAST *ParseForExpr() { in ParseForExpr()
364 ExprAST *Start = ParseExpression(); in ParseForExpr()
370 ExprAST *End = ParseExpression(); in ParseForExpr()
374 ExprAST *Step = 0; in ParseForExpr()
385 ExprAST *Body = ParseExpression(); in ParseForExpr()
393 static ExprAST *ParseVarExpr() { in ParseVarExpr()
396 std::vector<std::pair<std::string, ExprAST*> > VarNames; in ParseVarExpr()
407 ExprAST *Init = 0; in ParseVarExpr()
430 ExprAST *Body = ParseExpression(); in ParseVarExpr()
443 static ExprAST *ParsePrimary() { in ParsePrimary()
458 static ExprAST *ParseUnary() { in ParseUnary()
466 if (ExprAST *Operand = ParseUnary()) in ParseUnary()
473 static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) { in ParseBinOpRHS()
488 ExprAST *RHS = ParseUnary(); in ParseBinOpRHS()
507 static ExprAST *ParseExpression() { in ParseExpression()
508 ExprAST *LHS = ParseUnary(); in ParseExpression()
585 if (ExprAST *E = ParseExpression()) in ParseDefinition()
592 if (ExprAST *E = ParseExpression()) { in ParseTopLevelExpr()
1155 ExprAST *Init = VarNames[i].second; in Codegen()