AimsApply Event-Driven Techniques to an Input Stream.Use FSAs (-NFAs, NFAs and/or DFAs) to evaluate the inputs against for a given RegularExpression.OverviewIn this assignment, you will be writing code to simulate a FSA based regular expressionengine.The system you develop will need to generate the FSA structures that match a given Regexdynamically and then evaluate several series of inputs against that FSA to determinewhether they are a match.This assignment requires you to apply concepts and techniques covered in Chapters 0-4 ofthe Notes on FSAs (see course readings).Youll also need to document and thoroughly test your code using unit tests to ensure robustevent handling techniques are being used.Your TaskThe system will need to:1. Parse an basic regular expression from standard input2. Generate a -NFA to evaluate the regular expression3. Evaluate the subsequent inputs against the regular expression.Event Driven systems are particularly prone to errors so youll also need to:1. Document your planning of the system (See Logging/Documenting your Progressbelow)2. Write your own suite of test cases for your code (See Testing your Code below)11/10/2021, 15:25 Programming Assignment 1: Event Driven String Processinghttps://myuni.adelaide.edu.au/courses/64843/assignments/238394 3/9Programming Language/Software RequirementsVersion Control SystemYour work must be stored and submitted using GitHubYou will need to log your progress by commenting on your commitsProgramming LanguageYou will need to use Java & JUnit to complete this assignment.Your code will be run using JDK 11Your test code will be run using JUnit 4Your implementation must not use any of the programming languages inbuilt regularexpression parsing/evaluation libraries/classes.Your implementation may use any other libraries/classes available in the standard JDKand JUnit, but no other external libraries/classes.Your programs will be executed with the commands shown below:Compiled withjavac RegexEngine.javaRun with:java RegexEngineor for verbose modejava RegexEngine -vTests compiled with:javac *_Test.javaEach Test run with:java org.junit.runner.JUnitCore TestName_TestInput FormatYour program will need to read input from the terminal/command lines standard input( System.in ).The expected input format is as follows:11/10/2021, 15:25 Programming Assignment 1: Event Driven String Processinghttps://myuni.adelaide.edu.au/courses/64843/assignments/238394 4/9(ab)*|c+abcccc1. The input begins with the regular expression to test.In this assignment, a regular expression can consist of lower and upper caseletters, numbers, spaces, the alternation operator ( | ), the Kleene star and Kleeneplus operators ( * and + ), as well as brackets ( ( and ) ).You are not expected to handle nested brackets.Invalid input in this section should cause the program to print an error message andexit with an exit code of 1.2. The next section of input contains the input strings to evaluate against the regularexpression.Each string is on its own line; when a new line is entered, another string begins(dont forget to reset states)A string can be empty/blank.A string can contain whitespace and other control characters.3. This repeats until the program is terminated with a SIGTERM (Ctrl-C).Expected Output FormatThe program has 2 output modes; a normal mode and verbose mode.Verbose should trigger if the user adds a -v when running the program (see SoftwareRequirements above)Under normal modeAfter the user has entered the regex your program should print readyYour program should then print true or false once for each input string provided as theyare entered.If the input string matches the regular expression, print trueIf the input string does not match, print falseThe input string should be evaluated for an exact matchi.e. the whole string from start to end must exactly match the regular expression to beaccepted.A string containing a match, but not exactly matching should print false .Example (user input is grey, output is highlighted pink)(ab)*|c+readyabcfalseccctrue11/10/2021, 15:25 Programming Assignment 1: Event Driven String Processinghttps://myuni.adelaide.edu.au/courses/64843/assignments/238394 5/9Under verbose modeAfter the user has entered the regex your program should print a transition table for the NFA generated followed by the word readyThe transition table does not have to exactly match the example below, but does need toreflect the -NFA generated by your system;this is for manual review and your own debugging.Your program should begin to print true or false as the user enters the input strings foreach character input (including the initial state),If the system is currently in an accepting state, print trueOtherwise, print falseHint: After a user has entered the input string the most recent output should match thenormal outputExample (user input is grey, output is highlighted pink)(ab)*|c+epsilon a b c other>q0 q1,q5q1 q2,q8q2 q3q3 q4q4 q1q5 q6q6 q7q7 q5,q8*q8readytrueafalsebtruecfalsetruectruectruectrue
64843
[Solved] 64843 Assignment- RegexEngine
$25
File Name: 64843_Assignment-_RegexEngine.zip
File Size: 273.18 KB
Only logged in customers who have purchased this product may leave a review.
Reviews
There are no reviews yet.