CMPT 440 Formal Languages and Computability Project
- A Java 8 JDK and JRE (version 8.251 known to work)
- Clone the repository (https://github.com/dgrossmann144/FormalLanguagesProject.git)
- Navigate to the repository directory in a terminal
- Create a folder named
binin that directory - Execute the command
javac -d ./bin @sources.txt
- From the directory the repository is installed in, use the Grepy utility using the command
java -cp ./bin Grepy [-d "dfa-fileName"] [-n "nfa-fileName"] "regex" "file.txt" - Valid characters in the input file are the following: a-z, A-Z, and 0-9
- Valid characters in the regex are the following: a-z, A-Z, 0-9, &, @, (, ), *, and |
&is used in place of the empty string symbol epsilon@is used as the empty set symbol- Input file must be a .txt file
java -cp ./bin Grepy "(a|b)*a" "exampleInputFiles/example1.txt"outputs: aaaabbbba, aaaabbbabababa, a, abba, bajava -cp ./bin Grepy "@" "exampleInputFiles/example2.txt"outputs:java -cp ./bin Grepy "(0|1)(10)*0(0|1)" "exampleInputFiles/example3.txt"outputs: 1101001, 000, 001, 101java -cp ./bin Grepy "(k|b|&)(ing)*" "exampleInputFiles/example4.txt"outputs: king, bing, ing, kinging, binging, inginging