resources/messages/attributeDescriptions/methods.html (39 lines of code) (raw):
<html>
<body>
Custom PSI accessors and method mix-ins.
See documentation and HOWTO for more.
<h2>Examples:</h2>
<pre><code>
{
psiImplUtilClass="com.sample.SamplePsiImplUtil"
tokens=[
OP_PLUS='+'
]
}
sum_expr ::= expr '+' expr {
methods=[
// user PSI accessors for sub-rules and tokens:
left="/expr[0]" // will be @NotNull as far as we have "+" in the expression
right="/expr[1]" // "expr" is the name of the auto-calculated child property (singular or list)
op="/OP_PLUS" // explicit token accessor
// method mix-ins from SamplePsiImplUtil
evaluate toString
]
}
list ::= item + {
methods=[
element="item" // rename getItemList() method to getElementList()
// item="" // .. or suppress it completely
]
}
reference ::= id {
methods=[
// rename getId() to getNameIdentifier()
nameIdentifier="id"
// implement getReferences() API via mix-in
getReferences
]
}
</code></pre>
</body>
</html>