Related articles |
---|
RE: LR Parsing of Permutation Phrases christopher.f.clark@compiler-resources.com (Christopher F Clark) (2024-10-12) |
From: | Christopher F Clark <christopher.f.clark@compiler-resources.com> |
Newsgroups: | comp.compilers |
Date: | Sat, 12 Oct 2024 21:34:24 +0300 |
Organization: | Compilers Central |
Injection-Info: | gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="59347"; mail-complaints-to="abuse@iecc.com" |
Keywords: | LR(1), parse |
Posted-Date: | 12 Oct 2024 15:24:32 EDT |
Thanks for pointing out this paper. The paper is a nice presentation
of how to extend the "closure" operation of LR parsing to handle
permutation phrases. I will definitely add this to my toolbox of
techniques.
The only restriction mentioned in the paper that is slightly troubling
is that it depends upon the elements being permuted must be unique,
which if one uses it with non-terminals (as the items being permuted)
could be problematic since, if I recall correctly, it is impossible in
some cases to determine if two non-terminals never derive the same
string. However, in most practical cases that won't be a problem.
Moreover, I suspect if one uses the typical disambiguation rules in
yacc-like parsers, the ones borrowed from precedence parsing, you can
resolve that issue.
--
******************************************************************************
Chris Clark email: christopher.f.clark@compiler-resources.com
Compiler Resources, Inc. Web Site: http://world.std.com/~compres
23 Bailey Rd voice: (508) 435-5016
Berlin, MA 01503 USA twitter: @intel_chris
------------------------------------------------------------------------------
Return to the
comp.compilers page.
Search the
comp.compilers archives again.