Lines Matching refs:ExprAST
134 class ExprAST { class
136 virtual ~ExprAST() {} in ~ExprAST()
141 class NumberExprAST : public ExprAST {
149 class VariableExprAST : public ExprAST {
158 class UnaryExprAST : public ExprAST {
160 ExprAST *Operand;
162 UnaryExprAST(char opcode, ExprAST *operand) in UnaryExprAST()
168 class BinaryExprAST : public ExprAST {
170 ExprAST *LHS, *RHS;
172 BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs) in BinaryExprAST()
178 class CallExprAST : public ExprAST {
180 std::vector<ExprAST*> Args;
182 CallExprAST(const std::string &callee, std::vector<ExprAST*> &args) in CallExprAST()
188 class IfExprAST : public ExprAST {
189 ExprAST *Cond, *Then, *Else;
191 IfExprAST(ExprAST *cond, ExprAST *then, ExprAST *_else) in IfExprAST()
197 class ForExprAST : public ExprAST {
199 ExprAST *Start, *End, *Step, *Body;
201 ForExprAST(const std::string &varname, ExprAST *start, ExprAST *end, in ForExprAST()
202 ExprAST *step, ExprAST *body) in ForExprAST()
208 class VarExprAST : public ExprAST {
209 std::vector<std::pair<std::string, ExprAST*> > VarNames;
210 ExprAST *Body;
212 VarExprAST(const std::vector<std::pair<std::string, ExprAST*> > &varnames, in VarExprAST()
213 ExprAST *body) in VarExprAST()
249 ExprAST *Body;
251 FunctionAST(PrototypeAST *proto, ExprAST *body) in FunctionAST()
285 ExprAST *Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str);return 0;} in Error()
289 static ExprAST *ParseExpression();
294 static ExprAST *ParseIdentifierExpr() { in ParseIdentifierExpr()
304 std::vector<ExprAST*> Args; in ParseIdentifierExpr()
307 ExprAST *Arg = ParseExpression(); in ParseIdentifierExpr()
326 static ExprAST *ParseNumberExpr() { in ParseNumberExpr()
327 ExprAST *Result = new NumberExprAST(NumVal); in ParseNumberExpr()
333 static ExprAST *ParseParenExpr() { in ParseParenExpr()
335 ExprAST *V = ParseExpression(); in ParseParenExpr()
345 static ExprAST *ParseIfExpr() { in ParseIfExpr()
349 ExprAST *Cond = ParseExpression(); in ParseIfExpr()
356 ExprAST *Then = ParseExpression(); in ParseIfExpr()
364 ExprAST *Else = ParseExpression(); in ParseIfExpr()
371 static ExprAST *ParseForExpr() { in ParseForExpr()
385 ExprAST *Start = ParseExpression(); in ParseForExpr()
391 ExprAST *End = ParseExpression(); in ParseForExpr()
395 ExprAST *Step = 0; in ParseForExpr()
406 ExprAST *Body = ParseExpression(); in ParseForExpr()
414 static ExprAST *ParseVarExpr() { in ParseVarExpr()
417 std::vector<std::pair<std::string, ExprAST*> > VarNames; in ParseVarExpr()
428 ExprAST *Init = 0; in ParseVarExpr()
451 ExprAST *Body = ParseExpression(); in ParseVarExpr()
464 static ExprAST *ParsePrimary() { in ParsePrimary()
479 static ExprAST *ParseUnary() { in ParseUnary()
487 if (ExprAST *Operand = ParseUnary()) in ParseUnary()
494 static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) { in ParseBinOpRHS()
509 ExprAST *RHS = ParseUnary(); in ParseBinOpRHS()
528 static ExprAST *ParseExpression() { in ParseExpression()
529 ExprAST *LHS = ParseUnary(); in ParseExpression()
606 if (ExprAST *E = ParseExpression()) in ParseDefinition()
613 if (ExprAST *E = ParseExpression()) { in ParseTopLevelExpr()
1257 ExprAST *Init = VarNames[i].second; in Codegen()