/freebsd/contrib/libedit/ |
H A D | tokenizer.c | 97 static void FUN(tok,finish)(TYPE(Tokenizer) *); 104 FUN(tok,finish)(TYPE(Tokenizer) *tok) in FUN() argument 107 *tok->wptr = '\0'; in FUN() 108 if ((tok->flags & TOK_KEEP) || tok->wptr != tok->wstart) { in FUN() 109 tok->argv[tok->argc++] = tok->wstart; in FUN() 110 tok->argv[tok->argc] = NULL; in FUN() 111 tok->wstart = ++tok->wptr; in FUN() 113 tok->flags &= ~TOK_KEEP; in FUN() 121 FUN(tok,init)(const Char *ifs) in TYPE() 123 TYPE(Tokenizer) *tok = tok_malloc(sizeof(*tok)); in TYPE() [all …]
|
/freebsd/contrib/llvm-project/clang/lib/Parse/ |
H A D | ParseTentative.cpp | 55 case tok::kw_asm: in isCXXDeclarationStatement() 57 case tok::kw_namespace: in isCXXDeclarationStatement() 60 case tok::kw_using: in isCXXDeclarationStatement() 62 case tok::kw_static_assert: in isCXXDeclarationStatement() 63 case tok::kw__Static_assert: in isCXXDeclarationStatement() 65 case tok::coloncolon: in isCXXDeclarationStatement() 66 case tok::identifier: { in isCXXDeclarationStatement() 76 case tok::identifier: { in isCXXDeclarationStatement() 95 if (NextToken().is(tok::identifier)) in isCXXDeclarationStatement() 100 case tok::kw_operator: in isCXXDeclarationStatement() [all …]
|
H A D | ParseExpr.cpp | 162 LHS = Actions.ActOnUnaryOp(getCurScope(), ExtLoc, tok::kw___extension__, in ParseExpressionWithLeadingExtension() 170 if (Tok.is(tok::code_completion)) { in ParseAssignmentExpression() 177 if (Tok.is(tok::kw_throw)) in ParseAssignmentExpression() 179 if (Tok.is(tok::kw_co_yield)) in ParseAssignmentExpression() 189 if (Tok.is(tok::code_completion)) { in ParseConditionalExpression() 324 Tok.isOneOf(tok::period, tok::plusplus, tok::minusminus) || in ParseConstraintLogicalAndExpression() 325 (Tok.is(tok::l_square) && !NextToken().is(tok::l_square))) { in ParseConstraintLogicalAndExpression() 350 while (Tok.is(tok::ampamp)) { in ParseConstraintLogicalAndExpression() 358 tok::ampamp, LHS.get(), RHS.get()); in ParseConstraintLogicalAndExpression() 384 while (Tok.is(tok::pipepipe)) { in ParseConstraintLogicalOrExpression() [all …]
|
H A D | ParseDecl.cpp | 192 assert(Tok.is(tok::kw___attribute) && "Not a GNU attribute list!"); in ParseGNUAttributes() 197 while (Tok.is(tok::kw___attribute)) { in ParseGNUAttributes() 202 if (ExpectAndConsume(tok::l_paren, diag::err_expected_lparen_after, in ParseGNUAttributes() 204 SkipUntil(tok::r_paren, StopAtSemi); // skip until ) or ; in ParseGNUAttributes() 207 if (ExpectAndConsume(tok::l_paren, diag::err_expected_lparen_after, "(")) { in ParseGNUAttributes() 208 SkipUntil(tok::r_paren, StopAtSemi); // skip until ) or ; in ParseGNUAttributes() 214 while (TryConsumeToken(tok::comma)) in ParseGNUAttributes() 220 if (Tok.is(tok::code_completion)) { in ParseGNUAttributes() 232 if (Tok.isNot(tok::l_paren)) { in ParseGNUAttributes() 278 ConsumeAndStoreUntil(tok::r_paren, LA->Toks, /*StopAtSemi=*/true); in ParseGNUAttributes() [all …]
|
H A D | ParseCXXInlineMethods.cpp | 25 if (!Tok.is(tok::l_paren)) in ParseCXXDeletedFunctionMessage() 28 BalancedDelimiterTracker BT{*this, tok::l_paren}; in ParseCXXDeletedFunctionMessage() 43 SkipUntil(tok::r_paren, StopAtSemi | StopBeforeMatch); in ParseCXXDeletedFunctionMessage() 54 if (!Tok.is(tok::l_paren)) in SkipDeletedFunctionBody() 57 BalancedDelimiterTracker BT{*this, tok::l_paren}; in SkipDeletedFunctionBody() 61 SkipUntil(tok::r_paren, tok::comma, StopAtSemi | StopBeforeMatch); in SkipDeletedFunctionBody() 62 if (Tok.is(tok::r_paren)) in SkipDeletedFunctionBody() 74 assert(Tok.isOneOf(tok::l_brace, tok::colon, tok::kw_try, tok::equal) && in ParseCXXInlineMethodDef() 102 if (TryConsumeToken(tok::equal)) { in ParseCXXInlineMethodDef() 104 SkipUntil(tok::semi); in ParseCXXInlineMethodDef() [all …]
|
H A D | ParseObjc.cpp | 31 void Parser::MaybeSkipAttributes(tok::ObjCKeywordKind Kind) { in MaybeSkipAttributes() 33 if (Tok.is(tok::kw___attribute)) { in MaybeSkipAttributes() 34 if (Kind == tok::objc_interface || Kind == tok::objc_protocol) in MaybeSkipAttributes() 36 << (Kind == tok::objc_protocol); in MaybeSkipAttributes() 58 if (Tok.is(tok::code_completion)) { in ParseObjCAtDirectives() 65 case tok::objc_interface: in ParseObjCAtDirectives() 66 case tok::objc_protocol: in ParseObjCAtDirectives() 67 case tok::objc_implementation: in ParseObjCAtDirectives() 78 case tok::objc_class: in ParseObjCAtDirectives() 80 case tok::objc_interface: in ParseObjCAtDirectives() [all …]
|
H A D | ParseTemplate.cpp | 45 if (Tok.is(tok::kw_template) && NextToken().isNot(tok::less)) { in ParseDeclarationStartingWithTemplate() 81 assert(Tok.isOneOf(tok::kw_export, tok::kw_template) && in ParseTemplateDeclarationOrSpecialization() 120 TryConsumeToken(tok::kw_export, ExportLoc); in ParseTemplateDeclarationOrSpecialization() 124 if (!TryConsumeToken(tok::kw_template, TemplateLoc)) { in ParseTemplateDeclarationOrSpecialization() 136 SkipUntil(tok::r_brace, StopAtSemi | StopBeforeMatch); in ParseTemplateDeclarationOrSpecialization() 137 TryConsumeToken(tok::semi); in ParseTemplateDeclarationOrSpecialization() 146 if (TryConsumeToken(tok::kw_requires)) { in ParseTemplateDeclarationOrSpecialization() 152 SkipUntil(tok::r_brace, StopAtSemi | StopBeforeMatch); in ParseTemplateDeclarationOrSpecialization() 153 TryConsumeToken(tok::semi); in ParseTemplateDeclarationOrSpecialization() 164 } while (Tok.isOneOf(tok::kw_export, tok::kw_template)); in ParseTemplateDeclarationOrSpecialization() [all …]
|
H A D | ParseDeclCXX.cpp | 67 assert(Tok.is(tok::kw_namespace) && "Not a namespace!"); in ParseNamespace() 71 if (Tok.is(tok::code_completion)) { in ParseNamespace() 88 if (Tok.is(tok::kw___attribute)) { in ParseNamespace() 105 if (Tok.is(tok::identifier)) { in ParseNamespace() 108 while (Tok.is(tok::coloncolon) && in ParseNamespace() 109 (NextToken().is(tok::identifier) || in ParseNamespace() 110 (NextToken().is(tok::kw_inline) && in ParseNamespace() 111 GetLookAheadToken(2).is(tok::identifier)))) { in ParseNamespace() 116 if (Tok.is(tok::kw_inline)) { in ParseNamespace() 137 if (Tok.is(tok::equal)) { in ParseNamespace() [all …]
|
H A D | Parser.cpp | 61 Tok.setKind(tok::eof); in Parser() 110 static bool IsCommonTypo(tok::TokenKind ExpectedTok, const Token &Tok) { in IsCommonTypo() 112 case tok::semi: in IsCommonTypo() 113 return Tok.is(tok::colon) || Tok.is(tok::comma); // : or , for ; in IsCommonTypo() 118 bool Parser::ExpectAndConsume(tok::TokenKind ExpectedTok, unsigned DiagID, in ExpectAndConsume() 120 if (Tok.is(ExpectedTok) || Tok.is(tok::code_completion)) { in ExpectAndConsume() 131 SourceRange(Loc), tok::getPunctuatorSpelling(ExpectedTok)); in ExpectAndConsume() 148 Spelling = tok::getPunctuatorSpelling(ExpectedTok); in ExpectAndConsume() 165 if (TryConsumeToken(tok::semi)) in ExpectAndConsumeSemi() 168 if (Tok.is(tok::code_completion)) { in ExpectAndConsumeSemi() [all …]
|
H A D | ParseExprCXX.cpp | 34 static int SelectDigraphErrorMessage(tok::TokenKind Kind) { in SelectDigraphErrorMessage() 37 case tok::unknown: return 0; in SelectDigraphErrorMessage() 39 case tok::kw_addrspace_cast: return 1; in SelectDigraphErrorMessage() 40 case tok::kw_const_cast: return 2; in SelectDigraphErrorMessage() 41 case tok::kw_dynamic_cast: return 3; in SelectDigraphErrorMessage() 42 case tok::kw_reinterpret_cast: return 4; in SelectDigraphErrorMessage() 43 case tok::kw_static_cast: return 5; in SelectDigraphErrorMessage() 59 Token &ColonToken, tok::TokenKind Kind, bool AtDigraph) { in FixDigraph() 73 ColonToken.setKind(tok::coloncolon); in FixDigraph() 76 DigraphToken.setKind(tok::less); in FixDigraph() [all …]
|
H A D | ParseStmt.cpp | 146 WantTypeSpecifiers = nextTok.isOneOf(tok::l_paren, tok::less, tok::l_square, in StatementFilterCCC() 147 tok::identifier, tok::star, tok::amp); in StatementFilterCCC() 149 nextTok.isOneOf(tok::l_paren, tok::identifier, tok::arrow, tok::period); in StatementFilterCCC() 151 nextTok.isOneOf(tok::l_paren, tok::semi, tok::identifier, tok::l_brace); in StatementFilterCCC() 158 if (NextToken.is(tok::equal)) in ValidateCandidate() 160 if (NextToken.is(tok::period) && in ValidateCandidate() 187 tok::TokenKind Kind = Tok.getKind(); in ParseStatementOrDeclarationAfterAttributes() 190 case tok::at: // May be a @try or @throw statement in ParseStatementOrDeclarationAfterAttributes() 196 case tok::code_completion: in ParseStatementOrDeclarationAfterAttributes() 202 case tok::identifier: in ParseStatementOrDeclarationAfterAttributes() [all …]
|
/freebsd/sys/security/audit/ |
H A D | audit_bsm.c | 102 kau_write(struct au_record *rec, struct au_token *tok) in kau_write() argument 105 KASSERT(tok != NULL, ("kau_write: tok == NULL")); in kau_write() 107 TAILQ_INSERT_TAIL(&rec->token_q, tok, tokens); in kau_write() 108 rec->len += tok->len; in kau_write() 170 struct au_token *tok; in kau_free() local 173 while ((tok = TAILQ_FIRST(&rec->token_q))) { in kau_free() 174 TAILQ_REMOVE(&rec->token_q, tok, tokens); in kau_free() 175 free(tok->t_data, M_AUDITBSM); in kau_free() 176 free(tok, M_AUDITBSM); in kau_free() 194 tok = au_to_arg32(argnum, "at fd 1", ar->ar_arg_atfd1); \ [all …]
|
/freebsd/contrib/openbsm/libbsm/ |
H A D | bsm_io.c | 915 fetch_header32_tok(tokenstr_t *tok, u_char *buf, int len) in fetch_header32_tok() argument 919 READ_TOKEN_U_INT32(buf, len, tok->tt.hdr32.size, tok->len, err); in fetch_header32_tok() 923 READ_TOKEN_U_CHAR(buf, len, tok->tt.hdr32.version, tok->len, err); in fetch_header32_tok() 927 READ_TOKEN_U_INT16(buf, len, tok->tt.hdr32.e_type, tok->len, err); in fetch_header32_tok() 931 READ_TOKEN_U_INT16(buf, len, tok->tt.hdr32.e_mod, tok->len, err); in fetch_header32_tok() 935 READ_TOKEN_U_INT32(buf, len, tok->tt.hdr32.s, tok->len, err); in fetch_header32_tok() 939 READ_TOKEN_U_INT32(buf, len, tok->tt.hdr32.ms, tok->len, err); in fetch_header32_tok() 947 print_header32_tok(FILE *fp, tokenstr_t *tok, char *del, int oflags) in print_header32_tok() argument 950 print_tok_type(fp, tok->id, "header", oflags); in print_header32_tok() 953 print_1_byte(fp, tok->tt.hdr32.version, "%u"); in print_header32_tok() [all …]
|
/freebsd/contrib/llvm-project/clang/lib/Lex/ |
H A D | TokenConcatenation.cpp | 73 TokenInfo[tok::identifier ] |= aci_custom; in TokenConcatenation() 74 TokenInfo[tok::numeric_constant] |= aci_custom_firstchar; in TokenConcatenation() 75 TokenInfo[tok::period ] |= aci_custom_firstchar; in TokenConcatenation() 76 TokenInfo[tok::amp ] |= aci_custom_firstchar; in TokenConcatenation() 77 TokenInfo[tok::plus ] |= aci_custom_firstchar; in TokenConcatenation() 78 TokenInfo[tok::minus ] |= aci_custom_firstchar; in TokenConcatenation() 79 TokenInfo[tok::slash ] |= aci_custom_firstchar; in TokenConcatenation() 80 TokenInfo[tok::less ] |= aci_custom_firstchar; in TokenConcatenation() 81 TokenInfo[tok::greater ] |= aci_custom_firstchar; in TokenConcatenation() 82 TokenInfo[tok::pipe ] |= aci_custom_firstchar; in TokenConcatenation() [all …]
|
/freebsd/usr.bin/rpcgen/ |
H A D | rpc_parse.c | 62 token tok; in get_definition() local 65 get_token(&tok); in get_definition() 66 switch (tok.kind) { in get_definition() 91 scan(TOK_SEMICOLON, &tok); in get_definition() 105 token tok; in def_struct() local 112 scan(TOK_IDENT, &tok); in def_struct() 113 defp->def_name = tok.str; in def_struct() 114 scan(TOK_LBRACE, &tok); in def_struct() 122 scan(TOK_SEMICOLON, &tok); in def_struct() 123 peek(&tok); in def_struct() [all …]
|
/freebsd/contrib/llvm-project/clang/lib/Format/ |
H A D | UnwrappedLineParser.cpp | 302 case tok::l_brace: in parseCSharpGenericTypeConstraint() 321 case tok::r_square: in parseCSharpAttribute() 329 case tok::l_square: in parseCSharpAttribute() 345 return Previous && Previous->is(tok::comment) && in precededByCommentOrPPDirective() 371 if (FormatTok->is(tok::l_paren)) in parseLevel() 375 tok::TokenKind Kind = FormatTok->Tok.getKind(); in parseLevel() 377 Kind = tok::l_brace; in parseLevel() 379 Kind = tok::r_brace; in parseLevel() 391 case tok::comment: in parseLevel() 395 case tok in parseLevel() [all...] |
H A D | TokenAnnotator.cpp | 44 return Line.startsWith(tok::kw_for) || Line.startsWith(tok::kw_if) || in startsWithInitStatement() 45 Line.startsWith(tok::kw_switch); in startsWithInitStatement() 67 if (Left->Previous && Left->Previous->is(tok::greater) && in isLambdaParameterList() 74 return Left->Previous && Left->Previous->is(tok::r_square) && in isLambdaParameterList() 82 return Tok.isOneOf(tok::kw_if, tok::kw_for, tok::kw_while, tok::kw_switch, in isKeywordWithCondition() 83 tok::kw_constexpr, tok::kw_catch); in isKeywordWithCondition() 88 if (!IsCpp || !Tok.startsSequence(tok::l_square, tok::l_square)) in isCppAttribute() 91 if (Tok.Previous && Tok.Previous->is(tok::at)) in isCppAttribute() 98 if (AttrTok->startsSequence(tok::kw_using, tok::identifier, tok::colon)) in isCppAttribute() 100 if (AttrTok->isNot(tok::identifier)) in isCppAttribute() [all …]
|
H A D | FormatTokenLexer.cpp | 102 } while (Tokens.back()->isNot(tok::eof)); in lex() 128 static const tok::TokenKind NullishCoalescingOperator[] = {tok::question, in tryMergePreviousTokens() 129 tok::question}; in tryMergePreviousTokens() 130 static const tok::TokenKind NullPropagatingOperator[] = {tok::question, in tryMergePreviousTokens() 131 tok::period}; in tryMergePreviousTokens() 132 static const tok::TokenKind FatArrow[] = {tok::equal, tok::greater}; in tryMergePreviousTokens() 138 Tokens.back()->Tok.setKind(tok::pipepipe); in tryMergePreviousTokens() 143 Tokens.back()->Tok.setKind(tok::period); in tryMergePreviousTokens() 151 static const tok::TokenKind CSharpNullConditionalLSquare[] = { in tryMergePreviousTokens() 152 tok::question, tok::l_square}; in tryMergePreviousTokens() [all …]
|
H A D | FormatToken.h | 500 tok::TokenKind ParentBracket = tok::unknown; 610 bool is(tok::TokenKind Kind) const { return Tok.is(Kind); } in is() 615 bool is(tok::PPKeywordKind Kind) const { in is() 632 return is(tok::kw_if) || endsSequence(tok::kw_constexpr, tok::kw_if) || 633 (endsSequence(tok::identifier, tok::kw_if) && AllowConstexprMacro); 662 bool isStringLiteral() const { return tok::isStringLiteral(Tok.getKind()); } in isStringLiteral() 665 return isOneOf(tok::kw___attribute, tok::kw___declspec, TT_AttributeMacro); in isAttribute() 668 bool isObjCAtKeyword(tok::ObjCKeywordKind Kind) const { in isObjCAtKeyword() 673 return isOneOf(tok::kw_public, tok::kw_protected, tok::kw_private); in isAccessSpecifierKeyword() 682 return NextNonComment && NextNonComment->is(tok::colon); [all …]
|
/freebsd/contrib/llvm-project/clang/lib/Basic/ |
H A D | OperatorPrecedence.cpp | 17 prec::Level getBinOpPrecedence(tok::TokenKind Kind, bool GreaterThanIsOperator, in getBinOpPrecedence() 20 case tok::greater: in getBinOpPrecedence() 29 case tok::greatergreater: in getBinOpPrecedence() 41 case tok::comma: return prec::Comma; in getBinOpPrecedence() 42 case tok::equal: in getBinOpPrecedence() 43 case tok::starequal: in getBinOpPrecedence() 44 case tok::slashequal: in getBinOpPrecedence() 45 case tok::percentequal: in getBinOpPrecedence() 46 case tok::plusequal: in getBinOpPrecedence() 47 case tok::minusequal: in getBinOpPrecedence() [all …]
|
/freebsd/contrib/llvm-project/lldb/source/Plugins/Language/ClangCommon/ |
H A D | ClangHighlighter.cpp | 55 if (token.is(tok::comment)) { in determineClangStyle() 59 } else if (in_pp_directive || token.getKind() == tok::hash) { in determineClangStyle() 64 } else if (tok::isStringLiteral(token.getKind())) in determineClangStyle() 66 else if (tok::isLiteral(token.getKind())) in determineClangStyle() 72 case tok::raw_identifier: in determineClangStyle() 73 case tok::identifier: in determineClangStyle() 75 case tok::l_brace: in determineClangStyle() 76 case tok::r_brace: in determineClangStyle() 78 case tok::l_square: in determineClangStyle() 79 case tok::r_square: in determineClangStyle() [all …]
|
/freebsd/contrib/llvm-project/lldb/source/Plugins/Language/CPlusPlus/ |
H A D | CPlusPlusNameParser.cpp | 21 namespace tok = clang::tok; 71 bool CPlusPlusNameParser::ConsumeToken(tok::TokenKind kind) { in ConsumeToken() 112 if (!ConsumeToken(tok::kw_auto) && !ConsumeTypename()) in ParseFunctionImpl() 166 if (!ConsumeToken(tok::l_paren)) in ParseFuncPtr() 180 if (ConsumeToken(tok::r_paren)) in ParseFuncPtr() 209 if (ConsumeToken(tok::r_paren)) in ParseFuncPtr() 220 return ConsumeBrackets(tok::l_paren, tok::r_paren); in ConsumeArguments() 225 if (!HasMoreTokens() || Peek().getKind() != tok::less) in ConsumeTemplateArgs() 240 tok::TokenKind kind = Peek().getKind(); in ConsumeTemplateArgs() 242 case tok::greatergreater: in ConsumeTemplateArgs() [all …]
|
/freebsd/contrib/expat/lib/ |
H A D | xmlrole.c | 122 typedef int PTRCALL PROLOG_HANDLER(PROLOG_STATE *state, int tok, 138 static int FASTCALL common(PROLOG_STATE *state, int tok); 141 prolog0(PROLOG_STATE *state, int tok, const char *ptr, const char *end, in prolog0() argument 143 switch (tok) { in prolog0() 168 return common(state, tok); in prolog0() 172 prolog1(PROLOG_STATE *state, int tok, const char *ptr, const char *end, in prolog1() argument 174 switch (tok) { in prolog1() 200 return common(state, tok); in prolog1() 204 prolog2(PROLOG_STATE *state, int tok, const char *ptr, const char *end, in prolog2() argument 209 switch (tok) { in prolog2() [all …]
|
/freebsd/contrib/ntp/libjsmn/ |
H A D | jsmn_test.c | 118 jsmntok_t tok[10]; in test_primitive() local 122 r = jsmn_parse(&p, js, strlen(js), tok, 10); in test_primitive() 123 check(r >= 0 && tok[0].type == JSMN_STRING in test_primitive() 124 && tok[1].type == JSMN_PRIMITIVE); in test_primitive() 125 check(TOKEN_STRING(js, tok[0], "boolVar")); in test_primitive() 126 check(TOKEN_STRING(js, tok[1], "true")); in test_primitive() 130 r = jsmn_parse(&p, js, strlen(js), tok, 10); in test_primitive() 131 check(r >= 0 && tok[0].type == JSMN_STRING in test_primitive() 132 && tok[1].type == JSMN_PRIMITIVE); in test_primitive() 133 check(TOKEN_STRING(js, tok[0], "boolVar")); in test_primitive() [all …]
|
/freebsd/contrib/tcp_wrappers/ |
H A D | hosts_access.c | 90 static int server_match(char *tok, struct request_info *request); 91 static int client_match(char *tok, struct request_info *request); 92 static int host_match(char *tok, struct host_info *host); 93 static int string_match(char *tok, char *string); 214 char *tok; in list_match() local 223 for (tok = strtok(list, sep); tok != 0; tok = strtok((char *) 0, sep)) { in list_match() 224 if (STR_EQ(tok, "EXCEPT")) /* EXCEPT: give up */ in list_match() 226 if (match_fn(tok, request)) { /* YES: look for exceptions */ in list_match() 227 while ((tok = strtok((char *) 0, sep)) && STR_NE(tok, "EXCEPT")) in list_match() 229 return (tok == 0 || list_match((char *) 0, request, match_fn) == 0); in list_match() [all …]
|