mirror of
https://github.com/cheat/cheat.git
synced 2024-11-18 09:50:39 +01:00
90 lines
6.8 KiB
XML
90 lines
6.8 KiB
XML
|
<lexer>
|
||
|
<config>
|
||
|
<name>SQL</name>
|
||
|
<alias>sql</alias>
|
||
|
<filename>*.sql</filename>
|
||
|
<mime_type>text/x-sql</mime_type>
|
||
|
<case_insensitive>true</case_insensitive>
|
||
|
<not_multiline>true</not_multiline>
|
||
|
</config>
|
||
|
<rules>
|
||
|
<state name="root">
|
||
|
<rule pattern="\s+">
|
||
|
<token type="TextWhitespace"/>
|
||
|
</rule>
|
||
|
<rule pattern="--.*\n?">
|
||
|
<token type="CommentSingle"/>
|
||
|
</rule>
|
||
|
<rule pattern="/\*">
|
||
|
<token type="CommentMultiline"/>
|
||
|
<push state="multiline-comments"/>
|
||
|
</rule>
|
||
|
<rule pattern="'">
|
||
|
<token type="LiteralStringSingle"/>
|
||
|
<push state="string"/>
|
||
|
</rule>
|
||
|
<rule pattern=""">
|
||
|
<token type="LiteralStringDouble"/>
|
||
|
<push state="double-string"/>
|
||
|
</rule>
|
||
|
<rule pattern="(DATETIME_INTERVAL_PRECISION|PARAMETER_SPECIFIC_CATALOG|PARAMATER_ORDINAL_POSITION|USER_DEFINED_TYPE_CATALOG|PARAMATER_SPECIFIC_SCHEMA|TRANSACTIONS_ROLLED_BACK|USER_DEFINED_TYPE_SCHEMA|PARAMETER_SPECIFIC_NAME|DATETIME_INTERVAL_CODE|TRANSACTIONS_COMMITTED|USER_DEFINED_TYPE_NAME|CHARACTER_SET_CATALOG|DYNAMIC_FUNCTION_CODE|COMMAND_FUNCTION_CODE|RETURNED_OCTET_LENGTH|MESSAGE_OCTET_LENGTH|CHARACTER_SET_SCHEMA|CONSTRAINT_CATALOG|TRANSACTION_ACTIVE|CHARACTER_SET_NAME|CURRENT_TIMESTAMP|CONSTRAINT_SCHEMA|COLLATION_CATALOG|RETURNED_SQLSTATE|DYNAMIC_FUNCTION|CONDITION_NUMBER|CHARACTER_LENGTH|COMMAND_FUNCTION|COLLATION_SCHEMA|CHARACTERISTICS|TRIGGER_CATALOG|CONNECTION_NAME|SUBCLASS_ORIGIN|RETURNED_LENGTH|TIMEZONE_MINUTE|CONSTRAINT_NAME|ROUTINE_CATALOG|TRIGGER_SCHEMA|ROUTINE_SCHEMA|LOCALTIMESTAMP|IMPLEMENTATION|PARAMATER_NAME|MESSAGE_LENGTH|PARAMETER_MODE|COLLATION_NAME|TIMEZONE_HOUR|SPECIFIC_NAME|DETERMINISTIC|CORRESPONTING|AUTHORIZATION|INSTANTIABLE|CURRENT_TIME|CURRENT_USER|ROUTINE_NAME|NOCREATEUSER|MESSAGE_TEXT|SQLEXCEPTION|CATALOG_NAME|SESSION_USER|CLASS_ORIGIN|CURRENT_ROLE|SPECIFICTYPE|SERIALIZABLE|CURRENT_DATE|OCTET_LENGTH|CURRENT_PATH|TRIGGER_NAME|CHAR_LENGTH|SYSTEM_USER|REFERENCING|UNENCRYPTED|COLUMN_NAME|SQLWARNINIG|DIAGNOSTICS|CURSOR_NAME|SERVER_NAME|INSENSITIVE|SCHEMA_NAME|UNCOMMITTED|TRANSACTION|CONSTRUCTOR|LANCOMPILER|CARDINALITY|CONSTRAINTS|TRANSLATION|CHECKPOINT|CONSTRAINT|CONNECTION|PRIVILEGES|COMPLETION|CONVERSION|DELIMITERS|TABLE_NAME|INDITCATOR|INITIALIZE|DESCRIPTOR|REPEATABLE|CREATEUSER|DEFERRABLE|DESTRUCTOR|PROCEDURAL|DICTIONARY|DISCONNECT|TRANSFORMS|KEY_MEMBER|BIT_LENGTH|ASYMMETRIC|ASSIGNMENT|ASENSITIVE|OVERRIDING|PARAMETERS|REFERENCES|ORDINALITY|NOCREATEDB|STATISTICS|DEALLOCATE|SAVE_POINT|RECURSIVE|STRUCTURE|SUBSTRING|IMMEDIATE|GENERATED|SYMMETRIC|STATEMENT|INCREMENT|IMMUTABLE|INCLUDING|COMMITTED|TEMPORARY|INITIALLY|TERMINATE|PRECISION|DELIMITER|TIMESTAMP|INTERSECT|ISOLATION|TRANSFORM|TRANSLATE|ROW_COUNT|ASSERTION|PARAMETER|EXCLUSIVE|LOCALTIME|VALIDATOR|AGGREGATE|EXCLUDING|SENSITIVE|EXCEPTION|ENCRYPTED|OPERATION|HIERARCHY|COLLATION|PROCEDURE|CONTINUE|ENCODING|MINVALUE|SPECIFIC|ABSOLUTE|SECURITY|WHENEVER|EXISTING|VOLATILE|MAXVALUE|EXTERNAL|NULLABLE|VARIABLE|SQLERROR|DISTINCT|DISPATCH|END-EXEC|LOCATION|ALLOCATE|OVERLAPS|UNLISTEN|ROLLBACK|TRUNCATE|DESCRIBE|SQLSTATE|BACKWARD|FUNCTION|LANGUAGE|KEY_TYPE|CASCADED|POSITION|TRAILING|DEFERRED|RELATIVE|DEFAULTS|COALSECE|PREORDER|GROUPING|MODIFIES|INHERITS|PRESERVE|DATABASE|RESTRICT|IDENTITY|TEMPLATE|NATIONAL|CONTAINS|CREATEDB|IMPLICIT|OPERATOR|CONVERT|CURRENT|CONNECT|RECHECK|PRIMARY|STORAGE|DECLARE|DEFAULT|HANDLER|COLLATE|PREPARE|REINDEX|GRANTED|CHECKED|POSTFIX|REPLACE|INSTEAD|CATALOG|RESTART|INVOKER|PLACING|PENDANT|DEFINED|ITERATE|PARTIAL|CASCADE|BREADTH|GENERAL|TRIGGER|SESSION|BETWEEN|DEFINER|LATERAL|LEADING|RETURNS|TRUSTED|UNKNOWN|FORWARD|UNNAMED|OVERLAY|FORTRAN|ANALYZE|OPTIONS|ANALYSE|FOREIGN|ROUTINE|LOCATOR|DESTROY|SUBLIST|VERBOSE|EXTRACT|NOTNULL|EXPLAIN|VERSION|SQLCODE|EXECUTE|NOTHING|DYNAMIC|WITHOUT|SIMILAR|NATURAL|COMMENT|CLUSTER|PASCAL|SOURCE|EQUALS|CALLED|ESCAPE|EXCEPT|SELECT|ISNULL|DOMAIN|SEARCH|SCROLL|SIMPLE|BITVAR|MINUTE|EXISTS|SCHEMA|ATOMIC|METHOD|NOTIFY|ACCESS|UNIQUE|ROLLUP|NULLIF|OBJECT|STABLE|COLUMN|REVOKE|OFFSET|COMMIT|MODIFY|FREEZE|DELETE|RETURN|RESULT|UNNEST|OPTION|GLOBAL|VALUES|RENAME|SYSTEM|STATIC|UPDATE|OUTPUT|LISTEN|STDOUT|STRICT|PUBLIC|IGNORE|PREFIX|SECOND|CREATE|LENGTH|BEFORE|HAVING|INSERT|VACUUM|CURSOR|ELSIF|USING|ALTER|STYPE|CYCLE|LARGE|INPUT|CROSS|INOUT|INNER|INFIX|INDEX|LEVEL|USAGE|ILIKE|VALID|OWNER|GRANT|READS|UPPER|LIMIT|OUTER|STDIN|SYSID|GROUP|ALIAS|ORDER|UNTIL|LOCAL|RESET|START|COUNT|LOWER|TABLE| TEMP|PRIOR|AFTER|STATE|ADMIN|RIGHT|COBOL|FOUND|MATCH|FORCE|ABORT|FIRST|FINAL|CLOSE|DEREF|FETCH|WHERE|FALSE|SCALE|BEGIN|CLASS|TOAST|WRITE|NCLOB|NCHAR|CHECK|CHAIN|SPACE|NAMES|EVERY|MUMPS|CACHE|UNION|UNDER|SETOF|MONTH|SHARE|SCOPE|TREAT|SHOW|SIZE|SOME|SETS|SELF|ELSE|EACH|DROP|TYPE|FROM|RULE|DESC|ROWS|ZONE|ROLE|TRUE|FREE|FULL|GOTO|TRIM|HOLD|HOST|DATA|READ|INTO|USER|JOIN|CUBE|LAST|LEFT|LESS|LIKE|LOAD|LOCK|OPEN|COPY|ONLY|OIDS|VIEW
|
||
|
<token type="Keyword"/>
|
||
|
</rule>
|
||
|
<rule pattern="(CHARACTER|SMALLINT|INTERVAL|DECIMAL|SERIAL8|VARYING|BOOLEAN|VARCHAR|INTEGER|NUMERIC|SERIAL|BINARY|BIGINT|NUMBER|FLOAT|ARRAY|TEXT|REAL|INT8|DATE|CHAR|BLOB|DEC|BIT|INT)\b">
|
||
|
<token type="NameBuiltin"/>
|
||
|
</rule>
|
||
|
<rule pattern="[+*/<>=~!@#%^&|`?-]">
|
||
|
<token type="Operator"/>
|
||
|
</rule>
|
||
|
<rule pattern="[0-9]+">
|
||
|
<token type="LiteralNumberInteger"/>
|
||
|
</rule>
|
||
|
<rule pattern="[a-z_][\w$]*">
|
||
|
<token type="Name"/>
|
||
|
</rule>
|
||
|
<rule pattern="[;:()\[\],.]">
|
||
|
<token type="Punctuation"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="multiline-comments">
|
||
|
<rule pattern="/\*">
|
||
|
<token type="CommentMultiline"/>
|
||
|
<push state="multiline-comments"/>
|
||
|
</rule>
|
||
|
<rule pattern="\*/">
|
||
|
<token type="CommentMultiline"/>
|
||
|
<pop depth="1"/>
|
||
|
</rule>
|
||
|
<rule pattern="[^/*]+">
|
||
|
<token type="CommentMultiline"/>
|
||
|
</rule>
|
||
|
<rule pattern="[/*]">
|
||
|
<token type="CommentMultiline"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="string">
|
||
|
<rule pattern="[^']+">
|
||
|
<token type="LiteralStringSingle"/>
|
||
|
</rule>
|
||
|
<rule pattern="''">
|
||
|
<token type="LiteralStringSingle"/>
|
||
|
</rule>
|
||
|
<rule pattern="'">
|
||
|
<token type="LiteralStringSingle"/>
|
||
|
<pop depth="1"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
<state name="double-string">
|
||
|
<rule pattern="[^"]+">
|
||
|
<token type="LiteralStringDouble"/>
|
||
|
</rule>
|
||
|
<rule pattern="""">
|
||
|
<token type="LiteralStringDouble"/>
|
||
|
</rule>
|
||
|
<rule pattern=""">
|
||
|
<token type="LiteralStringDouble"/>
|
||
|
<pop depth="1"/>
|
||
|
</rule>
|
||
|
</state>
|
||
|
</rules>
|
||
|
</lexer>
|