When implementing the WIG scanner you may have to take into account the fact that WIG has multiple so-called lexical scopes. You already encountered lexical scopes when implementing multi-line comments for JOOS: inside comments, there exists a different set of tokens/keywords than outside comments. WIG has even more such scopes. Consider the following little WIG fragment:

service {
const html Compliment = <html> <body>
This is a <[fin]> great service, man!
</body> </html>;

const html Pledge = <html> <body>
What is your name?
<input name=name type="text" size=20>
</body> </html>;

string name; //name is an id here, although it is a keyword inside HTML tags
//inside HTML text, it's considered plain text

session Contribute() {

In this snippet I identified the following lexical scopes:

Can you think of other lexical scopes? What about HTML comments? Do those exist in the benchmarks? If so, can HTML comments be nested?

You can extend a Flex scanner with lexical scopes using so-called start conditions. You prefix a regular expression with <c> to denote that it should only be scanned when being in state c. You switch to a state c by calling BEGIN(c) in the scanner's action.

SableCC supports a similar mechanism using so-called states (see pages 35 ff).