Building a better interface
Right now, the parser that we have built is not really easy to use. In order to use the parser correctly, a user (in this context, read "user" as "another developer that uses your parser") has to call the match_Expr() method (which is just one of many public match_* functions offered by the parser that are not actually supposed to be called by external users), extract the node property from the returned array, and then call the evaluate function on the root node contained in this property. Also, the parser also matches partial strings (remember the example (1 + 2)) * 3, which was recognized as partially correct by our parser), which might really surprise some users.
This reason is enough to extend our project by a new ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access