A regex could convert your string into a series of tokens, namely a stack:Quote:
Sure, but what would be the value of recognizing a literal String in a mess such as this: ((;"foo))"
which could then be fed into a derivation table for a series of reductions and or code generation. That's the whole point of compiler. The scanner portion, simply tokenizes the input into discrete tokens which are a combination of literal values, terminal and non terminal symbols described in the grammar for the language.Code: