when porting from langium we have a grammar excerpt like
grammar Repro;
interface Root { Value composite }
composite ID: RawId | EscapedId;
composite QualifiedName: ID ("." ID)*; // greedy — consumes all dot-separated IDs
composite PATH: ID ("/" ID)* ":" ID | ID;
composite QualifiedPATH: QualifiedName "::" PATH | PATH;
token RawId: /[_a-zA-Z][\w_-]*/;
token EscapedId: /`[^`]*`/;
hidden token WS: /[ \t\r\n]+/;
Root returns Root:
Value=QualifiedPATH;
and expect to be able to parse
| Input |
Expected QualifiedPATH result |
Notes |
myId |
myId |
plain PATH (single ID) |
some/path:node |
some/path:node |
PATH with slash+colon |
pkg::node |
pkg::node |
single-segment qualified name |
a.b.c::node |
a.b.c::node |
multi-segment qualified name |
but
myId
does not parse
extended to
EnumMemberValue returns EnumMemberValue:
"enum-member" "<" EnumRef=QualifiedPATH "." MemberName=ID ">";
enum-member<EntityType.LegalEntity> also does not parse
when porting from langium we have a grammar excerpt like
and expect to be able to parse
QualifiedPATHresultmyIdmyIdsome/path:nodesome/path:nodepkg::nodepkg::nodea.b.c::nodea.b.c::nodebut
myIddoes not parse
extended to
enum-member<EntityType.LegalEntity>also does not parse