Skip to content

Create Graphviz representations of `parol`'s LookaheadDFAs

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

jsinger67/la_dfa_2_dot

Repository files navigation

LaDfa2Dot

This is a tool to support the development of 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 changes in the resulting DFA could be evaluated much easier.

Try

la_dfa_2_dot --help

to get help.

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

la_dfa_2_dot -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!

About

Create Graphviz representations of `parol`'s LookaheadDFAs

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages