
messages.attributeDescriptions.recoverWhile.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grammar-kit Show documentation
Show all versions of grammar-kit Show documentation
Grammar-Kit library dedicated for language plugin developers.
The newest version!
Name of the recovery predicate rule or "#auto" which means "! FOLLOWS(rule)".
The contract:
- The attributed rule is handled as usual
- And regardless of the result parser will continue to consume tokens while the predicate rule matches
Notes:
- This attribute in most cases should be specified on a rule that is inside a loop
- That rule should always have *pin* attribute somewhere as well
- Attribute value should be a predicate rule, i.e. leave input intact
- In most cases the predicate is "! FOLLOWS(rule)" and can be copied from the rule Quick Documentation
Parenthesized list example:
{
tokens=[number="regexp:\d+" comma="," paren1="(" paren2=")"]
}
list ::= "(" [!")" item (',' item) * ] ")" {pin(".*")=1}
item ::= number {recoverWhile=item_recover}
private item_recover ::= !(")" | ",")
© 2015 - 2025 Weber Informatics LLC | Privacy Policy