Definitions.

D  = [0-9]
L  = [A-Za-z]
%%W  = [A-Za-z0-9\._]
W  = [^=\s\r\n]
WS = \s
CR = \r
NL = \n
EQ = =

Rules.
{W}+  : {token, {word, TokenLine, TokenChars}}.
{EQ}  : {token, {eq, TokenLine, TokenChars}}.
{WS}+ : {token, {ws, TokenLine, TokenChars}}.
({CR}|{NL}|{CR}{NL}) : {token, {nl, TokenLine, TokenChars}}.

Erlang code.

