Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Scanning the C language is done using regular expressions, typically. Parsing the resulting token stream cannot be done with only regular expressions.

At least not with the theoretical construct. Some "regular expressions" libraries, notably PCRE, let you do plenty that goes beyond the theory at the expense of some efficiency. Parsing some context-free grammars with these libraries is certainly possible, but you're not really restricting yourself to "just" regular expressions at that point. Regular expressions plus interwoven use of a stack is a pushdown-automata, which can totally parse C and HTML.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: