/external/python/cpython3/Parser/ |
D | tokenizer.c | 47 static int tok_nextc(struct tok_state *tok); 48 static void tok_backup(struct tok_state *tok, int c); 122 struct tok_state *tok = (struct tok_state *)PyMem_MALLOC( in tok_new() local 124 if (tok == NULL) in tok_new() 126 tok->buf = tok->cur = tok->end = tok->inp = tok->start = NULL; in tok_new() 127 tok->done = E_OK; in tok_new() 128 tok->fp = NULL; in tok_new() 129 tok->input = NULL; in tok_new() 130 tok->tabsize = TABSIZE; in tok_new() 131 tok->indent = 0; in tok_new() [all …]
|
/external/python/cpython2/Parser/ |
D | tokenizer.c | 32 static int tok_nextc(struct tok_state *tok); 33 static void tok_backup(struct tok_state *tok, int c); 100 struct tok_state *tok = (struct tok_state *)PyMem_MALLOC( in tok_new() local 102 if (tok == NULL) in tok_new() 104 tok->buf = tok->cur = tok->end = tok->inp = tok->start = NULL; in tok_new() 105 tok->done = E_OK; in tok_new() 106 tok->fp = NULL; in tok_new() 107 tok->input = NULL; in tok_new() 108 tok->tabsize = TABSIZE; in tok_new() 109 tok->indent = 0; in tok_new() [all …]
|
D | parsetok.c | 50 struct tok_state *tok; in PyParser_ParseStringFlagsFilenameEx() local 54 if ((tok = PyTokenizer_FromString(s, start == file_input)) == NULL) { in PyParser_ParseStringFlagsFilenameEx() 59 tok->filename = filename ? filename : "<string>"; in PyParser_ParseStringFlagsFilenameEx() 61 tok->altwarning = (tok->filename != NULL); in PyParser_ParseStringFlagsFilenameEx() 63 tok->alterror++; in PyParser_ParseStringFlagsFilenameEx() 66 return parsetok(tok, g, start, err_ret, flags); in PyParser_ParseStringFlagsFilenameEx() 91 struct tok_state *tok; in PyParser_ParseFileFlagsEx() local 95 if ((tok = PyTokenizer_FromFile(fp, ps1, ps2)) == NULL) { in PyParser_ParseFileFlagsEx() 99 tok->filename = filename; in PyParser_ParseFileFlagsEx() 101 tok->altwarning = (filename != NULL); in PyParser_ParseFileFlagsEx() [all …]
|
/external/clang/lib/Parse/ |
D | ParseTentative.cpp | 53 case tok::kw_asm: in isCXXDeclarationStatement() 55 case tok::kw_namespace: in isCXXDeclarationStatement() 58 case tok::kw_using: in isCXXDeclarationStatement() 60 case tok::kw_static_assert: in isCXXDeclarationStatement() 61 case tok::kw__Static_assert: in isCXXDeclarationStatement() 150 case tok::kw__Atomic: in TryConsumeDeclarationSpecifier() 151 if (NextToken().isNot(tok::l_paren)) { in TryConsumeDeclarationSpecifier() 156 case tok::kw_typeof: in TryConsumeDeclarationSpecifier() 157 case tok::kw___attribute: in TryConsumeDeclarationSpecifier() 158 case tok::kw___underlying_type: { in TryConsumeDeclarationSpecifier() [all …]
|
D | ParseDecl.cpp | 128 assert(Tok.is(tok::kw___attribute) && "Not a GNU attribute list!"); in ParseGNUAttributes() 130 while (Tok.is(tok::kw___attribute)) { in ParseGNUAttributes() 132 if (ExpectAndConsume(tok::l_paren, diag::err_expected_lparen_after, in ParseGNUAttributes() 134 SkipUntil(tok::r_paren, StopAtSemi); // skip until ) or ; in ParseGNUAttributes() 137 if (ExpectAndConsume(tok::l_paren, diag::err_expected_lparen_after, "(")) { in ParseGNUAttributes() 138 SkipUntil(tok::r_paren, StopAtSemi); // skip until ) or ; in ParseGNUAttributes() 144 if (TryConsumeToken(tok::comma)) in ParseGNUAttributes() 156 if (Tok.isNot(tok::l_paren)) { in ParseGNUAttributes() 180 ConsumeAndStoreUntil(tok::r_paren, LA->Toks, true, false); in ParseGNUAttributes() 188 if (ExpectAndConsume(tok::r_paren)) in ParseGNUAttributes() [all …]
|
D | ParseObjc.cpp | 28 void Parser::MaybeSkipAttributes(tok::ObjCKeywordKind Kind) { in MaybeSkipAttributes() 30 if (Tok.is(tok::kw___attribute)) { in MaybeSkipAttributes() 31 if (Kind == tok::objc_interface || Kind == tok::objc_protocol) in MaybeSkipAttributes() 33 << (Kind == tok::objc_protocol); in MaybeSkipAttributes() 51 if (Tok.is(tok::code_completion)) { in ParseObjCAtDirectives() 59 case tok::objc_class: in ParseObjCAtDirectives() 61 case tok::objc_interface: { in ParseObjCAtDirectives() 66 case tok::objc_protocol: { in ParseObjCAtDirectives() 70 case tok::objc_implementation: in ParseObjCAtDirectives() 72 case tok::objc_end: in ParseObjCAtDirectives() [all …]
|
D | ParseExpr.cpp | 150 LHS = Actions.ActOnUnaryOp(getCurScope(), ExtLoc, tok::kw___extension__, in ParseExpressionWithLeadingExtension() 158 if (Tok.is(tok::code_completion)) { in ParseAssignmentExpression() 164 if (Tok.is(tok::kw_throw)) in ParseAssignmentExpression() 166 if (Tok.is(tok::kw_co_yield)) in ParseAssignmentExpression() 229 tok::TokenKind K = Tok.getKind(); in isNotExpressionStart() 230 if (K == tok::l_brace || K == tok::r_brace || in isNotExpressionStart() 231 K == tok::kw_for || K == tok::kw_while || in isNotExpressionStart() 232 K == tok::kw_if || K == tok::kw_else || in isNotExpressionStart() 233 K == tok::kw_goto || K == tok::kw_try) in isNotExpressionStart() 242 static bool isFoldOperator(tok::TokenKind Kind) { in isFoldOperator() [all …]
|
D | ParseTemplate.cpp | 34 if (Tok.is(tok::kw_template) && NextToken().isNot(tok::less)) { in ParseDeclarationStartingWithTemplate() 65 assert(Tok.isOneOf(tok::kw_export, tok::kw_template) && in ParseTemplateDeclarationOrSpecialization() 105 TryConsumeToken(tok::kw_export, ExportLoc); in ParseTemplateDeclarationOrSpecialization() 109 if (!TryConsumeToken(tok::kw_template, TemplateLoc)) { in ParseTemplateDeclarationOrSpecialization() 120 SkipUntil(tok::r_brace, StopAtSemi | StopBeforeMatch); in ParseTemplateDeclarationOrSpecialization() 121 TryConsumeToken(tok::semi); in ParseTemplateDeclarationOrSpecialization() 130 if (TryConsumeToken(tok::kw_requires)) { in ParseTemplateDeclarationOrSpecialization() 135 SkipUntil(tok::r_brace, StopAtSemi | StopBeforeMatch); in ParseTemplateDeclarationOrSpecialization() 136 TryConsumeToken(tok::semi); in ParseTemplateDeclarationOrSpecialization() 147 } while (Tok.isOneOf(tok::kw_export, tok::kw_template)); in ParseTemplateDeclarationOrSpecialization() [all …]
|
D | ParseCXXInlineMethods.cpp | 32 assert(Tok.isOneOf(tok::l_brace, tok::colon, tok::kw_try, tok::equal) && in ParseCXXInlineMethodDef() 60 if (TryConsumeToken(tok::equal)) { in ParseCXXInlineMethodDef() 62 SkipUntil(tok::semi); in ParseCXXInlineMethodDef() 69 if (TryConsumeToken(tok::kw_delete, KWLoc)) { in ParseCXXInlineMethodDef() 79 } else if (TryConsumeToken(tok::kw_default, KWLoc)) { in ParseCXXInlineMethodDef() 92 if (Tok.is(tok::comma)) { in ParseCXXInlineMethodDef() 95 SkipUntil(tok::semi); in ParseCXXInlineMethodDef() 96 } else if (ExpectAndConsume(tok::semi, diag::err_expected_after, in ParseCXXInlineMethodDef() 98 SkipUntil(tok::semi); in ParseCXXInlineMethodDef() 142 tok::TokenKind kind = Tok.getKind(); in ParseCXXInlineMethodDef() [all …]
|
D | ParseDeclCXX.cpp | 61 assert(Tok.is(tok::kw_namespace) && "Not a namespace!"); in ParseNamespace() 65 if (Tok.is(tok::code_completion)) { in ParseNamespace() 87 if (Tok.is(tok::identifier)) { in ParseNamespace() 90 while (Tok.is(tok::coloncolon) && NextToken().is(tok::identifier)) { in ParseNamespace() 102 if (Tok.is(tok::kw___attribute)) { in ParseNamespace() 107 if (Tok.is(tok::equal)) { in ParseNamespace() 109 Diag(Tok, diag::err_expected) << tok::identifier; in ParseNamespace() 111 SkipUntil(tok::semi); in ParseNamespace() 123 BalancedDelimiterTracker T(*this, tok::l_brace); in ParseNamespace() 126 Diag(Tok, diag::err_expected) << tok::l_brace; in ParseNamespace() [all …]
|
D | ParseStmt.cpp | 129 WantTypeSpecifiers = nextTok.isOneOf(tok::l_paren, tok::less, tok::l_square, in StatementFilterCCC() 130 tok::identifier, tok::star, tok::amp); in StatementFilterCCC() 132 nextTok.isOneOf(tok::l_paren, tok::identifier, tok::arrow, tok::period); in StatementFilterCCC() 134 nextTok.isOneOf(tok::l_paren, tok::semi, tok::identifier, tok::l_brace); in StatementFilterCCC() 141 if (NextToken.is(tok::equal)) in ValidateCandidate() 143 if (NextToken.is(tok::period) && in ValidateCandidate() 165 tok::TokenKind Kind = Tok.getKind(); in ParseStatementOrDeclarationAfterAttributes() 168 case tok::at: // May be a @try or @throw statement in ParseStatementOrDeclarationAfterAttributes() 175 case tok::code_completion: in ParseStatementOrDeclarationAfterAttributes() 180 case tok::identifier: { in ParseStatementOrDeclarationAfterAttributes() [all …]
|
D | Parser.cpp | 78 Tok.setKind(tok::eof); in Parser() 123 static bool IsCommonTypo(tok::TokenKind ExpectedTok, const Token &Tok) { in IsCommonTypo() 125 case tok::semi: in IsCommonTypo() 126 return Tok.is(tok::colon) || Tok.is(tok::comma); // : or , for ; in IsCommonTypo() 131 bool Parser::ExpectAndConsume(tok::TokenKind ExpectedTok, unsigned DiagID, in ExpectAndConsume() 133 if (Tok.is(ExpectedTok) || Tok.is(tok::code_completion)) { in ExpectAndConsume() 144 SourceRange(Loc), tok::getPunctuatorSpelling(ExpectedTok)); in ExpectAndConsume() 161 Spelling = tok::getPunctuatorSpelling(ExpectedTok); in ExpectAndConsume() 178 if (TryConsumeToken(tok::semi)) in ExpectAndConsumeSemi() 181 if (Tok.is(tok::code_completion)) { in ExpectAndConsumeSemi() [all …]
|
D | ParseOpenMP.cpp | 149 if (Tok.is(tok::kw_operator)) { in parseOpenMPReductionId() 155 case tok::plus: // '+' in parseOpenMPReductionId() 158 case tok::minus: // '-' in parseOpenMPReductionId() 161 case tok::star: // '*' in parseOpenMPReductionId() 164 case tok::amp: // '&' in parseOpenMPReductionId() 167 case tok::pipe: // '|' in parseOpenMPReductionId() 170 case tok::caret: // '^' in parseOpenMPReductionId() 173 case tok::ampamp: // '&&' in parseOpenMPReductionId() 176 case tok::pipepipe: // '||' in parseOpenMPReductionId() 179 case tok::identifier: // identifier in parseOpenMPReductionId() [all …]
|
D | ParseExprCXX.cpp | 28 static int SelectDigraphErrorMessage(tok::TokenKind Kind) { in SelectDigraphErrorMessage() 31 case tok::unknown: return 0; in SelectDigraphErrorMessage() 33 case tok::kw_const_cast: return 1; in SelectDigraphErrorMessage() 34 case tok::kw_dynamic_cast: return 2; in SelectDigraphErrorMessage() 35 case tok::kw_reinterpret_cast: return 3; in SelectDigraphErrorMessage() 36 case tok::kw_static_cast: return 4; in SelectDigraphErrorMessage() 52 Token &ColonToken, tok::TokenKind Kind, bool AtDigraph) { in FixDigraph() 66 ColonToken.setKind(tok::coloncolon); in FixDigraph() 69 DigraphToken.setKind(tok::less); in FixDigraph() 83 if (!Next.is(tok::l_square) || Next.getLength() != 2) in CheckForTemplateAndDigraph() [all …]
|
/external/clang/lib/Lex/ |
D | TokenConcatenation.cpp | 74 TokenInfo[tok::identifier ] |= aci_custom; in TokenConcatenation() 75 TokenInfo[tok::numeric_constant] |= aci_custom_firstchar; in TokenConcatenation() 76 TokenInfo[tok::period ] |= aci_custom_firstchar; in TokenConcatenation() 77 TokenInfo[tok::amp ] |= aci_custom_firstchar; in TokenConcatenation() 78 TokenInfo[tok::plus ] |= aci_custom_firstchar; in TokenConcatenation() 79 TokenInfo[tok::minus ] |= aci_custom_firstchar; in TokenConcatenation() 80 TokenInfo[tok::slash ] |= aci_custom_firstchar; in TokenConcatenation() 81 TokenInfo[tok::less ] |= aci_custom_firstchar; in TokenConcatenation() 82 TokenInfo[tok::greater ] |= aci_custom_firstchar; in TokenConcatenation() 83 TokenInfo[tok::pipe ] |= aci_custom_firstchar; in TokenConcatenation() [all …]
|
/external/clang/lib/Format/ |
D | TokenAnnotator.cpp | 39 Contexts.push_back(Context(tok::unknown, 1, /*IsExpression=*/false)); in AnnotatingParser() 54 if (Previous.Previous->is(tok::r_paren) && Contexts.size() > 1 && in parseAngle() 62 ScopedContextCreator ContextCreator(*this, tok::less, 12); in parseAngle() 72 Left->Previous && Left->Previous->Tok.isNot(tok::kw_template); in parseAngle() 75 CurrentToken->is(tok::question)) in parseAngle() 79 if (CurrentToken->is(tok::greater)) { in parseAngle() 86 if (CurrentToken->is(tok::question) && in parseAngle() 91 if (CurrentToken->isOneOf(tok::r_paren, tok::r_square, tok::r_brace) || in parseAngle() 92 (CurrentToken->isOneOf(tok::colon, tok::question) && InExprContext)) in parseAngle() 100 if (CurrentToken->Previous->isOneOf(tok::pipepipe, tok::ampamp) && in parseAngle() [all …]
|
D | UnwrappedLineParser.cpp | 102 FormatTok.Tok.setKind(tok::eof); in getFakeEOF() 270 tok::TokenKind kind = FormatTok->Tok.getKind(); in parseLevel() 272 kind = tok::l_brace; in parseLevel() 274 kind = tok::r_brace; in parseLevel() 278 case tok::comment: in parseLevel() 282 case tok::l_brace: in parseLevel() 290 case tok::r_brace: in parseLevel() 296 case tok::kw_default: in parseLevel() 297 case tok::kw_case: in parseLevel() 323 assert(Tok->Tok.is(tok::l_brace)); in calculateBraceTypes() [all …]
|
/external/clang/lib/Basic/ |
D | OperatorPrecedence.cpp | 18 prec::Level getBinOpPrecedence(tok::TokenKind Kind, bool GreaterThanIsOperator, in getBinOpPrecedence() 21 case tok::greater: in getBinOpPrecedence() 30 case tok::greatergreater: in getBinOpPrecedence() 42 case tok::comma: return prec::Comma; in getBinOpPrecedence() 43 case tok::equal: in getBinOpPrecedence() 44 case tok::starequal: in getBinOpPrecedence() 45 case tok::slashequal: in getBinOpPrecedence() 46 case tok::percentequal: in getBinOpPrecedence() 47 case tok::plusequal: in getBinOpPrecedence() 48 case tok::minusequal: in getBinOpPrecedence() [all …]
|
/external/clang/unittests/AST/ |
D | CommentLexer.cpp | 72 if (Tok.is(tok::eof)) in lexString() 102 ASSERT_EQ(tok::newline, Toks[0].getKind()); in TEST_F() 118 ASSERT_EQ(tok::newline, Toks[0].getKind()); in TEST_F() 119 ASSERT_EQ(tok::newline, Toks[1].getKind()); in TEST_F() 137 ASSERT_EQ(tok::text, Toks[0].getKind()); in TEST_F() 140 ASSERT_EQ(tok::newline, Toks[1].getKind()); in TEST_F() 157 ASSERT_EQ(tok::text, Toks[0].getKind()); in TEST_F() 160 ASSERT_EQ(tok::newline, Toks[1].getKind()); in TEST_F() 161 ASSERT_EQ(tok::newline, Toks[2].getKind()); in TEST_F() 180 ASSERT_EQ(tok::text, Toks[0].getKind()); in TEST_F() [all …]
|
/external/expat/lib/ |
D | xmlrole.c | 124 int tok, 147 static int FASTCALL common(PROLOG_STATE *state, int tok); 151 int tok, in prolog0() argument 156 switch (tok) { in prolog0() 183 return common(state, tok); in prolog0() 188 int tok, in prolog1() argument 193 switch (tok) { in prolog1() 221 return common(state, tok); in prolog1() 226 int tok, in prolog2() argument 231 switch (tok) { in prolog2() [all …]
|
/external/python/cpython3/Modules/expat/ |
D | xmlrole.c | 124 int tok, 147 static int FASTCALL common(PROLOG_STATE *state, int tok); 151 int tok, in prolog0() argument 156 switch (tok) { in prolog0() 183 return common(state, tok); in prolog0() 188 int tok, in prolog1() argument 193 switch (tok) { in prolog1() 221 return common(state, tok); in prolog1() 226 int tok, in prolog2() argument 231 switch (tok) { in prolog2() [all …]
|
/external/python/cpython2/Modules/expat/ |
D | xmlrole.c | 124 int tok, 147 static int FASTCALL common(PROLOG_STATE *state, int tok); 151 int tok, in prolog0() argument 156 switch (tok) { in prolog0() 183 return common(state, tok); in prolog0() 188 int tok, in prolog1() argument 193 switch (tok) { in prolog1() 221 return common(state, tok); in prolog1() 226 int tok, in prolog2() argument 231 switch (tok) { in prolog2() [all …]
|
/external/libxml2/ |
D | threads.c | 179 xmlMutexPtr tok; in xmlNewMutex() local 181 if ((tok = malloc(sizeof(xmlMutex))) == NULL) in xmlNewMutex() 185 pthread_mutex_init(&tok->lock, NULL); in xmlNewMutex() 187 tok->mutex = CreateMutex(NULL, FALSE, NULL); in xmlNewMutex() 189 if ((tok->sem = create_sem(1, "xmlMutex")) < B_OK) { in xmlNewMutex() 190 free(tok); in xmlNewMutex() 193 tok->tid = -1; in xmlNewMutex() 195 return (tok); in xmlNewMutex() 206 xmlFreeMutex(xmlMutexPtr tok) in xmlFreeMutex() argument 208 if (tok == NULL) in xmlFreeMutex() [all …]
|
/external/clang/unittests/Lex/ |
D | LexerTest.cpp | 77 Token tok; in Lex() local 78 PP.Lex(tok); in Lex() 79 if (tok.is(tok::eof)) in Lex() 81 toks.push_back(tok); in Lex() 88 ArrayRef<tok::TokenKind> ExpectedTokens) { in CheckLex() 120 std::vector<tok::TokenKind> ExpectedTokens; in TEST_F() 121 ExpectedTokens.push_back(tok::identifier); in TEST_F() 122 ExpectedTokens.push_back(tok::l_paren); in TEST_F() 123 ExpectedTokens.push_back(tok::identifier); in TEST_F() 124 ExpectedTokens.push_back(tok::r_paren); in TEST_F() [all …]
|
/external/selinux/libsepol/cil/src/ |
D | cil_parser.c | 105 struct token tok; in add_hll_linemark() local 109 cil_lexer_next(&tok); in add_hll_linemark() 110 hll_type = cil_strpool_add(tok.value); in add_hll_linemark() 119 create_node(&node, *current, tok.line, *hll_lineno, NULL); in add_hll_linemark() 123 create_node(&node, *current, tok.line, *hll_lineno, CIL_KEY_SRC_INFO); in add_hll_linemark() 126 create_node(&node, *current, tok.line, *hll_lineno, CIL_KEY_SRC_HLL); in add_hll_linemark() 138 cil_lexer_next(&tok); in add_hll_linemark() 139 if (tok.type != SYMBOL) { in add_hll_linemark() 143 *hll_lineno = strtol(tok.value, &end, 10); in add_hll_linemark() 151 cil_lexer_next(&tok); in add_hll_linemark() [all …]
|