some progress on yoyowg vs. a68 RR

WB Kloke wb@pkeus.de
Wed Mar 19 20:49:17 GMT 2025


Some small progress at applying yoyovwg to real grammars.

1. The yoyovwg program, as it was, is too restrictive on the grammars. Rule (R4)
did  not allow left recursive hypernotions. Forbidding garanties termination
of the parsing program, but in fact did exclude even the sample EX2 of 
Tony Fisher's paper. I downgraded the error [R4] to a warning. Now the example 
def.vwg grammar works as intended.

2. The Algol68 grammar of the RR uses the NEST metanotion to accumulate
the declared notions by appending new LAYERs in the transition from a
series via serial-clause to a closed-clause. Thus, the metanotion NEST
cannot be LL(1), because the "n" of "new" will have to follow a NEST.
This can be repaired by reversing the internal NEST ordering, probably.

3. The use of predicates is not compatible with the yoyovwg program.
The program classifies hyperrules as L or R, when metanotions occur only
on one side of a hr. Any L type hr cannot be resolved into a R type hr.
Example is the following subset of the a68 RR:

program : strong void new closed clause .
SOID NEST closed clause : SOID NEST serial clause defining LAYER PACK.
SOID NEST serial clause defining new PROPSETY : SOID new PROPSETY NEST series with PROPSETY.
SOID NEST series with EMPTY : SOID NEST unit.
SOID NEST series with LABSETY : strong void NEST unit, go on {}symbol, SOID NEST series with LABSETY .
SOME unit : SOME skip .
strong MOID NEST skip :  skip {}token .

The last line is type R, where the 2nd is type L.
The grammar parses programs like
(SKIP;SKIP)
or
BEGIN PR PR skip END

but only when the last line is changed to 
strong void new new skip : skip {}token .

4. Some predicates, such as those occurring in {321b} can be avoided by
splitting the alternatives (see 5th line of the example above).
This avoids the R typing when the only function of the predicate (which uses
metanotions on the right side not occurring on the left) is to select the
alternatives.

But this does not solve the problem described under 3., getting rid of
the spurious NEST, when the grammar only needs to parse a skip token.



More information about the Algol68 mailing list