Timeline for What are the exact requirements of not requiring forward declarations everywhere?
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 28, 2023 at 13:04 | comment | added | rpjohnst | The linked answer has some examples, but the problem in C and C++ is specifically that the grammar relies on knowing whether an identifier is a type or a value in several places. So even if you try to do two passes (one to collect the names and another to resolve the references) you will not be able to produce an unambiguous syntax tree until the second pass- and in some cases that means you will not even have an accurate set of names after the first pass. | |
Jul 27, 2023 at 23:47 | comment | added | André L F S Bacci |
About keywords, it depends. For example, PHP have both class and function , but Java and C# have only class . For the C/C++ case, I linked another answer with a detailed explanation.
|
|
Jul 27, 2023 at 23:47 | history | edited | André L F S Bacci | CC BY-SA 4.0 |
Link
|
Jul 27, 2023 at 23:29 | history | edited | André L F S Bacci | CC BY-SA 4.0 |
Small improvements.
|
Jul 27, 2023 at 23:28 | comment | added | user23013 | "Languages with keywords to declare types and functions", did you mean different keywords to declare the two? Of course it would require multiple passes. But I'm also interested in the part that may make C and C++ problematic even with multiple passes. | |
Jul 27, 2023 at 23:27 | history | edited | André L F S Bacci | CC BY-SA 4.0 |
added 327 characters in body
|
Jul 27, 2023 at 23:20 | history | answered | André L F S Bacci | CC BY-SA 4.0 |