Create a C++ program that will parse a string matching expression aimed at producing a true/false result.
Assume a reference string
'THIS IS A STRING'
and a user entered pattern/expression
"his || sTring"
The objective is to test whether the pattern matches the reference string - which it does in this example.
Allowable operators are:
||, or = OR
&&, and = AND
^ = XOR
!, not= NOT
( ) parenthesis for nested patterns
The parser should follow the usual C++ precedence rules.
Another contrived example for the same reference string:
"(this or that) and (str and !srt)"
This would also produce a 'true' result.
Note the operator has 2 forms - C style symbol or a string equivalent.
The user can enter either depending on the situation.
For cases where the reference string is known NOT to use the keywords 'and', 'not', 'or', 'xor' the string form of the operators is likely to be used.
Otherwise the C style operator form shall be used.
Your program will be built on Microsoft Windows with visual Studio 2015 or later to produce an EXE.
Your EXE should read in an ASCII file - can hardcode the filename - which is a simply a line of reference text entries - each line is just some arbitrary reference string.
The EXE should also prompt user for a pattern string. Then simply dump to std::cout the result (true/false) of matching the user entered pattern against each string found in the text file. This allows me to quickly check the pattern matching against arbitrary strings.
Libraries, where used, should be open-source for full transparency.
Let me know your bid and time estimate
32 freelances font une offre moyenne de 22 $/heure pour ce travail
Hello, I'm a former CP (competitive programming) competitor, I'm a master at algorithms and algorithms and could help you solve your problem quickly with clean, optimized and well-commented code.
Hello I understood your requirement but I have few doubts, text me so I can clear all my doubts right away, I can help you and i am ready for work. Thank you.