std::string TGParser::ParseObjectName() {
if (Lex.getCode() != tgtok::Id)
return GetNewAnonymousName();
-
+
std::string Ret = Lex.getCurStrVal();
Lex.Lex();
return Ret;
Type = new StringRecTy();
break;
}
-
+
if (Lex.getCode() != tgtok::l_paren) {
TokError("expected '(' after binary operator");
return 0;
Lex.Lex(); // eat the '('
SmallVector<Init*, 2> InitList;
-
+
InitList.push_back(ParseValue(CurRec));
if (InitList.back() == 0) return 0;
InitList.back() = RHS;
}
}
-
+
if (InitList.size() == 2)
return (new BinOpInit(Code, InitList[0], InitList[1], Type))
->Fold(CurRec, CurMultiClass);
-
+
Error(OpLoc, "expected two operands to operator");
return 0;
}
DefmPrefix = Lex.getCurStrVal();
Lex.Lex(); // Eat the defm prefix.
}
-
+
SMLoc DefmPrefixLoc = Lex.getLoc();
if (Lex.getCode() != tgtok::colon)
return TokError("expected ':' after defm identifier");