Sujet : Re: question about linker
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.cDate : 04. Dec 2024, 11:45:36
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vipbsh$qllb$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 03.12.2024 21:49, BGB wrote:
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).
Hmm, okay. We obviously widely disagree here. IMO a language needs a
consistent grammar that one can look up to understand the syntactic
structure of a language as a clean basis for its semantics. (I don't
usually want to read [language implementation-]code (if available in
the first place) to understand the languages' syntactical structure.)
Language and grammar belongs together. Implementing a compiler or an
interpreter for a language where no grammar was (or can be?) defined
sounds absolutely odd to me.
Of course you don't "need" a grammar to _implement_ a language tool,
but it serves (and not only) to build a coherent language. Once you
have a grammar for your language you can then make use of tools and
formal rules to create a reliable outcome.
(There's a small textbook from N. Wirth where he explains compiler
construction (or rather, a specific, simple form of it) based on an
LL(1) grammar and implemented that by a Recursive Descent parser. -
Emphasis on the _grammar_ as base of the design and development! -
I pointed to this example because - I think for simplicity - it also
decided to implement the language using a Recursive Descent parser.
Usually more powerful grammars and parsers are used; LR, LALR, ...)
Though, it seems I didn't read enough, they were debating about
syntactic use of semicolons as a separator rather than parser writing...
Right. (Semicolons are a very basic element of a language and its
"formal grammar" that Scott was referring to.)
Janis
[...]