4 ms·
This doesn't prove C++'s grammar is undeciable. Template expansion is seperate from parsing. Besides you can do the same thing in any language that can do Turin
by rowanG077 7y ago
This doesn't prove C++'s grammar is undeciable. Template expansion is seperate from parsing. Besides you can do the same thing in any language that can do Turing complete compile time programming.
- Kranar 7y agoTemplate expansion is not separate from parsing in C++. That's the very thing this article explicitly demonstrates. A program will end up being parsed in two different ways depending on the solution to an instance of Post's Correspondence Problem. In one solution a declaration of x parses into a variable, in another solution a declaration of x parses into a function. Which of those two parse trees is actually correct? That question is not decidable and hence C++'s grammar is undecidable.
- deleted 7y ago[deleted]
- rowanG077 7y agoYou are right! I didn't realize this.