/**
 * Copyright 2011, Kevin Lindsey
 * See LICENSE file for licensing information
 */
package com.kevlindev.pinconverter.parsing;

import java.util.EnumSet;
import java.util.Set;

import com.kevlindev.parsing.Lexeme;
import com.kevlindev.parsing.Lexer;

/**
 * BoardDefinitionLexer
 * 
 * @author Kevin Lindsey
 * @version 1.0
 */
public class BoardDefinitionLexer extends Lexer<BoardDefinitionTokenType> {
	/**
	 * This is a special token used to indicate the end of file
	 */
	private static final Lexeme<BoardDefinitionTokenType> EOF = new Lexeme<BoardDefinitionTokenType>(BoardDefinitionTokenType.EOF, 0, 0, "");

	/**
	 * This is a set of all tokens this lexer generates
	 */
	private static final Set<BoardDefinitionTokenType> TOKENS = EnumSet.allOf(BoardDefinitionTokenType.class);

	/**
	 * This is a list of tokens that the lexer will match but that should be
	 * ignored
	 */
	private static final Set<BoardDefinitionTokenType> FILTERED_TOKENS = EnumSet.of(BoardDefinitionTokenType.WHITESPACE, BoardDefinitionTokenType.COMMENT);

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.kevlindev.pinconverter.parsing.Lexer#getEOF()
	 */
	@Override
	protected Lexeme<BoardDefinitionTokenType> getEOF() {
		return EOF;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.kevlindev.pinconverter.parsing.Lexer#getFilteredTokens()
	 */
	@Override
	protected Set<BoardDefinitionTokenType> getFilteredTokens() {
		return FILTERED_TOKENS;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.kevlindev.pinconverter.parsing.Lexer#getTokens()
	 */
	@Override
	protected Set<BoardDefinitionTokenType> getTokens() {
		return TOKENS;
	}
}

@@ -178,45 +178,8 @@
 t;%0A%0A
-import com.kevlindev.parsing.Lexeme;%0A
 impo
@@ -368,219 +368,8 @@
 %3E %7B%0A
-%09/**%0A%09 * This is a special token used to indicate the end of file%0A%09 */%0A%09private static final Lexeme%3CBoardDefinitionTokenType%3E EOF = new Lexeme%3CBoardDefinitionTokenType%3E(BoardDefinitionTokenType.EOF, 0, 0, %22%22);%0A%0A
 %09/**
@@ -790,99 +790,8 @@
 );%0A%0A
-%09/*%0A%09 * (non-Javadoc)%0A%09 * %0A%09 * @see com.kevlindev.pinconverter.parsing.Lexer#getEOF()%0A%09 */%0A
 %09@Ov
@@ -812,15 +812,8 @@
 ted 
-Lexeme%3C
 Boar
@@ -836,16 +836,19 @@
 Type
-%3E
  getEOF
+Type
 () %7B
@@ -857,16 +857,41 @@
 %09return 
+BoardDefinitionTokenType.
 EOF;%0A%09%7D%0A

Use new mechanism that creates an EOF token for us which includes the current offset