Please see the example grammar at:
JavaFX Lexer Example