Lines Matching refs:std

88         error_reporter_->ReportError(last_token_, std::move(message));
94 std::unique_ptr<raw::Identifier> Parser::ParseIdentifier(bool is_discarded) {
99 return std::make_unique<raw::Identifier>(identifier, identifier);
102 std::unique_ptr<raw::CompoundIdentifier> Parser::ParseCompoundIdentifier() {
103 std::vector<std::unique_ptr<raw::Identifier>> components;
129 return std::make_unique<raw::CompoundIdentifier>(first_token, MarkLastUseful(), std::move(components));
132 std::unique_ptr<raw::StringLiteral> Parser::ParseStringLiteral() {
137 return std::make_unique<raw::StringLiteral>(string_literal);
140 std::unique_ptr<raw::NumericLiteral> Parser::ParseNumericLiteral() {
145 return std::make_unique<raw::NumericLiteral>(numeric_literal);
148 std::unique_ptr<raw::Ordinal> Parser::ParseOrdinal() {
156 return std::make_unique<raw::Ordinal>(numeric_literal, colon);
159 std::unique_ptr<raw::TrueLiteral> Parser::ParseTrueLiteral() {
164 return std::make_unique<raw::TrueLiteral>(token);
167 std::unique_ptr<raw::FalseLiteral> Parser::ParseFalseLiteral() {
172 return std::make_unique<raw::FalseLiteral>(token);
175 std::unique_ptr<raw::Literal> Parser::ParseLiteral() {
194 std::unique_ptr<raw::Attribute> Parser::ParseAttribute() {
198 std::unique_ptr<raw::StringLiteral> value;
205 std::string str_name("");
206 std::string str_value("");
208 str_name = std::string(name->location().data().data(), name->location().data().size());
212 str_value = std::string(value->location().data().data() + 1, value->location().data().size() - 2);
215 return std::make_unique<raw::Attribute>(name->start_, MarkLastUseful(), str_name, str_value);
218 std::unique_ptr<raw::AttributeList> Parser::ParseAttributeList(std::unique_ptr<raw::Attribute>&& doc_comment) {
220 auto attributes = std::make_unique<raw::Attributes>();
223 attributes->Insert(std::move(doc_comment));
235 if (!attributes->Insert(std::move(attribute))) {
236 std::string message("Duplicate attribute with name '");
247 auto attribute_list = std::make_unique<raw::AttributeList>(start, MarkLastUseful(), std::move(attributes));
251 std::unique_ptr<raw::Attribute> Parser::ParseDocComment() {
252 std::string str_value("");
264 str_value += std::string(doc_line.location().data().data() + 3, doc_line.location().data().size() - 2);
268 return std::make_unique<raw::Attribute>(start, end, "Doc", str_value);
271 std::unique_ptr<raw::AttributeList> Parser::MaybeParseAttributeList() {
272 std::unique_ptr<raw::Attribute> doc_comment;
278 return ParseAttributeList(std::move(doc_comment));
282 auto attributes = std::make_unique<raw::Attributes>();
285 attributes->Insert(std::move(doc_comment));
286 return std::make_unique<raw::AttributeList>(start, end, std::move(attributes));
291 std::unique_ptr<raw::Constant> Parser::ParseConstant() {
297 return std::make_unique<raw::IdentifierConstant>(std::move(identifier));
304 return std::make_unique<raw::LiteralConstant>(std::move(literal));
312 std::unique_ptr<raw::Using> Parser::ParseUsing() {
320 std::unique_ptr<raw::Identifier> maybe_alias;
321 std::unique_ptr<raw::PrimitiveType> maybe_primitive;
337 return std::make_unique<raw::Using>(start, MarkLastUseful(), std::move(using_path), std::move(maybe_alias), std::move(maybe_primitive));
340 std::unique_ptr<raw::ArrayType> Parser::ParseArrayType() {
360 return std::make_unique<raw::ArrayType>(start, MarkLastUseful(), std::move(element_type), std::move(element_count));
363 std::unique_ptr<raw::VectorType> Parser::ParseVectorType() {
377 std::unique_ptr<raw::Constant> maybe_element_count;
391 return std::make_unique<raw::VectorType>(start, MarkLastUseful(), std::move(element_type),
392 std::move(maybe_element_count), nullability);
395 std::unique_ptr<raw::StringType> Parser::ParseStringType() {
400 std::unique_ptr<raw::Constant> maybe_element_count;
414 return std::make_unique<raw::StringType>(start, MarkLastUseful(), std::move(maybe_element_count), nullability);
417 std::unique_ptr<raw::HandleType> Parser::ParseHandleType() {
441 return std::make_unique<raw::HandleType>(start, MarkLastUseful(), subtype, nullability);
444 std::unique_ptr<raw::PrimitiveType> Parser::ParsePrimitiveType() {
488 return std::make_unique<raw::PrimitiveType>(start, MarkLastUseful(), subtype);
491 std::unique_ptr<raw::RequestHandleType> Parser::ParseRequestHandleType() {
510 return std::make_unique<raw::RequestHandleType>(start, MarkLastUseful(), std::move(identifier), nullability);
513 std::unique_ptr<raw::Type> Parser::ParseType() {
525 return std::make_unique<raw::IdentifierType>(identifier->start_, MarkLastUseful(), std::move(identifier), nullability);
575 std::unique_ptr<raw::ConstDeclaration>
576 Parser::ParseConstDeclaration(std::unique_ptr<raw::AttributeList> attributes) {
594 return std::make_unique<raw::ConstDeclaration>(start, MarkLastUseful(), std::move(attributes), std::move(type),
595 std::move(identifier), std::move(constant));
598 std::unique_ptr<raw::EnumMember> Parser::ParseEnumMember() {
620 return std::make_unique<raw::EnumMember>(start, MarkLastUseful(), std::move(identifier), std::move(member_value), std::move(attributes));
623 std::unique_ptr<raw::EnumDeclaration>
624 Parser::ParseEnumDeclaration(std::unique_ptr<raw::AttributeList> attributes) {
625 std::vector<std::unique_ptr<raw::EnumMember>> members;
634 std::unique_ptr<raw::PrimitiveType> subtype;
673 return std::make_unique<raw::EnumDeclaration>(start, MarkLastUseful(),
674 std::move(attributes), std::move(identifier),
675 std::move(subtype), std::move(members));
678 std::unique_ptr<raw::Parameter> Parser::ParseParameter() {
686 return std::make_unique<raw::Parameter>(type->start_, MarkLastUseful(), std::move(type), std::move(identifier));
689 std::unique_ptr<raw::ParameterList> Parser::ParseParameterList() {
690 std::vector<std::unique_ptr<raw::Parameter>> parameter_list;
702 parameter_list.emplace_back(std::move(parameter));
722 return std::make_unique<raw::ParameterList>(start, MarkLastUseful(), std::move(parameter_list));
725 std::unique_ptr<raw::InterfaceMethod> Parser::ParseInterfaceMethod(std::unique_ptr<raw::AttributeList> attributes) {
736 std::unique_ptr<raw::Identifier> method_name;
737 std::unique_ptr<raw::ParameterList> maybe_request;
738 std::unique_ptr<raw::ParameterList> maybe_response;
740 auto parse_params = [this](std::unique_ptr<raw::ParameterList>* params_out) {
777 return std::make_unique<raw::InterfaceMethod>(start, MarkLastUseful(),
778 std::move(attributes),
779 std::move(ordinal),
780 std::move(method_name),
781 std::move(maybe_request),
782 std::move(maybe_response));
785 std::unique_ptr<raw::InterfaceDeclaration>
786 Parser::ParseInterfaceDeclaration(std::unique_ptr<raw::AttributeList> attributes) {
787 std::vector<std::unique_ptr<raw::CompoundIdentifier>> superinterfaces;
788 std::vector<std::unique_ptr<raw::InterfaceMethod>> methods;
816 std::unique_ptr<raw::AttributeList> attributes = MaybeParseAttributeList();
826 methods.emplace_back(ParseInterfaceMethod(std::move(attributes)));
841 return std::make_unique<raw::InterfaceDeclaration>(start, MarkLastUseful(),
842 std::move(attributes), std::move(identifier),
843 std::move(superinterfaces),
844 std::move(methods));
847 std::unique_ptr<raw::StructMember> Parser::ParseStructMember() {
858 std::unique_ptr<raw::Constant> maybe_default_value;
873 return std::make_unique<raw::StructMember>(start, MarkLastUseful(),
874 std::move(type), std::move(identifier),
875 std::move(maybe_default_value), std::move(attributes));
878 std::unique_ptr<raw::StructDeclaration>
879 Parser::ParseStructDeclaration(std::unique_ptr<raw::AttributeList> attributes) {
880 std::vector<std::unique_ptr<raw::StructMember>> members;
919 return std::make_unique<raw::StructDeclaration>(start, MarkLastUseful(),
920 std::move(attributes), std::move(identifier),
921 std::move(members));
924 std::unique_ptr<raw::TableMember>
926 std::unique_ptr<raw::AttributeList> attributes = MaybeParseAttributeList();
939 return std::make_unique<raw::TableMember>(ordinal->start_, MarkLastUseful(), std::move(ordinal));
949 std::unique_ptr<raw::Constant> maybe_default_value;
965 return std::make_unique<raw::TableMember>(start, MarkLastUseful(), std::move(ordinal), std::move(type),
966 std::move(identifier),
967 std::move(maybe_default_value), std::move(attributes));
970 std::unique_ptr<raw::TableDeclaration>
971 Parser::ParseTableDeclaration(std::unique_ptr<raw::AttributeList> attributes) {
972 std::vector<std::unique_ptr<raw::TableMember>> members;
1010 return std::make_unique<raw::TableDeclaration>(start, MarkLastUseful(),
1011 std::move(attributes), std::move(identifier),
1012 std::move(members));
1015 std::unique_ptr<raw::UnionMember> Parser::ParseUnionMember() {
1032 return std::make_unique<raw::UnionMember>(start, MarkLastUseful(), std::move(type), std::move(identifier), std::move(attributes));
1035 std::unique_ptr<raw::UnionDeclaration>
1036 Parser::ParseUnionDeclaration(std::unique_ptr<raw::AttributeList> attributes) {
1037 std::vector<std::unique_ptr<raw::UnionMember>> members;
1076 return std::make_unique<raw::UnionDeclaration>(start, MarkLastUseful(),
1077 std::move(attributes), std::move(identifier),
1078 std::move(members));
1081 std::unique_ptr<raw::File> Parser::ParseFile() {
1082 std::vector<std::unique_ptr<raw::Using>> using_list;
1083 std::vector<std::unique_ptr<raw::ConstDeclaration>> const_declaration_list;
1084 std::vector<std::unique_ptr<raw::EnumDeclaration>> enum_declaration_list;
1085 std::vector<std::unique_ptr<raw::InterfaceDeclaration>> interface_declaration_list;
1086 std::vector<std::unique_ptr<raw::StructDeclaration>> struct_declaration_list;
1087 std::vector<std::unique_ptr<raw::TableDeclaration>> table_declaration_list;
1088 std::vector<std::unique_ptr<raw::UnionDeclaration>> union_declaration_list;
1125 std::unique_ptr<raw::AttributeList> attributes = MaybeParseAttributeList();
1134 const_declaration_list.emplace_back(ParseConstDeclaration(std::move(attributes)));
1138 enum_declaration_list.emplace_back(ParseEnumDeclaration(std::move(attributes)));
1143 ParseInterfaceDeclaration(std::move(attributes)));
1147 struct_declaration_list.emplace_back(ParseStructDeclaration(std::move(attributes)));
1151 table_declaration_list.emplace_back(ParseTableDeclaration(std::move(attributes)));
1155 union_declaration_list.emplace_back(ParseUnionDeclaration(std::move(attributes)));
1172 return std::make_unique<raw::File>(
1174 std::move(attributes), std::move(library_name), std::move(using_list), std::move(const_declaration_list),
1175 std::move(enum_declaration_list), std::move(interface_declaration_list),
1176 std::move(struct_declaration_list), std::move(table_declaration_list), std::move(union_declaration_list));