1

I would like for the user to be able to pass in a string such as:

FLOOR(AVG(SomeToken)) and validate that this string is Valid (e.g., nesting is correct, parenthesis are closed, FLOOR and AVG are valid functions, SomeToken is a valid is token).

I'm not sure where to begin to do something like this. I've tried looking at lexers/parsers but still a bit lost.

john
  • 33,520
  • 12
  • 45
  • 62
  • See my SO answer on how to write recursive descent parsers; these are easy and work very well on expression-like (yours) langauges. https://stackoverflow.com/questions/2245962/is-there-an-alternative-for-flex-bison-that-is-usable-on-8-bit-embedded-systems/2336769#2336769 – Ira Baxter Jul 06 '18 at 08:06

0 Answers0