Lines Matching refs:FormatToken
21 SMLoc FormatToken::getLoc() const { in getLoc()
34 FormatToken FormatLexer::emitError(SMLoc loc, const Twine &msg) { in emitError()
38 return formToken(FormatToken::error, loc.getPointer()); in emitError()
41 FormatToken FormatLexer::emitError(const char *loc, const Twine &msg) { in emitError()
45 FormatToken FormatLexer::emitErrorAndNote(SMLoc loc, const Twine &msg, in emitErrorAndNote()
51 return formToken(FormatToken::error, loc.getPointer()); in emitErrorAndNote()
80 FormatToken FormatLexer::lexToken() { in lexToken()
95 return formToken(FormatToken::eof, tokStart); in lexToken()
99 return formToken(FormatToken::caret, tokStart); in lexToken()
101 return formToken(FormatToken::colon, tokStart); in lexToken()
103 return formToken(FormatToken::comma, tokStart); in lexToken()
105 return formToken(FormatToken::equal, tokStart); in lexToken()
107 return formToken(FormatToken::less, tokStart); in lexToken()
109 return formToken(FormatToken::greater, tokStart); in lexToken()
111 return formToken(FormatToken::question, tokStart); in lexToken()
113 return formToken(FormatToken::l_paren, tokStart); in lexToken()
115 return formToken(FormatToken::r_paren, tokStart); in lexToken()
117 return formToken(FormatToken::star, tokStart); in lexToken()
119 return formToken(FormatToken::pipe, tokStart); in lexToken()
135 FormatToken FormatLexer::lexLiteral(const char *tokStart) { in lexLiteral()
141 return formToken(FormatToken::literal, tokStart); in lexLiteral()
146 FormatToken FormatLexer::lexVariable(const char *tokStart) { in lexVariable()
153 return formToken(FormatToken::variable, tokStart); in lexVariable()
156 FormatToken FormatLexer::lexIdentifier(const char *tokStart) { in lexIdentifier()
164 StringSwitch<FormatToken::Kind>(str) in lexIdentifier()
165 .Case("attr-dict", FormatToken::kw_attr_dict) in lexIdentifier()
166 .Case("attr-dict-with-keyword", FormatToken::kw_attr_dict_w_keyword) in lexIdentifier()
167 .Case("custom", FormatToken::kw_custom) in lexIdentifier()
168 .Case("functional-type", FormatToken::kw_functional_type) in lexIdentifier()
169 .Case("oilist", FormatToken::kw_oilist) in lexIdentifier()
170 .Case("operands", FormatToken::kw_operands) in lexIdentifier()
171 .Case("params", FormatToken::kw_params) in lexIdentifier()
172 .Case("ref", FormatToken::kw_ref) in lexIdentifier()
173 .Case("regions", FormatToken::kw_regions) in lexIdentifier()
174 .Case("results", FormatToken::kw_results) in lexIdentifier()
175 .Case("struct", FormatToken::kw_struct) in lexIdentifier()
176 .Case("successors", FormatToken::kw_successors) in lexIdentifier()
177 .Case("type", FormatToken::kw_type) in lexIdentifier()
178 .Case("qualified", FormatToken::kw_qualified) in lexIdentifier()
179 .Default(FormatToken::identifier); in lexIdentifier()
180 return FormatToken(kind, str); in lexIdentifier()
196 while (curToken.getKind() != FormatToken::eof) { in parse()
213 if (curToken.is(FormatToken::literal)) in parseElement()
215 if (curToken.is(FormatToken::variable)) in parseElement()
219 if (curToken.is(FormatToken::l_paren)) in parseElement()
226 FormatToken tok = curToken; in parseLiteral()
257 FormatToken tok = curToken; in parseVariable()
267 FormatToken tok = curToken; in parseDirective()
271 if (tok.is(FormatToken::kw_custom)) in parseDirective()
292 if (curToken.is(FormatToken::caret)) { in parseOptionalGroup()
300 } while (!curToken.is(FormatToken::r_paren)); in parseOptionalGroup()
304 if (curToken.is(FormatToken::colon)) { in parseOptionalGroup()
307 parseToken(FormatToken::l_paren, in parseOptionalGroup()
315 } while (!curToken.is(FormatToken::r_paren)); in parseOptionalGroup()
318 if (failed(parseToken(FormatToken::question, in parseOptionalGroup()
352 FailureOr<FormatToken> nameTok; in parseCustomDirective()
353 if (failed(parseToken(FormatToken::less, in parseCustomDirective()
356 parseToken(FormatToken::identifier, in parseCustomDirective()
358 failed(parseToken(FormatToken::greater, in parseCustomDirective()
360 failed(parseToken(FormatToken::l_paren, in parseCustomDirective()
371 if (!curToken.is(FormatToken::comma)) in parseCustomDirective()
376 if (failed(parseToken(FormatToken::r_paren, in parseCustomDirective()