
C++ Parser in Forth? - pplonski86
https://groups.google.com/forum/#!topic/comp.lang.forth/WoXu5N67S6I
======
nly
Somewhat related:

6 minute WTF video on the C++ grammar

[https://www.youtube.com/watch?v=tsG95Y-C14k](https://www.youtube.com/watch?v=tsG95Y-C14k)

~~~
chubot
Yeah this is a good one. I've been programming C++ for a long time and it does
give you a sense of how hopeless this task is :)

------
MaxBarraclough
The unholy union of all my favourite programming nightmares. I wish this
adventurer luck.

------
UncleEntity
I was toying around with a C++ parser in python (using the earley parser
spark.py) a while back and it wasn't all that difficult, couple conflicts that
can't be solved without knowing the type of something in the lexer which can
be sorted out in later stages (methinks?) and (IIRC from looking at the code)
a shift/reduce conflict in declarator-id, but all in all I got it to pass all
the tests I found from some advanced compiler course.

Never went past getting it into a AST because I tend to find some other shiny
thing to play with before I finish things but I'd imagine the implementation
language wouldn't be a serious impediment...saying as someone never having
written a single line of Forth.

\--edit--

C++11 I should say since C++14 added things like >> conflict between the shift
operator and nested templates that I didn't even get around to trying to
solve.

------
linuxlizard
C++ is a little like the English language: a bunch of different pieces
gathered together over a period of time, new features added to replace/fix
old. I like it.

~~~
mhd
It also dropped some letters (æ, þ) and pronouns (thou, thee). Most of what
was added was vocabulary, to be comparable to C++ one would probably have to
add all the Finnish cases, Japanese gendered language and all the Vietnamese
accents.

And then have some people who mostly communicate by yodeling or Mongolian
throat singing.

------
foota
What? Did this item change url and title? Earlier it was an article about
initialization in c++?

~~~
Buge
Are you sure you're not thinking about this?

[https://news.ycombinator.com/item?id=18832311](https://news.ycombinator.com/item?id=18832311)

~~~
foota
That's what I thought this article was... Maybe I opened both of them, read
the other one and closed it, then came back surprised to find this one.

