Next: Invoking dzn simulate, Previous: Invoking dzn lts, Up: The Dezyne command-line tools [Contents][Index]
dzn parseThe dzn parse command parses a Dezyne file and reports any
errors, both syntax errors as well as “well-formedness” errors. The
Dezyne parser consists of three stages:
parse-tree10,
parse-tree is converted into the abstract syntax tree
(AST),
AST that ascertain type correctness and detect semantic errors
(See Well-formedness),
AST.
The well-formedness checking of a large program can take a significant
amount of time. As the well-formedness check does not change a correct
AST in any way, it can be safely skipped when parsing a
previously checked and unmodified program (See Invoking dzn).
Usually, the parser is invoked implicitly by commands like dzn
verify and dzn code. It can be useful to do an explicit
check for errors, for example after saving a Dezyne file (See The Perfect Setup). Its syntax is:
dzn dzn-option… parse option… FILE
The options can be among the following:
--preprocess-EResolve imports and produce a content stream. This pre-processed content can also be processed later by the parser and it has the advantage of being independent of the file-system.
--help-hDisplay help on invoking dzn parse, and then exit.
--import=dir-I dirAdd directory dir to the import path.
--list-modelsList the Dezyne models defined in the file, with their type.
--locations-LShow locations in output ast.
--model=model-m modelOnly output ast for model model.
--parse-tree-tWrite the raw peg parse tree, skip generating a full ast,
--output=file-o fileWrite ast to file, use “-” for standard output.
Next: Invoking dzn simulate, Previous: Invoking dzn lts, Up: The Dezyne command-line tools [Contents][Index]