van Wijngaarden grammars
Jose E. Marchesi
jemarch@gnu.org
Sat Mar 8 14:25:44 GMT 2025
I see each struct hypernotion has hlen numbers of struct hitems linked
in hdef, where:
struct hitem
{ enum symbol sy; /* s_ssm or s_meta */
int it_s; /* if sy == s_ssm */
struct dictnode *it_z; /* if sy == s_meta */
bool isbound; /* used by checkgr */
};
So each ssm is an int.
>> Why not tokenizing protonotions rather than small syntactic marks?
>
> The problem is, I don't understand the program enough to make big
> changes. The Fisher-parser operates on metanotions and ssms.
> Checkll1 computes starter sets for each alternative by setting a
> bit for 1st ssm in each and checks, that these are disjoint. So the
> number of ssms should fit into a machine word. Today we may safely
> assume that 64 bits are available.
I see that checkll1 does:
For each metanotion in the metalist,
For each rhs that produces the metanotion,
hn = hypernotion in the rhs
m1 = starters (hn, 0)
where starters returns a bitmap reflecting the presence of all ssm in
the rhs hypernotion, as well as the starters of the metanotions in the
rhs hypernotion. But I don't see it checks the "1st ssm in each". The
loop in `starters' process all the ssm/metanotions of the given
hypernotions, starting at k...
> My 1st idea to do it was to compute a list of all tokens occurring
> in the a68 grammar, by using blanks as delimiters. But this list
> was about 700 or more long, even after exclusion of formatted
> transput. Some of this bloat comes from the metanotions MONAD and
> NOMAD. Even some modes in metanotion STANDARD, don't appear elsewhere
> in the grammar.
>
> But before I tackle these things, I must know whether it is worth the
> trouble. So, the next step after the metanotion LL(1)-problem is the
> application of a small subset of hypernotions excluding some of the
> peculiar features like UNITED mode or FLEX rows, composed operator
> tags and so on.
>
> BTW. I found one other guy working with the Fisher parser:
> https://github.com/vonbecmann/fisher-parser
> I don't know enough about smalltalk to appreciate his work, and I did
> not find out, on which grammars he intended to apply.
More information about the Algol68
mailing list