Author: Stan Eisenstat
Subject: Re: [Cs323] parsley circular definition?
Date: Friday, 18 Sep 2020, 07:32:36
> Message Posted By: Unknown > > I'm trying to understand the appendix of parsley, specifically the syntax > of [command]. I'm a little confused here -- it seems like [command] relies > on [sequence] to be defined, [sequence] relies on [and-or], [and-or] > relies on [pipeline], [pipeline] relies on [stage], [stage] relies on > [subcmd], and [subcmd] relies on [command]. Is this a circular definition? > Or would you keep parsing until which is [simple]? No, it is not a circular definition. The expression grammar in the Addendum on Parsing is similar but simpler: [factor] = VARIABLE / ([expression]) [term] = [factor] / [term] * [factor] [expression] = [term] / [expression] + [term] The recursion is necessary to allow expressions like a + b * (c + d * (e + f * (g + h * (i + j)))) --Stan-PREV INDEX NEXT