Sujet : Re: question about linker
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.cDate : 04. Dec 2024, 20:33:41
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <viqaqn$12goo$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 04.12.2024 20:21, BGB wrote:
On 12/4/2024 10:49 AM, Scott Lurndal wrote:
>
How can you write a correct recursive descent parser without a
formal grammar (at least on paper) for the language being parsed?
It is usually a thing of pattern matching the next N tokens, based on
the structure of the language.
You can write or reference a syntax in BNF or EBNF or similar, but it is
not necessary, and some languages (like C) may contain things that can't
be fully expressed via an BNF (say, for example, things that depend on
prior typedefs, etc).
Knowledge of the theory of formal languages would give you answers
concerning what a Context Free Grammar can do and what not, for what
parts you need, say, attributed grammars, contexts, and so on. - So
that's not really an argument against formal grammars if we discuss
syntax.
(Algol 68 of course went a step further with van Wijngaarden Grammar.
Just to mention another sort and a further step of advanced grammar
concepts.)
Janis
[snip rest; tldr]