Lines Matching refs:ExprAST
109 class ExprAST { class
111 virtual ~ExprAST() {} in ~ExprAST()
116 class NumberExprAST : public ExprAST {
124 class VariableExprAST : public ExprAST {
133 class UnaryExprAST : public ExprAST {
135 ExprAST *Operand;
137 UnaryExprAST(char opcode, ExprAST *operand) in UnaryExprAST()
143 class BinaryExprAST : public ExprAST {
145 ExprAST *LHS, *RHS;
147 BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs) in BinaryExprAST()
153 class CallExprAST : public ExprAST {
155 std::vector<ExprAST*> Args;
157 CallExprAST(const std::string &callee, std::vector<ExprAST*> &args) in CallExprAST()
163 class IfExprAST : public ExprAST {
164 ExprAST *Cond, *Then, *Else;
166 IfExprAST(ExprAST *cond, ExprAST *then, ExprAST *_else) in IfExprAST()
172 class ForExprAST : public ExprAST {
174 ExprAST *Start, *End, *Step, *Body;
176 ForExprAST(const std::string &varname, ExprAST *start, ExprAST *end, in ForExprAST()
177 ExprAST *step, ExprAST *body) in ForExprAST()
183 class VarExprAST : public ExprAST {
184 std::vector<std::pair<std::string, ExprAST*> > VarNames;
185 ExprAST *Body;
187 VarExprAST(const std::vector<std::pair<std::string, ExprAST*> > &varnames, in VarExprAST()
188 ExprAST *body) in VarExprAST()
224 ExprAST *Body;
226 FunctionAST(PrototypeAST *proto, ExprAST *body) in FunctionAST()
260 ExprAST *Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str);return 0;} in Error()
264 static ExprAST *ParseExpression();
269 static ExprAST *ParseIdentifierExpr() { in ParseIdentifierExpr()
279 std::vector<ExprAST*> Args; in ParseIdentifierExpr()
282 ExprAST *Arg = ParseExpression(); in ParseIdentifierExpr()
301 static ExprAST *ParseNumberExpr() { in ParseNumberExpr()
302 ExprAST *Result = new NumberExprAST(NumVal); in ParseNumberExpr()
308 static ExprAST *ParseParenExpr() { in ParseParenExpr()
310 ExprAST *V = ParseExpression(); in ParseParenExpr()
320 static ExprAST *ParseIfExpr() { in ParseIfExpr()
324 ExprAST *Cond = ParseExpression(); in ParseIfExpr()
331 ExprAST *Then = ParseExpression(); in ParseIfExpr()
339 ExprAST *Else = ParseExpression(); in ParseIfExpr()
346 static ExprAST *ParseForExpr() { in ParseForExpr()
360 ExprAST *Start = ParseExpression(); in ParseForExpr()
366 ExprAST *End = ParseExpression(); in ParseForExpr()
370 ExprAST *Step = 0; in ParseForExpr()
381 ExprAST *Body = ParseExpression(); in ParseForExpr()
389 static ExprAST *ParseVarExpr() { in ParseVarExpr()
392 std::vector<std::pair<std::string, ExprAST*> > VarNames; in ParseVarExpr()
403 ExprAST *Init = 0; in ParseVarExpr()
426 ExprAST *Body = ParseExpression(); in ParseVarExpr()
439 static ExprAST *ParsePrimary() { in ParsePrimary()
454 static ExprAST *ParseUnary() { in ParseUnary()
462 if (ExprAST *Operand = ParseUnary()) in ParseUnary()
469 static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) { in ParseBinOpRHS()
484 ExprAST *RHS = ParseUnary(); in ParseBinOpRHS()
503 static ExprAST *ParseExpression() { in ParseExpression()
504 ExprAST *LHS = ParseUnary(); in ParseExpression()
581 if (ExprAST *E = ParseExpression()) in ParseDefinition()
588 if (ExprAST *E = ParseExpression()) { in ParseTopLevelExpr()
868 ExprAST *Init = VarNames[i].second; in Codegen()