Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualize NFA with DOT language #5

Merged
merged 13 commits into from
Apr 2, 2023
Merged

Visualize NFA with DOT language #5

merged 13 commits into from
Apr 2, 2023

Conversation

Lai-YT
Copy link
Owner

@Lai-YT Lai-YT commented Apr 1, 2023

Motivation

regexp converts the regular expression into an NFA before simulating.
We would like to see what such NFA looks like, which is valuable in learning how Thompson's algorithm works.

This feature bumps the version to 0.1.0.

What's new?

  • A nfa2dot function that traverses the NFA and does the conversion
  • Command line options --graph (-g) and --output (-o) on using the graph mode and specifying the output dot file

Breaking change

  • The short option for getting the version number is now -V instead of -v. -v is preserved for the possible use of verbose.

How has this been tested?

A test script cli_test.sh feeds arguments the regexp and checks the exit code.

# Give permission on execution
$ chmod +x cli_test.sh

# Run CLI tests
$ ./cli_test.sh

Checklist

I have completed the following:

  • Added appropriate comments to my code where the code is not easily understood.
  • Updated the relevant documentation.
  • Added tests to cover the proposed changes (and if not, explain why).

Resolves: #1

@Lai-YT Lai-YT added the enhancement New feature or request label Apr 1, 2023
@Lai-YT Lai-YT linked an issue Apr 1, 2023 that may be closed by this pull request
@Lai-YT Lai-YT force-pushed the visualize-states branch from 09facd7 to 095f680 Compare April 2, 2023 01:53
@Lai-YT Lai-YT force-pushed the visualize-states branch from 095f680 to 71a8ae2 Compare April 2, 2023 02:00
@Lai-YT Lai-YT merged commit 7bfb589 into main Apr 2, 2023
@Lai-YT Lai-YT deleted the visualize-states branch April 2, 2023 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Visualize finite automata with Graphviz
1 participant