rascal icon indicating copy to clipboard operation
rascal copied to clipboard

Use of non-terminals to capture follow and precede restrictions

Open jurgenvinju opened this issue 3 years ago • 0 comments

Describe the bug

3.2. Func: - Why the F0.func/F0.rsc approach? This might be the right location to introduce the 'Location' concept to reference a data/program file. - "layout LAYOUTLIST = LAYOUT* !>> [\t-\n\r\ ] ;" can this be rewritten like this: "layout LAYOUTLIST = LAYOUT* !>> LAYOUT" that would make most syntax definitions more readable

Via @Pieter007

That would be a nice enhancement for the parser generator. There are rules to check (it can only be a single character class, a single literal or a single case insensitive literal) and for non-terminals that combine alternatives of these we could expand the !>>. So requires some additional checks by the type-checker and some unfolding by the parser generator.

jurgenvinju avatar Feb 21 '22 13:02 jurgenvinju