JFlex sample learning and refactoring