News for hackers. Stuff that matters.
Re:Why I’m quitting the C++ Grandmaster Certification course by azov on Sunday June 23, 2013 @08:10PM (#5930167)
Dealing with the lack of regex engine^ is such a tiny part of the monumental task of implementing C++ compiler from scratch - it's like quitting Mt. Everest summit expedition because a three-story hotel on the way there doesn't have elevator.

^ - which he probably didn't need to begin with

Re:Why I’m quitting the C++ Grandmaster Certification course by paulhodge on Sunday June 23, 2013 @08:22PM (#5930199)
That's where he lost me as well, I've written a few parsers and seen a lot of compiler implementations, and almost never is a regex library a part of the equation.

Regexes aren't powerful enough for a full language, so you'll have to write your own lexer/parser anyway (or use a parser generator). And once you're going down that road, it's pretty awkward and unnecessary to try to jam in a regex library to only parse subsections.

Re:Why I’m quitting the C++ Grandmaster Certification course by makmanalp on Sunday June 23, 2013 @08:33PM (#5930229)
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?

Re:Why I’m quitting the C++ Grandmaster Certification course by strager on Sunday June 23, 2013 @08:47PM (#5930282)
Some lexing languages (e.g. Alex[1]) use regexp for matching tokens.

[1] http://www.haskell.org/alex/doc/html/regexps.html

Re:Why I’m quitting the C++ Grandmaster Certification course by lubomir on Monday June 24, 2013 @03:49AM (#5931555)
Flex [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/

Re:Why I’m quitting the C++ Grandmaster Certification course by fafner on Sunday June 23, 2013 @09:06PM (#5930360)
Not to mention that he probably could have used POSIX regex support from glibc:

http://www.gnu.org/software/libc/manual/html_node/Regular-Ex...

Re:Why I’m quitting the C++ Grandmaster Certification course by eliben on Sunday June 23, 2013 @10:48PM (#5930693)
Yes, assuming that regexes are actually being used to parse real-world languages like C++ is charmingly naive.