-
Notifications
You must be signed in to change notification settings - Fork 70
2. Parser
Pawel Lampe edited this page Feb 23, 2022
·
1 revision
gdparse
is a simple tool for parsing GDScript code. For the purpose of parsing, the EBNF-like GDScript grammar is used. This grammar is further processed by Lark
- simple parsing toolkit written in Python - which produces a fully featured parser out of grammar file.
- Validating GDScript code on the syntax level
- Builing a parse tree for educational purposes
To parse a file, use the gdparse
command:
gdparse tests/valid-gd-scripts/recursive_tool.gd -p
The command's exit code is 0
if parsing succeeded. It outputs a tree that represents your code's structure straight to the stdout
:
start
class_def
X
class_body
tool_stmt
signal_stmt sss
class_def
Y
class_body
tool_stmt
signal_stmt sss
tool_stmt