com.aptana.ide.lexer.ascii
Class AsciiLexer

java.lang.Object
  extended by com.aptana.ide.lexer.AbstractLexer
      extended by com.aptana.ide.lexer.ascii.AsciiLexer
All Implemented Interfaces:
ILexer

public class AsciiLexer
extends AbstractLexer

Author:
Kevin Lindsey, Pavel Petrochenko

Field Summary
 
Fields inherited from class com.aptana.ide.lexer.AbstractLexer
currentOffset, lastMatchedTokenIndex
 
Constructor Summary
AsciiLexer()
           
 
Method Summary
 Range find(java.lang.String groupName)
          Use the currently active language and group to locate the first position that matches that group.
 char getCharacterAt(int offset)
          Return the character at the given offset
 java.lang.String getSource()
          Get the text being processed by this lexer
protected  char[] getSourceCharacters()
          Get the character array for the current source
 int getSourceLength()
          Return the number of characters in this lexer's source code
 char[] getSourceUnsafe()
          TODO Remove this method later.
protected  int match()
          match
 void setSource(char[] value)
          Set the text to be processed by this lexer
 
Methods inherited from class com.aptana.ide.lexer.AbstractLexer
addLanguage, createLexeme, getCachedLexeme, getCurrentOffset, getCurrentTokenList, getEOFOffset, getGroup, getLanguage, getLanguages, getNextLexeme, getTokenList, isEOS, seal, setCurrentOffset, setEOFOffset, setGroup, setIgnoreSet, setLanguage, setLanguageAndGroup, setLexemeCache, setLexerState, setLexerState, setSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsciiLexer

public AsciiLexer()
Method Detail

find

public Range find(java.lang.String groupName)
           throws LexerException
Description copied from interface: ILexer
Use the currently active language and group to locate the first position that matches that group. Note that token switchTo's are ignored by this method

Specified by:
find in interface ILexer
Specified by:
find in class AbstractLexer
Parameters:
groupName - The current language's group name that contains the patterns to find
Returns:
Returns an Range where the starting offset is the point where the match occurred and the ending offset is the position where the match ended. If there is no match, then an empty Range will be returned
Throws:
LexerException
See Also:
ILexer.find(java.lang.String)

getCharacterAt

public char getCharacterAt(int offset)
Description copied from interface: ILexer
Return the character at the given offset

Specified by:
getCharacterAt in interface ILexer
Specified by:
getCharacterAt in class AbstractLexer
Parameters:
offset - The offset within the source
Returns:
The character at the given offset
See Also:
ILexer.getCharacterAt(int)

getSource

public java.lang.String getSource()
Description copied from interface: ILexer
Get the text being processed by this lexer

Specified by:
getSource in interface ILexer
Specified by:
getSource in class AbstractLexer
Returns:
The source text
See Also:
ILexer.getSource()

getSourceCharacters

protected char[] getSourceCharacters()
Get the character array for the current source

Specified by:
getSourceCharacters in class AbstractLexer
Returns:
char[]

getSourceLength

public int getSourceLength()
Description copied from interface: ILexer
Return the number of characters in this lexer's source code

Specified by:
getSourceLength in interface ILexer
Specified by:
getSourceLength in class AbstractLexer
Returns:
Returns the source code character count
See Also:
ILexer.getSourceLength()

setSource

public void setSource(char[] value)
Description copied from interface: ILexer
Set the text to be processed by this lexer

Specified by:
setSource in interface ILexer
Specified by:
setSource in class AbstractLexer
Parameters:
value - The new source text
See Also:
ILexer.setSource(char[])

match

protected int match()
Description copied from class: AbstractLexer
match

Specified by:
match in class AbstractLexer
Returns:
Returns the position of the last failed or successful match
See Also:
AbstractLexer.match()

getSourceUnsafe

public char[] getSourceUnsafe()
Description copied from interface: ILexer
TODO Remove this method later.

Returns:
reference to underlying char array
See Also:
ILexer.getSourceUnsafe()