I'm recently interested in writing a parser for Java language. My reference is newly released Java SE 16 spec. On 3.2. Lexical Translations, I come across this sentence but I'm not sure whether I get it:
... There is one exception: if lexical translation occurs in a type context (§4.11) and the input stream has two or more consecutive > characters that are followed by a non-> character ...
What I don't understand is how to tell whether it is a "type context" when the lexical analysis is not even done? (§4.11 would probably provide an answer but it's too long so I haven't bother to read it at full) Is the trick here to seperate each >
character as individual tokens and disambiguate it later when it comes to parsing stage? Or is there something obvious that I missed - as I don't have much experience writing language parsers.
Just to provide a bit more context I'm using Alex for lexing and (plan on using) Happy for parsing.