Lines Matching refs:TokenInfo
37 struct Parser::TokenInfo { struct in clang::ast_matchers::dynamic::Parser
56 TokenInfo() = default;
64 const char* const Parser::TokenInfo::ID_Bind = "bind";
82 const TokenInfo &peekNextToken() const { return NextToken; } in peekNextToken()
85 TokenInfo consumeNextToken() { in consumeNextToken()
86 TokenInfo ThisToken = NextToken; in consumeNextToken()
91 TokenInfo SkipNewlines() { in SkipNewlines()
92 while (NextToken.Kind == TokenInfo::TK_NewLine) in SkipNewlines()
97 TokenInfo consumeNextTokenIgnoreNewlines() { in consumeNextTokenIgnoreNewlines()
99 if (NextToken.Kind == TokenInfo::TK_Eof) in consumeNextTokenIgnoreNewlines()
104 TokenInfo::TokenKind nextTokenKind() const { return NextToken.Kind; } in nextTokenKind()
107 TokenInfo getNextToken() { in getNextToken()
109 TokenInfo Result; in getNextToken()
113 Result.Kind = TokenInfo::TK_CodeCompletion; in getNextToken()
120 Result.Kind = TokenInfo::TK_Eof; in getNextToken()
130 Result.Kind = TokenInfo::TK_Comma; in getNextToken()
135 Result.Kind = TokenInfo::TK_Period; in getNextToken()
142 Result.Kind = TokenInfo::TK_NewLine; in getNextToken()
147 Result.Kind = TokenInfo::TK_OpenParen; in getNextToken()
152 Result.Kind = TokenInfo::TK_CloseParen; in getNextToken()
179 Result.Kind = TokenInfo::TK_CodeCompletion; in getNextToken()
189 Result.Kind = TokenInfo::TK_Literal; in getNextToken()
192 Result.Kind = TokenInfo::TK_Literal; in getNextToken()
195 Result.Kind = TokenInfo::TK_Ident; in getNextToken()
200 Result.Kind = TokenInfo::TK_InvalidChar; in getNextToken()
212 void consumeNumberLiteral(TokenInfo *Result) { in consumeNumberLiteral()
244 Result->Kind = TokenInfo::TK_Literal; in consumeNumberLiteral()
251 Result->Kind = TokenInfo::TK_Literal; in consumeNumberLiteral()
261 Result->Kind = TokenInfo::TK_Error; in consumeNumberLiteral()
268 void consumeStringLiteral(TokenInfo *Result) { in consumeStringLiteral()
281 Result->Kind = TokenInfo::TK_Literal; in consumeStringLiteral()
295 Result->Kind = TokenInfo::TK_Error; in consumeStringLiteral()
317 TokenInfo NextToken;
355 const TokenInfo NameToken = Tokenizer->consumeNextToken(); in parseIdentifierPrefixImpl()
357 if (Tokenizer->nextTokenKind() != TokenInfo::TK_OpenParen) { in parseIdentifierPrefixImpl()
363 if (Tokenizer->nextTokenKind() != TokenInfo::TK_Period) { in parseIdentifierPrefixImpl()
385 if (Tokenizer->nextTokenKind() == TokenInfo::TK_NewLine) { in parseIdentifierPrefixImpl()
394 if ((Tokenizer->nextTokenKind() == TokenInfo::TK_Comma || in parseIdentifierPrefixImpl()
395 Tokenizer->nextTokenKind() == TokenInfo::TK_CloseParen || in parseIdentifierPrefixImpl()
396 Tokenizer->nextTokenKind() == TokenInfo::TK_NewLine || in parseIdentifierPrefixImpl()
397 Tokenizer->nextTokenKind() == TokenInfo::TK_Eof) && in parseIdentifierPrefixImpl()
414 assert(Tokenizer->peekNextToken().Kind == TokenInfo::TK_Period); in parseBindID()
416 const TokenInfo BindToken = Tokenizer->consumeNextToken(); in parseBindID()
417 if (BindToken.Kind == TokenInfo::TK_CodeCompletion) { in parseBindID()
422 const TokenInfo OpenToken = Tokenizer->consumeNextToken(); in parseBindID()
423 const TokenInfo IDToken = Tokenizer->consumeNextTokenIgnoreNewlines(); in parseBindID()
424 const TokenInfo CloseToken = Tokenizer->consumeNextTokenIgnoreNewlines(); in parseBindID()
428 if (BindToken.Kind != TokenInfo::TK_Ident || in parseBindID()
429 BindToken.Text != TokenInfo::ID_Bind) { in parseBindID()
433 if (OpenToken.Kind != TokenInfo::TK_OpenParen) { in parseBindID()
437 if (IDToken.Kind != TokenInfo::TK_Literal || !IDToken.Value.isString()) { in parseBindID()
441 if (CloseToken.Kind != TokenInfo::TK_CloseParen) { in parseBindID()
453 bool Parser::parseMatcherExpressionImpl(const TokenInfo &NameToken, in parseMatcherExpressionImpl()
455 assert(NameToken.Kind == TokenInfo::TK_Ident); in parseMatcherExpressionImpl()
456 const TokenInfo OpenToken = Tokenizer->consumeNextToken(); in parseMatcherExpressionImpl()
457 if (OpenToken.Kind != TokenInfo::TK_OpenParen) { in parseMatcherExpressionImpl()
472 TokenInfo EndToken; in parseMatcherExpressionImpl()
479 while (Tokenizer->nextTokenKind() != TokenInfo::TK_Eof) { in parseMatcherExpressionImpl()
480 if (Tokenizer->nextTokenKind() == TokenInfo::TK_CloseParen) { in parseMatcherExpressionImpl()
487 const TokenInfo CommaToken = Tokenizer->consumeNextToken(); in parseMatcherExpressionImpl()
488 if (CommaToken.Kind != TokenInfo::TK_Comma) { in parseMatcherExpressionImpl()
512 if (EndToken.Kind == TokenInfo::TK_Eof) { in parseMatcherExpressionImpl()
518 if (Tokenizer->peekNextToken().Kind == TokenInfo::TK_Period) { in parseMatcherExpressionImpl()
541 void Parser::addCompletion(const TokenInfo &CompToken, in addCompletion()
566 const TokenInfo CompToken = Tokenizer->consumeNextTokenIgnoreNewlines(); in addExpressionCompletions()
567 assert(CompToken.Kind == TokenInfo::TK_CodeCompletion); in addExpressionCompletions()
591 case TokenInfo::TK_Literal: in parseExpressionImpl()
595 case TokenInfo::TK_Ident: in parseExpressionImpl()
598 case TokenInfo::TK_CodeCompletion: in parseExpressionImpl()
602 case TokenInfo::TK_Eof: in parseExpressionImpl()
607 case TokenInfo::TK_Error: in parseExpressionImpl()
610 case TokenInfo::TK_NewLine: in parseExpressionImpl()
611 case TokenInfo::TK_OpenParen: in parseExpressionImpl()
612 case TokenInfo::TK_CloseParen: in parseExpressionImpl()
613 case TokenInfo::TK_Comma: in parseExpressionImpl()
614 case TokenInfo::TK_Period: in parseExpressionImpl()
615 case TokenInfo::TK_InvalidChar: in parseExpressionImpl()
616 const TokenInfo Token = Tokenizer->consumeNextToken(); in parseExpressionImpl()
618 << (Token.Kind == TokenInfo::TK_NewLine ? "NewLine" : Token.Text); in parseExpressionImpl()
667 if (NT.Kind != TokenInfo::TK_Eof && NT.Kind != TokenInfo::TK_NewLine) { in parseExpression()