vivjson.tokens (2025-03-30) | index https://github.com/benesult/vivjson-python/tree/main/vivjson/tokens.py |
Token for VivJson
For example,
GT NUMBER ASSIGN PLUS NUMBER
| | | | |
while ( i > 3 ) { i = i + 1 }
| | | | | | | |
IDENTIFIER | IDENTIFIER | | IDENTIFIER |
| | | |
LEFT_PARENTHESIS | LEFT_CURLY_BRACKET |
| |
RIGHT_PARENTHESIS RIGHT_CURLY_BRACKET
Refer to:
- "Let's make a Teeny Tiny compiler"
https://austinhenley.com/blog/teenytinycompiler1.html
- "Crafting Interpreters"
https://craftinginterpreters.com/
Note that this code is made from scratch. The source code
of the above WEB sites is not used.
Note:
This file name is "tokens.py" instead of "token.py". Because `pydoc`
does not work correctly for "token.py". Then `pydoc` outputs error
as below.
> ImportError: cannot import name 'EXACT_TOKEN_TYPES' from 'token'
Environment:
- Python 3.9 or later
License:
Copyright 2025 benesult
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Classes | ||||||||||
|
Author | ||
Fumiaki Motegi <motegi@benesult.com> |