
messages.attributeDescriptions.hooks.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!
Custom rule parsing hooks, e.g. whitespace binders. A hook is a piece of code that implements
org.intellij.grammar.parser.GeneratedParserUtilBase.Hook
interface
Examples:
{
parserImports=[
"static com.intellij.lang.WhitespacesBinders.*"
"static com.sample.MyHooks.*" ]
}
root ::= left_binder right_binder both_binders
// standard hooks for left, right and both binders
left_binder ::= ... { hooks=[leftBinder="GREEDY_LEFT_BINDER"] }
right_binder ::= ... { hooks=[rightBinder="GREEDY_RIGHT_BINDER"] }
both_binders ::= ... { hooks=[wsBinders="GREEDY_LEFT_BINDER, GREEDY_RIGHT_BINDER"] }
// log parsing results via syntax error messages using logHook
logging_rule ::= ... { hooks=[logHook='"in logging_rule!"'] }
// user hook from MyHooks
class
got_hook1 ::= ... { hooks=[myHook1="SOME_CONST"] }
got_hook2 ::= ... { hooks=[myHook2='"string", "array", "args"'] }
© 2015 - 2025 Weber Informatics LLC | Privacy Policy