3 ms·
In my admittedly limited experience, I've never seen anyone parse languages with regex for compilers. It doesn't take long to figure out that it'd be unwieldy a
by makmanalp 13y ago
In my admittedly limited experience, I've never seen anyone parse languages with regex for compilers. It doesn't take long to figure out that it'd be unwieldy and hard to be thorough.
LL / recursive descent seems to be the most common.
But anyway, yeah, how the heck do you sign up for such an absurdly huge task and worry that a lack of regexes is the main problem you'll be encountering?
- strager 13y agoSome lexing languages (e.g. Alex[1]) use regexp for matching tokens. [1] http://www.haskell.org/alex/doc/html/regexps.html http://www.haskell.org/alex/doc/html/regexps.html
- lubomir 13y agoFlex [1], too, uses regular expressions. However, the generated source that performs the actual tokenizing/lexing, does not need any library support for them as it is all implemented in the code. So even there lack of regex support in standard library would not be an issue. [1] http://flex.sourceforge.net/ http://flex.sourceforge.net/