com.aptana.ide.lexer.matcher
Class MatcherTokenList

java.lang.Object
  extended by com.aptana.ide.lexer.TokenList
      extended by com.aptana.ide.lexer.matcher.MatcherTokenList
All Implemented Interfaces:
ICodeBasedTokenList, ITokenList

public class MatcherTokenList
extends TokenList
implements ICodeBasedTokenList

Author:
Kevin Lindsey, Kevin Sawicki

Constructor Summary
MatcherTokenList()
          MatcherTokenList
MatcherTokenList(java.lang.String language)
          MatcherTokenList
 
Method Summary
 void addMatcherToGroup(ITextMatcher matcher, java.lang.String group)
          addMatcher
 Range find(char[] source, int startingPosition, int eofOffset)
          find
 OrMatcher getCurrentMatcher()
          getCurrentMatcher
 int getLastMatchedTokenIndex()
          getLastMatchedTokenIndex
 int match(char[] source, int startingPosition, int eofOffset)
          match
 void seal()
          Build the regexes for each token in this list
 void setCurrentGroup(int index)
           
 void setCurrentGroup(java.lang.String groupName)
          Set the currently active lexer group
 
Methods inherited from class com.aptana.ide.lexer.TokenList
add, add, add, add, createToken, get, getCategoryMap, getCurrentGroup, getGroup, getGroupCount, getGroupIndex, getGroupNames, getIgnoreSet, getLanguage, getTokenCategoriesByName, getTokenTypesByName, getTypeMap, internalAdd, isSealed, setCategoryMap, setGroupIndex, setIgnoreSet, setLanguage, setSealed, setTypeMap, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.aptana.ide.lexer.ITokenList
add, createToken, get, getCurrentGroup, getGroupNames, getIgnoreSet, getLanguage, isSealed, setIgnoreSet, size
 

Constructor Detail

MatcherTokenList

public MatcherTokenList()
MatcherTokenList


MatcherTokenList

public MatcherTokenList(java.lang.String language)
MatcherTokenList

Parameters:
language -
Method Detail

addMatcherToGroup

public void addMatcherToGroup(ITextMatcher matcher,
                              java.lang.String group)
addMatcher

Parameters:
matcher -
group -

find

public Range find(char[] source,
                  int startingPosition,
                  int eofOffset)
Description copied from interface: ICodeBasedTokenList
find

Specified by:
find in interface ICodeBasedTokenList
Returns:
Range
See Also:
ICodeBasedTokenList.find(char[], int, int)

getLastMatchedTokenIndex

public int getLastMatchedTokenIndex()
Description copied from interface: ICodeBasedTokenList
getLastMatchedTokenIndex

Specified by:
getLastMatchedTokenIndex in interface ICodeBasedTokenList
Returns:
The index of the last matching token or -1 if there was no match
See Also:
ICodeBasedTokenList.getLastMatchedTokenIndex()

match

public int match(char[] source,
                 int startingPosition,
                 int eofOffset)
Description copied from interface: ICodeBasedTokenList
match

Specified by:
match in interface ICodeBasedTokenList
Returns:
The final position of the failed or successful match
See Also:
ICodeBasedTokenList.match(char[], int, int)

seal

public void seal()
          throws LexerException
Description copied from interface: ITokenList
Build the regexes for each token in this list

Specified by:
seal in interface ITokenList
Overrides:
seal in class TokenList
Throws:
LexerException
See Also:
TokenList.seal()

setCurrentGroup

public void setCurrentGroup(java.lang.String groupName)
                     throws LexerException
Description copied from interface: ITokenList
Set the currently active lexer group

Specified by:
setCurrentGroup in interface ITokenList
Overrides:
setCurrentGroup in class TokenList
Parameters:
groupName - The name of the group to activate
Throws:
LexerException
See Also:
ITokenList.setCurrentGroup(java.lang.String)

setCurrentGroup

public void setCurrentGroup(int index)
Specified by:
setCurrentGroup in interface ITokenList
Overrides:
setCurrentGroup in class TokenList
See Also:
ITokenList.setCurrentGroup(int)

getCurrentMatcher

public OrMatcher getCurrentMatcher()
getCurrentMatcher

Returns:
IMatcher