Lines Matching refs:ExprAST
111 class ExprAST { class
113 virtual ~ExprAST() {} in ~ExprAST()
118 class NumberExprAST : public ExprAST {
126 class VariableExprAST : public ExprAST {
135 class UnaryExprAST : public ExprAST {
137 ExprAST *Operand;
139 UnaryExprAST(char opcode, ExprAST *operand) in UnaryExprAST()
145 class BinaryExprAST : public ExprAST {
147 ExprAST *LHS, *RHS;
149 BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs) in BinaryExprAST()
155 class CallExprAST : public ExprAST {
157 std::vector<ExprAST*> Args;
159 CallExprAST(const std::string &callee, std::vector<ExprAST*> &args) in CallExprAST()
165 class IfExprAST : public ExprAST {
166 ExprAST *Cond, *Then, *Else;
168 IfExprAST(ExprAST *cond, ExprAST *then, ExprAST *_else) in IfExprAST()
174 class ForExprAST : public ExprAST {
176 ExprAST *Start, *End, *Step, *Body;
178 ForExprAST(const std::string &varname, ExprAST *start, ExprAST *end, in ForExprAST()
179 ExprAST *step, ExprAST *body) in ForExprAST()
185 class VarExprAST : public ExprAST {
186 std::vector<std::pair<std::string, ExprAST*> > VarNames;
187 ExprAST *Body;
189 VarExprAST(const std::vector<std::pair<std::string, ExprAST*> > &varnames, in VarExprAST()
190 ExprAST *body) in VarExprAST()
226 ExprAST *Body;
228 FunctionAST(PrototypeAST *proto, ExprAST *body) in FunctionAST()
262 ExprAST *Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str);return 0;} in Error()
266 static ExprAST *ParseExpression();
271 static ExprAST *ParseIdentifierExpr() { in ParseIdentifierExpr()
281 std::vector<ExprAST*> Args; in ParseIdentifierExpr()
284 ExprAST *Arg = ParseExpression(); in ParseIdentifierExpr()
303 static ExprAST *ParseNumberExpr() { in ParseNumberExpr()
304 ExprAST *Result = new NumberExprAST(NumVal); in ParseNumberExpr()
310 static ExprAST *ParseParenExpr() { in ParseParenExpr()
312 ExprAST *V = ParseExpression(); in ParseParenExpr()
322 static ExprAST *ParseIfExpr() { in ParseIfExpr()
326 ExprAST *Cond = ParseExpression(); in ParseIfExpr()
333 ExprAST *Then = ParseExpression(); in ParseIfExpr()
341 ExprAST *Else = ParseExpression(); in ParseIfExpr()
348 static ExprAST *ParseForExpr() { in ParseForExpr()
362 ExprAST *Start = ParseExpression(); in ParseForExpr()
368 ExprAST *End = ParseExpression(); in ParseForExpr()
372 ExprAST *Step = 0; in ParseForExpr()
383 ExprAST *Body = ParseExpression(); in ParseForExpr()
391 static ExprAST *ParseVarExpr() { in ParseVarExpr()
394 std::vector<std::pair<std::string, ExprAST*> > VarNames; in ParseVarExpr()
405 ExprAST *Init = 0; in ParseVarExpr()
428 ExprAST *Body = ParseExpression(); in ParseVarExpr()
441 static ExprAST *ParsePrimary() { in ParsePrimary()
456 static ExprAST *ParseUnary() { in ParseUnary()
464 if (ExprAST *Operand = ParseUnary()) in ParseUnary()
471 static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) { in ParseBinOpRHS()
486 ExprAST *RHS = ParseUnary(); in ParseBinOpRHS()
505 static ExprAST *ParseExpression() { in ParseExpression()
506 ExprAST *LHS = ParseUnary(); in ParseExpression()
583 if (ExprAST *E = ParseExpression()) in ParseDefinition()
590 if (ExprAST *E = ParseExpression()) { in ParseTopLevelExpr()
1115 ExprAST *Init = VarNames[i].second; in Codegen()