Lines Matching refs:ExprAST
127 class ExprAST { class
129 virtual ~ExprAST() {} in ~ExprAST()
134 class NumberExprAST : public ExprAST {
142 class VariableExprAST : public ExprAST {
151 class UnaryExprAST : public ExprAST {
153 ExprAST *Operand;
155 UnaryExprAST(char opcode, ExprAST *operand) in UnaryExprAST()
161 class BinaryExprAST : public ExprAST {
163 ExprAST *LHS, *RHS;
165 BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs) in BinaryExprAST()
171 class CallExprAST : public ExprAST {
173 std::vector<ExprAST*> Args;
175 CallExprAST(const std::string &callee, std::vector<ExprAST*> &args) in CallExprAST()
181 class IfExprAST : public ExprAST {
182 ExprAST *Cond, *Then, *Else;
184 IfExprAST(ExprAST *cond, ExprAST *then, ExprAST *_else) in IfExprAST()
190 class ForExprAST : public ExprAST {
192 ExprAST *Start, *End, *Step, *Body;
194 ForExprAST(const std::string &varname, ExprAST *start, ExprAST *end, in ForExprAST()
195 ExprAST *step, ExprAST *body) in ForExprAST()
201 class VarExprAST : public ExprAST {
202 std::vector<std::pair<std::string, ExprAST*> > VarNames;
203 ExprAST *Body;
205 VarExprAST(const std::vector<std::pair<std::string, ExprAST*> > &varnames, in VarExprAST()
206 ExprAST *body) in VarExprAST()
242 ExprAST *Body;
244 FunctionAST(PrototypeAST *proto, ExprAST *body) in FunctionAST()
278 ExprAST *Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str);return 0;} in Error()
282 static ExprAST *ParseExpression();
287 static ExprAST *ParseIdentifierExpr() { in ParseIdentifierExpr()
297 std::vector<ExprAST*> Args; in ParseIdentifierExpr()
300 ExprAST *Arg = ParseExpression(); in ParseIdentifierExpr()
319 static ExprAST *ParseNumberExpr() { in ParseNumberExpr()
320 ExprAST *Result = new NumberExprAST(NumVal); in ParseNumberExpr()
326 static ExprAST *ParseParenExpr() { in ParseParenExpr()
328 ExprAST *V = ParseExpression(); in ParseParenExpr()
338 static ExprAST *ParseIfExpr() { in ParseIfExpr()
342 ExprAST *Cond = ParseExpression(); in ParseIfExpr()
349 ExprAST *Then = ParseExpression(); in ParseIfExpr()
357 ExprAST *Else = ParseExpression(); in ParseIfExpr()
364 static ExprAST *ParseForExpr() { in ParseForExpr()
378 ExprAST *Start = ParseExpression(); in ParseForExpr()
384 ExprAST *End = ParseExpression(); in ParseForExpr()
388 ExprAST *Step = 0; in ParseForExpr()
399 ExprAST *Body = ParseExpression(); in ParseForExpr()
407 static ExprAST *ParseVarExpr() { in ParseVarExpr()
410 std::vector<std::pair<std::string, ExprAST*> > VarNames; in ParseVarExpr()
421 ExprAST *Init = 0; in ParseVarExpr()
444 ExprAST *Body = ParseExpression(); in ParseVarExpr()
457 static ExprAST *ParsePrimary() { in ParsePrimary()
472 static ExprAST *ParseUnary() { in ParseUnary()
480 if (ExprAST *Operand = ParseUnary()) in ParseUnary()
487 static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) { in ParseBinOpRHS()
502 ExprAST *RHS = ParseUnary(); in ParseBinOpRHS()
521 static ExprAST *ParseExpression() { in ParseExpression()
522 ExprAST *LHS = ParseUnary(); in ParseExpression()
599 if (ExprAST *E = ParseExpression()) in ParseDefinition()
606 if (ExprAST *E = ParseExpression()) { in ParseTopLevelExpr()
896 ExprAST *Init = VarNames[i].second; in Codegen()