Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.compilers > #2672
| From | gah4 <gah4@u.washington.edu> |
|---|---|
| Newsgroups | comp.compilers |
| Subject | Re: About finding the start symbol of a grammar |
| Date | 2021-05-22 13:17 -0700 |
| Organization | Compilers Central |
| Message-ID | <21-05-021@comp.compilers> (permalink) |
| References | <21-05-020@comp.compilers> |
On Saturday, May 22, 2021 at 10:24:24 AM UTC-7, Christopher F Clark wrote:
> As Dodi noted, this is basically a graph analysis problem and the
> graph may be disconnected (a forest). And our moderator has added
> several insightful comments. E.g. you can "declare" a start symbol
> and if not present default to some symbol, either the first one in the
> grammar, or some symbol from which all other symbols are reachable
> (presuming the graph isn't disconnected), and the start symbol can be
> recursively defined, etc.
Seems to me that this should be related to the problem of finding the
root of a phylogenetic tree.
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7149615/
Unlike CS trees, there is no necessary directionality to the links, and so
finding the root is more difficult. Yet biologists have some desire to
know where the root is.
But as also noted above, in the case of recursion, it depends on the language.
In most languages, <expression> is recursive, allowing for
'(' <expression> ')'
however, a language (though I don't know of any) could require all expressions
to be parenthesized, in which case the start would be the parenthesized form.
[I think previous messagees have made it clear that while this is an
interesting exercise, its only practical use is to see if the start
symbol declared in the grammar is different from the computed one, in
which case the grammar is broken. -John]
Back to comp.compilers | Previous | Next — Previous in thread | Find similar
RE: About finding the start symbol of a grammar Christopher F Clark <christopher.f.clark@compiler-resources.com> - 2021-05-22 12:14 +0300 Re: About finding the start symbol of a grammar gah4 <gah4@u.washington.edu> - 2021-05-22 13:17 -0700
csiph-web