I am trying to intoduce Java Modeling Language (JML) in my project.
They use annotations in comments (e.g. /* @requires ... */)
I override(?!) the hidden symbols in my grammar:
grammar de.tu_bs.cs.isf.cbc.textual.tool.Dsl with jbase.Jbase hidden(WS, SL_COMMENT)
Then I have a rule
JMLAnnotation returns JMLAnnotation:
'/*'( ID
// ("*"* "@requires" requires=JMLExpression ";") &
// ("*"* "@ensures" ensures=JMLExpression ";")
)-> '/*'
;
I commented out the "complicated" part and currently I am trying to get a simple ID in between the comment section.
However, on execution of /* foo */ I get:
mismatched input '/*foo */' expecting '/*'
So the parser recognized the comment and didn't skip it, but I couldn't get an example working with this.