Lines Matching refs:ExprAST
665 class VarExprAST : public ExprAST {
666 std::vector<std::pair<std::string, ExprAST*> > VarNames;
667 ExprAST *Body;
669 VarExprAST(const std::vector<std::pair<std::string, ExprAST*> > &varnames,
670 ExprAST *body)
693 static ExprAST *ParsePrimary() {
711 static ExprAST *ParseVarExpr() {
714 std::vector<std::pair<std::string, ExprAST*> > VarNames;
730 ExprAST *Init = 0;
758 ExprAST *Body = ParseExpression();
777 ExprAST *Init = VarNames[i].second;
965 /// ExprAST - Base class for all expression nodes.
966 class ExprAST {
968 virtual ~ExprAST() {}
973 class NumberExprAST : public ExprAST {
981 class VariableExprAST : public ExprAST {
990 class UnaryExprAST : public ExprAST {
992 ExprAST *Operand;
994 UnaryExprAST(char opcode, ExprAST *operand)
1000 class BinaryExprAST : public ExprAST {
1002 ExprAST *LHS, *RHS;
1004 BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs)
1010 class CallExprAST : public ExprAST {
1012 std::vector<ExprAST*> Args;
1014 CallExprAST(const std::string &callee, std::vector<ExprAST*> &args)
1020 class IfExprAST : public ExprAST {
1021 ExprAST *Cond, *Then, *Else;
1023 IfExprAST(ExprAST *cond, ExprAST *then, ExprAST *_else)
1029 class ForExprAST : public ExprAST {
1031 ExprAST *Start, *End, *Step, *Body;
1033 ForExprAST(const std::string &varname, ExprAST *start, ExprAST *end,
1034 ExprAST *step, ExprAST *body)
1040 class VarExprAST : public ExprAST {
1041 std::vector<std::pair<std::string, ExprAST*> > VarNames;
1042 ExprAST *Body;
1044 VarExprAST(const std::vector<std::pair<std::string, ExprAST*> > &varnames,
1045 ExprAST *body)
1082 ExprAST *Body;
1084 FunctionAST(PrototypeAST *proto, ExprAST *body)
1118 ExprAST *Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str);return 0;}
1122 static ExprAST *ParseExpression();
1127 static ExprAST *ParseIdentifierExpr() {
1137 std::vector<ExprAST*> Args;
1140 ExprAST *Arg = ParseExpression();
1159 static ExprAST *ParseNumberExpr() {
1160 ExprAST *Result = new NumberExprAST(NumVal);
1166 static ExprAST *ParseParenExpr() {
1168 ExprAST *V = ParseExpression();
1178 static ExprAST *ParseIfExpr() {
1182 ExprAST *Cond = ParseExpression();
1189 ExprAST *Then = ParseExpression();
1197 ExprAST *Else = ParseExpression();
1204 static ExprAST *ParseForExpr() {
1218 ExprAST *Start = ParseExpression();
1224 ExprAST *End = ParseExpression();
1228 ExprAST *Step = 0;
1239 ExprAST *Body = ParseExpression();
1247 static ExprAST *ParseVarExpr() {
1250 std::vector<std::pair<std::string, ExprAST*> > VarNames;
1261 ExprAST *Init = 0;
1284 ExprAST *Body = ParseExpression();
1297 static ExprAST *ParsePrimary() {
1312 static ExprAST *ParseUnary() {
1320 if (ExprAST *Operand = ParseUnary())
1327 static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) {
1342 ExprAST *RHS = ParseUnary();
1361 static ExprAST *ParseExpression() {
1362 ExprAST *LHS = ParseUnary();
1439 if (ExprAST *E = ParseExpression())
1446 if (ExprAST *E = ParseExpression()) {
1726 ExprAST *Init = VarNames[i].second;