public static void main(String[] args) {
Lexer lexer = new Lexer();
final Type<Integer> integer = new Type<>("Integer");
final Type<Double> decimal = new Type<>("Decimal");
lexer.addRule("Integer", new Rule<Integer>("[0-9]+", integer, new Action<Integer>() {
@Override
public Token action(Matcher matcher, Lexer lexer, Type<Integer> type) {
return new Token(new Integer(matcher.group()), type);
}
}));