Lines Matching refs:Token
46 case Token::kw_affine_map: { in parseAttribute()
47 consumeToken(Token::kw_affine_map); in parseAttribute()
50 if (parseToken(Token::less, "expected '<' in affine map") || in parseAttribute()
52 parseToken(Token::greater, "expected '>' in affine map")) in parseAttribute()
56 case Token::kw_affine_set: { in parseAttribute()
57 consumeToken(Token::kw_affine_set); in parseAttribute()
60 if (parseToken(Token::less, "expected '<' in integer set") || in parseAttribute()
62 parseToken(Token::greater, "expected '>' in integer set")) in parseAttribute()
68 case Token::l_square: { in parseAttribute()
69 consumeToken(Token::l_square); in parseAttribute()
77 if (parseCommaSeparatedListUntil(Token::r_square, parseElt)) in parseAttribute()
83 case Token::kw_false: in parseAttribute()
84 consumeToken(Token::kw_false); in parseAttribute()
86 case Token::kw_true: in parseAttribute()
87 consumeToken(Token::kw_true); in parseAttribute()
91 case Token::kw_dense: in parseAttribute()
95 case Token::l_brace: { in parseAttribute()
103 case Token::hash_identifier: in parseAttribute()
107 case Token::floatliteral: in parseAttribute()
109 case Token::integer: in parseAttribute()
111 case Token::minus: { in parseAttribute()
112 consumeToken(Token::minus); in parseAttribute()
113 if (getToken().is(Token::integer)) in parseAttribute()
115 if (getToken().is(Token::floatliteral)) in parseAttribute()
123 case Token::kw_loc: { in parseAttribute()
124 consumeToken(Token::kw_loc); in parseAttribute()
127 if (parseToken(Token::l_paren, "expected '(' in inline location") || in parseAttribute()
129 parseToken(Token::r_paren, "expected ')' in inline location")) in parseAttribute()
135 case Token::kw_opaque: in parseAttribute()
139 case Token::kw_sparse: in parseAttribute()
143 case Token::string: { in parseAttribute()
145 consumeToken(Token::string); in parseAttribute()
147 if (!type && consumeIf(Token::colon) && !(type = parseType())) in parseAttribute()
155 case Token::at_identifier: { in parseAttribute()
157 consumeToken(Token::at_identifier); in parseAttribute()
161 while (getToken().is(Token::colon)) { in parseAttribute()
164 consumeToken(Token::colon); in parseAttribute()
165 if (!consumeIf(Token::colon)) { in parseAttribute()
172 if (getToken().isNot(Token::at_identifier)) { in parseAttribute()
178 consumeToken(Token::at_identifier); in parseAttribute()
186 case Token::kw_unit: in parseAttribute()
187 consumeToken(Token::kw_unit); in parseAttribute()
202 case Token::at_identifier: in parseOptionalAttribute()
203 case Token::floatliteral: in parseOptionalAttribute()
204 case Token::integer: in parseOptionalAttribute()
205 case Token::hash_identifier: in parseOptionalAttribute()
206 case Token::kw_affine_map: in parseOptionalAttribute()
207 case Token::kw_affine_set: in parseOptionalAttribute()
208 case Token::kw_dense: in parseOptionalAttribute()
209 case Token::kw_false: in parseOptionalAttribute()
210 case Token::kw_loc: in parseOptionalAttribute()
211 case Token::kw_opaque: in parseOptionalAttribute()
212 case Token::kw_sparse: in parseOptionalAttribute()
213 case Token::kw_true: in parseOptionalAttribute()
214 case Token::kw_unit: in parseOptionalAttribute()
215 case Token::l_brace: in parseOptionalAttribute()
216 case Token::l_square: in parseOptionalAttribute()
217 case Token::minus: in parseOptionalAttribute()
218 case Token::string: in parseOptionalAttribute()
233 return parseOptionalAttributeWithToken(Token::l_square, attribute, type); in parseOptionalAttribute()
237 return parseOptionalAttributeWithToken(Token::string, attribute, type); in parseOptionalAttribute()
247 if (parseToken(Token::l_brace, "expected '{' in attribute dictionary")) in parseAttributeDict()
254 if (getToken().is(Token::string)) in parseAttributeDict()
256 else if (getToken().isAny(Token::bare_identifier, Token::inttype) || in parseAttributeDict()
272 if (!consumeIf(Token::equal)) { in parseAttributeDict()
285 if (parseCommaSeparatedListUntil(Token::r_brace, parseElt)) in parseAttributeDict()
296 consumeToken(Token::floatliteral); in parseFloatAttr()
299 if (!consumeIf(Token::colon)) in parseFloatAttr()
372 consumeToken(Token::integer); in parseDecOrHexAttr()
375 if (!consumeIf(Token::colon)) in parseDecOrHexAttr()
394 auto val = Token::getUInt64IntegerValue(spelling); in parseDecOrHexAttr()
427 static ParseResult parseElementAttrHexValues(Parser &parser, Token tok, in parseElementAttrHexValues()
493 std::vector<std::pair<bool, Token>> storage;
496 Optional<Token> hexStorage;
504 if (allowHex && p.getToken().is(Token::string)) { in parse()
506 p.consumeToken(Token::string); in parse()
510 if (p.getToken().is(Token::l_square)) in parse()
582 const Token &token = signAndToken.second; in getIntAttrElements()
591 if (token.is(Token::floatliteral)) { in getIntAttrElements()
596 assert(token.isAny(Token::integer, Token::kw_true, Token::kw_false) && in getIntAttrElements()
598 if (token.isAny(Token::kw_true, Token::kw_false)) { in getIntAttrElements()
603 APInt apInt(1, token.is(Token::kw_true), /*isSigned=*/false); in getIntAttrElements()
625 const Token &token = signAndToken.second; in getFloatAttrElements()
628 if (token.is(Token::integer) && token.getSpelling().startswith("0x")) { in getFloatAttrElements()
646 if (!token.is(Token::floatliteral)) in getFloatAttrElements()
731 case Token::kw_true: in parseElement()
732 case Token::kw_false: in parseElement()
733 case Token::floatliteral: in parseElement()
734 case Token::integer: in parseElement()
740 case Token::minus: in parseElement()
741 p.consumeToken(Token::minus); in parseElement()
742 if (!p.getToken().isAny(Token::floatliteral, Token::integer)) in parseElement()
748 case Token::string: in parseElement()
754 case Token::l_paren: in parseElement()
755 p.consumeToken(Token::l_paren); in parseElement()
757 p.parseToken(Token::comma, "expected ',' between complex elements") || in parseElement()
759 p.parseToken(Token::r_paren, "expected ')' after complex elements")) in parseElement()
777 p.consumeToken(Token::l_square); in parseList()
792 if (p.getToken().getKind() == Token::l_square) { in parseList()
805 if (p.parseCommaSeparatedListUntil(Token::r_square, parseCommaSeparatedList)) in parseList()
822 consumeToken(Token::kw_dense); in parseDenseElementsAttr()
823 if (parseToken(Token::less, "expected '<' after 'dense'")) in parseDenseElementsAttr()
828 if (!consumeIf(Token::greater)) { in parseDenseElementsAttr()
830 parseToken(Token::greater, "expected '>'")) in parseDenseElementsAttr()
846 consumeToken(Token::kw_opaque); in parseOpaqueElementsAttr()
847 if (parseToken(Token::less, "expected '<' after 'opaque'")) in parseOpaqueElementsAttr()
850 if (getToken().isNot(Token::string)) in parseOpaqueElementsAttr()
863 consumeToken(Token::string); in parseOpaqueElementsAttr()
865 if (parseToken(Token::comma, "expected ','")) in parseOpaqueElementsAttr()
868 Token hexTok = getToken(); in parseOpaqueElementsAttr()
869 if (parseToken(Token::string, "elements hex string should start with '0x'") || in parseOpaqueElementsAttr()
870 parseToken(Token::greater, "expected '>'")) in parseOpaqueElementsAttr()
890 if (parseToken(Token::colon, "expected ':'")) in parseElementsLiteralType()
910 consumeToken(Token::kw_sparse); in parseSparseElementsAttr()
911 if (parseToken(Token::less, "Expected '<' after 'sparse'")) in parseSparseElementsAttr()
918 if (consumeIf(Token::greater)) { in parseSparseElementsAttr()
940 if (parseToken(Token::comma, "expected ','")) in parseSparseElementsAttr()
949 if (parseToken(Token::greater, "expected '>'")) in parseSparseElementsAttr()