Download presentation
Presentation is loading. Please wait.
Published byMartin Ryan Modified over 8 years ago
1
Math Expression Evaluation With RegEx and Finite State Machines
2
The Context I created a Java application that evaluates simple mathematical expressions that the user inputs. The expressions were parsed with regular expressions like so:
3
RegEx to FSM I have created the finite state machine for A to the left, the first regex statement (the one directly after return ). Each arrow that doesn’t have a condition is an implied “anything else” (or “^[[-]*]” in S 0 ’s case). The other regular expressions are very similar, they just have dots included. Figure A.
4
RegEx to FSM I created one finite state machine based on the whole return statement by calling each expression A, B, C, D, E, F, G, H, and I respectively:
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.