Re: About finding the start symbol of a grammar

"Ev. Drikos" <drikosev@gmail.com>
Sat, 22 May 2021 06:52:17 +0300

          From comp.compilers

Related articles
About finding the start symbol of a grammar ecosta.tmp@gmail.com (Eduardo Costa) (2021-05-21)
Re: About finding the start symbol of a grammar 563-365-8930@kylheku.com (Kaz Kylheku) (2021-05-21)
Re: About finding the start symbol of a grammar DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2021-05-21)
Re: About finding the start symbol of a grammar anton@mips.complang.tuwien.ac.at (2021-05-21)
Re: About finding the start symbol of a grammar drikosev@gmail.com (Ev. Drikos) (2021-05-22)
Re: About finding the start symbol of a grammar gah4@u.washington.edu (gah4) (2021-05-22)
| List of all articles for this month |
From: "Ev. Drikos" <drikosev@gmail.com>
Newsgroups: comp.compilers
Date: Sat, 22 May 2021 06:52:17 +0300
Organization: Aioe.org NNTP Server
References: 21-05-015
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="33346"; mail-complaints-to="abuse@iecc.com"
Keywords: parse
Posted-Date: 22 May 2021 13:23:54 EDT
Content-Language: en-US

On 21/05/2021 13:49, Eduardo Costa wrote:
> While there would exist grammars we could recursively check to find out which
> it's start symbol is (i.e.: it's the only rule that used the rest of them,
> where checking every other resulted in dangling rules that weren't even called
> in), there might be other grammars for which more than one rule yields full
> coverage (all of these obviously defining different languages) and so leading
> to ambiguity.


IMHO, it can be so simple as you describe here without important overhead.
Typically, a parser will reduce the start symbol and finish. All rules
that yield full coverage can be ie alternatives of a single root symbol:


RootSymbol -> R1 | R2 | ... | Rn


Ev. Drikos


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.