chomsky-hierarchy

Is there a standard C++ grammar?

左心房为你撑大大i 提交于 2019-11-27 10:00:39
问题 Does the standard specify the official C++ grammar? I searched, but did not find it anywhere. Also, I wish to read a bit about C++ grammar in detail, like which category of grammars it falls in, etc. Any links pointing me in the right direction would be helpful. By category, I mean taken from here. 回答1: Yes, it does. The grammar is described in detail throughout the standard and is summarized in Appendix A: Grammar Summary (it's Appendix A in both the C++03 standard and the C++0x final

The difference between Chomsky type 3 and Chomsky type 2 grammar

三世轮回 提交于 2019-11-27 01:23:14
问题 I'm having trouble articulating the difference between Chomsky type 2 (context free languages) and Chomsky type 3 (Regular languages). Can someone out there give me an answer in plain English? I'm having trouble understanding the whole hierarchy thing. 回答1: A Type II grammar is a Type III grammar with a stack A Type II grammar is basically a Type III grammar with nesting. Type III grammar (Regular): Use Case - CSV (Comma Separated Values) Characteristics: can be read with a using a FSM