Customizing the tags
We are wrapping each Title token with a nicely customized <Title> tag. For the other tokens, however, we are wrapping them with a generic <Field> tag. We can do better!
A JFlex specification can define states. Thus, what we will do is:
- after consuming the slash which follows the Title token we will go into the "Author state". When we read in a token while in this state then we know it is an Author, so we will output <Author> (rather than <Field>)
- after consuming the slash which follows the Author token we will go into the "Date state". When we read in a token while in this state then we know it is a Date, so we will output <Date> (rather than <Field>)
- etc