I have a token definition that can contain multiple lines (something like multi line comments).
I can use the .line attribute to get the line where the token starts, but I need to
know where the token end.
Is it possible to get the last line of the token?
You can change the line number of a token by placing the (Java) code-block
{$line=getLine();}at the end of the rule.So, for multi-line comments, that would look like this:
causing the method
getLine()of the tokenCOMMENTto return the line number the sub-string"*/"occurred on.