I want to parse for instance:
const unsigned int varname;
where the number of qualifiers is unknown and the list of qualifier keywords is also unknown (since new ones can be introduced using using
).
But using the PEG grammar
declaration <- qualifier* varname ';'
qualifier <- identifier
varname <- identifier
does not work because qualifier* consumes the variable name since it matches. Is there a way to do this or do I have to extract the last identifier manually in the reduction rule?