这是一篇来自澳洲的编写代码来模拟基于FSA的正则表达式引擎的代码代写
overview
In this assignment, you will be writing code to simulate a FSA based regular expression engine.
The system you develop will need to generate the FSA structures that match a given Regex dynamically and then evaluate several series’ of inputs against that FSA to determine whether they are a match.
This assignment requires you to apply concepts and techniques covered in Chapters 0-4 of the Notes on FSAs (see course readings).
You’ll also need to document and thoroughly test your code using unit tests to ensure robust event handling techniques are being used.
Your Task
The system will need to:
- Parse an basic regular expression from standard input
- Generate a ε-NFA to evaluate the regular expression
- Evaluate the subsequent inputs against the regular expression.
Event Driven systems are particularly prone to errors so you’ll also need to:
- Document your planning of the system (See Logging/Documenting your Progress below)
- Write your own suite of test cases for your code (See Testing your Code below)
Programming Language/Software Requirements
Version Control System
Your work must be stored and submitted using GitHub
You will need to log your progress by commenting on your commits
Programming Language
You will need to use Java & JUnit to complete this assignment.
Your code will be run using JDK 11
Your test code will be run using JUnit 4
Your implementation must not use any of the programming language’s inbuilt regular
expression parsing/evaluation libraries/classes.
Your implementation may use any other libraries/classes available in the standard JDK
and JUnit, but no other external libraries/classes.
Your programs will be executed with the commands shown below:
Compiled with
javac RegexEngine.java
Run with:
java RegexEngine
or for verbose mode
java RegexEngine -v
Tests compiled with:
javac *_Test.java
Each Test run with:
java org.junit.runner.JUnitCore TestName_Test
Input Format
Your program will need to read input from the terminal/command line’s standard input ( System.in ).
The expected input format is as follows:
(ab)*|c+
abc
ccc
- The input begins with the regular expression to test.
In this assignment, a regular expression can consist of lower and upper case
letters, numbers, spaces, the alternation operator ( | ), the Kleene star and Kleene
plus 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
and exit with an exit code of 1.
- The next section of input contains the input strings to evaluate against the regular
expression.
Each string is on its own line; when a new line is entered, another string begins
(don’t forget to reset states)
A string can be empty/blank.
A string can contain whitespace and other control characters.
- This repeats until the program is terminated with a SIGTERM (Ctrl-C).
程序辅导定制C/C++/JAVA/安卓/PYTHON/留学生/PHP/APP开发/MATLAB

本网站支持 Alipay WeChatPay PayPal等支付方式
E-mail: vipdue@outlook.com 微信号:vipnxx
如果您使用手机请先保存二维码,微信识别。如果用电脑,直接掏出手机果断扫描。
