Sujet : Re: question about linker
De : cr88192 (at) *nospam* gmail.com (BGB)
Groupes : comp.lang.cDate : 03. Dec 2024, 21:49:27
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vinqt2$bede$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
User-Agent : Mozilla Thunderbird
On 12/3/2024 1:27 PM, Janis Papanagnou wrote:
On 03.12.2024 19:57, BGB wrote:
On 12/2/2024 12:13 PM, Scott Lurndal wrote:
>
Indeed. One wonders at Bart's familiarity with formal grammars.
>
In my case, personally I haven't encountered much that doesn't work well
enough with a recursive-descent parser.
Is that meant as a contradiction? - If so, how?
Formal grammars and parser generators aren't usually necessary IME, since recursive descent can deal with most everything (and is generally more flexible than what one can deal with in a formal grammar).
Though, it seems I didn't read enough, they were debating about syntactic use of semicolons as a separator rather than parser writing...
But, yeah, in that context I think it is more a tradeoff between semicolons and syntactically significant line-breaks.
Can go either way, where line-breaks make more sense if one is wanting to design a parser like:
Read one line of input;
Break into tokens;
Parse a statement.
But then the language generally needs an explicit line continuation character, say:
c=func(a, \
b, c)
And, debate whether it is better to have a semicolon on every line, or a line continuation to break up long lines.
Separators can serve to help avoiding expressions merging in unintended ways, but could be avoided or left optional if one is going for a simplistic syntax, say:
proc A B C
dst = func A B C
Probably with the language disallowing the creation of any complex expressions (and/or, one goes down the path that leads to either S-expressions or Smalltalk syntax).
Janis