la_dfa_2_dot

Crates.iola_dfa_2_dot
lib.rsla_dfa_2_dot
version0.5.0
created_at2025-12-12 16:51:07.482203+00
updated_at2025-12-12 16:51:07.482203+00
descriptionCreate graphs from lookahead DFAs generated by `parol`.
homepage
repositoryhttps://github.com/jsinger67/la_dfa_2_dot
max_upload_size
id1981855
size331,544
Jörg Singer (jsinger67)

documentation

README

LaDfa2Dot

This is a tool to support the development of parsers generated by parol.

It creates Graphviz representations of parol's lookahead DFAs. Parsers generated by parol use them during parsing to decide which production to choose next when facing a certain sequence of input tokens.

The syntax is derived from the generated parser source (Rust). The tool transforms a generated parser file into DOT files which are put into the given output folder.

It also inserts the correct terminal name in lieu of the rather cryptic terminal index into the generated DOT files to increase readability.

This way the resulting DFAs could be evaluated much easier.

Try

cargo run -- --help

to get help.

To visualize the lookahead DFAs of the LL(5) grammar used by this crate call this

cargo run -- -f .\src\la_dfa_2_dot_parser.rs -o ..\la_dfa_2_dot_dot

Please note, that the invocation above will create a folder in parallel to the current crate's folder. This folder will contain the dot files derived resp. re-engineered form the parser used in this crate.

Inspect for instance the file ConstDeclaration.dot which is a good example of a LL(5) lookahead DFA.

License

la_dfa_2_dot is free, open source and permissively licensed! Except where noted (below and/or in individual files), all code in this repository is dual-licensed under either:

at your option. This means you can select the license you prefer!

Commit count: 0

cargo fmt