# Class: com.pnfsoftware.jeb.util.encoding.jflex.DefaultJFlexLexer

This is a default, and abstract implementation of a Lexer using JFLex with some utility methods that Lexers can implement. See flex examples at https://github.com/nordfalk/jsyntaxpane.

## Constructor: DefaultJFlexLexer


## Protected Field: offset
Type: `int`

## Protected Field: tokenLength
Type: `int`

## Protected Field: tokenStart
Type: `long`

## Method: parse
- parameter: `s`, type: `java.lang.String`
- return type: `java.util.List<com.pnfsoftware.jeb.util.encoding.jflex.Token>`


## Method: parse
- parameter: `in`, type: `java.io.Reader`
- parameter: `tokens`, type: `java.util.List<com.pnfsoftware.jeb.util.encoding.jflex.Token>`


## Protected Method: token
- parameter: `type`, type: `com.pnfsoftware.jeb.util.encoding.jflex.TokenType`
- parameter: `tStart`, type: `int`
- parameter: `tLength`, type: `int`
- parameter: `newStart`, type: `int`
- parameter: `newLength`, type: `int`
- return type: `com.pnfsoftware.jeb.util.encoding.jflex.Token`

Description: Helper method to create and return a new Token from of TokenType tokenStart and tokenLength will be modified to the newStart and newLength params

## Protected Method: token
- parameter: `type`, type: `com.pnfsoftware.jeb.util.encoding.jflex.TokenType`
- parameter: `start`, type: `long`
- parameter: `length`, type: `int`
- return type: `com.pnfsoftware.jeb.util.encoding.jflex.Token`

Description: Create and return a Token of given type from start with length offset is added to start

## Protected Method: token
- parameter: `type`, type: `com.pnfsoftware.jeb.util.encoding.jflex.TokenType`
- return type: `com.pnfsoftware.jeb.util.encoding.jflex.Token`

Description: Create and return a Token of given type. start is obtained from [DefaultJFlexLexer#yychar()](DefaultJFlexLexer#yychar()) and length from [DefaultJFlexLexer#yylength()](DefaultJFlexLexer#yylength()) offset is added to start

## Protected Method: token
- parameter: `type`, type: `com.pnfsoftware.jeb.util.encoding.jflex.TokenType`
- parameter: `pairValue`, type: `int`
- return type: `com.pnfsoftware.jeb.util.encoding.jflex.Token`

Description: Create and return a Token of given type and pairValue. start is obtained from [DefaultJFlexLexer#yychar()](DefaultJFlexLexer#yychar()) and length from [DefaultJFlexLexer#yylength()](DefaultJFlexLexer#yylength()) offset is added to start

## Method: yychar
- return type: `long`

Description: Return the char number from beginning of input stream. This is NOT implemented by JFlex, so the code must be added to create this and return the private yychar field

## Method: yycharat
- parameter: `pos`, type: `int`
- return type: `char`

Description: Returns the character at position `pos` from the matched text. It is equivalent to yytext\(\).charAt\(pos\), but faster
parameter: pos: the position of the character to fetch. A value from 0 to yylength\(\)\-1.
return: the character at position pos

## Method: yylength
- return type: `int`

Description: Returns the length of the matched text region. This method is automatically implemented by JFlex lexers

## Method: yylex
- return type: `com.pnfsoftware.jeb.util.encoding.jflex.Token`

Description: This is called to return the next Token from the Input Reader
return: next token, or null if no more tokens.
throws: 

## Method: yyreset
- parameter: `reader`, type: `java.io.Reader`

Description: This will be called to reset the the lexer. This is created automatically by JFlex.

## Method: yytext
- return type: `java.lang.String`

Description: Returns the text matched by the current regular expression. This method is automatically implemented by JFlex lexers

