Mercurial > hgrepos > Python2 > PyMuPDF
comparison mupdf-source/thirdparty/gumbo-parser/src/tokenizer_states.h @ 2:b50eed0cc0ef upstream
ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4.
The directory name has changed: no version number in the expanded directory now.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 15 Sep 2025 11:43:07 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 1:1d09e1dec1d9 | 2:b50eed0cc0ef |
|---|---|
| 1 // Copyright 2011 Google Inc. All Rights Reserved. | |
| 2 // | |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | |
| 4 // you may not use this file except in compliance with the License. | |
| 5 // You may obtain a copy of the License at | |
| 6 // | |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | |
| 8 // | |
| 9 // Unless required by applicable law or agreed to in writing, software | |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 12 // See the License for the specific language governing permissions and | |
| 13 // limitations under the License. | |
| 14 // | |
| 15 // Author: jdtang@google.com (Jonathan Tang) | |
| 16 // | |
| 17 // This contains the list of states used in the tokenizer. Although at first | |
| 18 // glance it seems like these could be kept internal to the tokenizer, several | |
| 19 // of the actions in the parser require that it reach into the tokenizer and | |
| 20 // reset the tokenizer state. For that to work, it needs to have the | |
| 21 // definitions of individual states available. | |
| 22 // | |
| 23 // This may also be useful for providing more detailed error messages for parse | |
| 24 // errors, as we can match up states and inputs in a table without having to | |
| 25 // clutter the tokenizer code with lots of precise error messages. | |
| 26 | |
| 27 #ifndef GUMBO_TOKENIZER_STATES_H_ | |
| 28 #define GUMBO_TOKENIZER_STATES_H_ | |
| 29 | |
| 30 // The ordering of this enum is also used to build the dispatch table for the | |
| 31 // tokenizer state machine, so if it is changed, be sure to update that too. | |
| 32 typedef enum { | |
| 33 GUMBO_LEX_DATA, | |
| 34 GUMBO_LEX_CHAR_REF_IN_DATA, | |
| 35 GUMBO_LEX_RCDATA, | |
| 36 GUMBO_LEX_CHAR_REF_IN_RCDATA, | |
| 37 GUMBO_LEX_RAWTEXT, | |
| 38 GUMBO_LEX_SCRIPT, | |
| 39 GUMBO_LEX_PLAINTEXT, | |
| 40 GUMBO_LEX_TAG_OPEN, | |
| 41 GUMBO_LEX_END_TAG_OPEN, | |
| 42 GUMBO_LEX_TAG_NAME, | |
| 43 GUMBO_LEX_RCDATA_LT, | |
| 44 GUMBO_LEX_RCDATA_END_TAG_OPEN, | |
| 45 GUMBO_LEX_RCDATA_END_TAG_NAME, | |
| 46 GUMBO_LEX_RAWTEXT_LT, | |
| 47 GUMBO_LEX_RAWTEXT_END_TAG_OPEN, | |
| 48 GUMBO_LEX_RAWTEXT_END_TAG_NAME, | |
| 49 GUMBO_LEX_SCRIPT_LT, | |
| 50 GUMBO_LEX_SCRIPT_END_TAG_OPEN, | |
| 51 GUMBO_LEX_SCRIPT_END_TAG_NAME, | |
| 52 GUMBO_LEX_SCRIPT_ESCAPED_START, | |
| 53 GUMBO_LEX_SCRIPT_ESCAPED_START_DASH, | |
| 54 GUMBO_LEX_SCRIPT_ESCAPED, | |
| 55 GUMBO_LEX_SCRIPT_ESCAPED_DASH, | |
| 56 GUMBO_LEX_SCRIPT_ESCAPED_DASH_DASH, | |
| 57 GUMBO_LEX_SCRIPT_ESCAPED_LT, | |
| 58 GUMBO_LEX_SCRIPT_ESCAPED_END_TAG_OPEN, | |
| 59 GUMBO_LEX_SCRIPT_ESCAPED_END_TAG_NAME, | |
| 60 GUMBO_LEX_SCRIPT_DOUBLE_ESCAPED_START, | |
| 61 GUMBO_LEX_SCRIPT_DOUBLE_ESCAPED, | |
| 62 GUMBO_LEX_SCRIPT_DOUBLE_ESCAPED_DASH, | |
| 63 GUMBO_LEX_SCRIPT_DOUBLE_ESCAPED_DASH_DASH, | |
| 64 GUMBO_LEX_SCRIPT_DOUBLE_ESCAPED_LT, | |
| 65 GUMBO_LEX_SCRIPT_DOUBLE_ESCAPED_END, | |
| 66 GUMBO_LEX_BEFORE_ATTR_NAME, | |
| 67 GUMBO_LEX_ATTR_NAME, | |
| 68 GUMBO_LEX_AFTER_ATTR_NAME, | |
| 69 GUMBO_LEX_BEFORE_ATTR_VALUE, | |
| 70 GUMBO_LEX_ATTR_VALUE_DOUBLE_QUOTED, | |
| 71 GUMBO_LEX_ATTR_VALUE_SINGLE_QUOTED, | |
| 72 GUMBO_LEX_ATTR_VALUE_UNQUOTED, | |
| 73 GUMBO_LEX_CHAR_REF_IN_ATTR_VALUE, | |
| 74 GUMBO_LEX_AFTER_ATTR_VALUE_QUOTED, | |
| 75 GUMBO_LEX_SELF_CLOSING_START_TAG, | |
| 76 GUMBO_LEX_BOGUS_COMMENT, | |
| 77 GUMBO_LEX_MARKUP_DECLARATION, | |
| 78 GUMBO_LEX_COMMENT_START, | |
| 79 GUMBO_LEX_COMMENT_START_DASH, | |
| 80 GUMBO_LEX_COMMENT, | |
| 81 GUMBO_LEX_COMMENT_END_DASH, | |
| 82 GUMBO_LEX_COMMENT_END, | |
| 83 GUMBO_LEX_COMMENT_END_BANG, | |
| 84 GUMBO_LEX_DOCTYPE, | |
| 85 GUMBO_LEX_BEFORE_DOCTYPE_NAME, | |
| 86 GUMBO_LEX_DOCTYPE_NAME, | |
| 87 GUMBO_LEX_AFTER_DOCTYPE_NAME, | |
| 88 GUMBO_LEX_AFTER_DOCTYPE_PUBLIC_KEYWORD, | |
| 89 GUMBO_LEX_BEFORE_DOCTYPE_PUBLIC_ID, | |
| 90 GUMBO_LEX_DOCTYPE_PUBLIC_ID_DOUBLE_QUOTED, | |
| 91 GUMBO_LEX_DOCTYPE_PUBLIC_ID_SINGLE_QUOTED, | |
| 92 GUMBO_LEX_AFTER_DOCTYPE_PUBLIC_ID, | |
| 93 GUMBO_LEX_BETWEEN_DOCTYPE_PUBLIC_SYSTEM_ID, | |
| 94 GUMBO_LEX_AFTER_DOCTYPE_SYSTEM_KEYWORD, | |
| 95 GUMBO_LEX_BEFORE_DOCTYPE_SYSTEM_ID, | |
| 96 GUMBO_LEX_DOCTYPE_SYSTEM_ID_DOUBLE_QUOTED, | |
| 97 GUMBO_LEX_DOCTYPE_SYSTEM_ID_SINGLE_QUOTED, | |
| 98 GUMBO_LEX_AFTER_DOCTYPE_SYSTEM_ID, | |
| 99 GUMBO_LEX_BOGUS_DOCTYPE, | |
| 100 GUMBO_LEX_CDATA | |
| 101 } GumboTokenizerEnum; | |
| 102 | |
| 103 #endif // GUMBO_TOKENIZER_STATES_H_ |
