public void tokenize( final SourceCode tokens,
final Tokens tokenEntries )
{
try
{
final AS3Scanner scanner = initializeScanner( tokens );
Token currentToken = scanner.moveToNextToken();
int inImportLine = 0;
while ( currentToken != null
&& currentToken.getText().compareTo( KeyWords.EOF.toString() ) != 0 )
{
final String currentTokenText = currentToken.getText();
final int currentTokenLine = currentToken.getLine();
if ( !isTokenIgnored( currentTokenText ) )
{
if ( isTokenIgnoringLine( currentTokenText ) )
{
inImportLine = currentTokenLine;
}
else
{
if ( inImportLine == 0
|| inImportLine != currentTokenLine )
{
inImportLine = 0;
tokenEntries.add( new TokenEntry( currentTokenText, // NOPMD
tokens.getFileName(),
currentTokenLine ) );
}
}
}
currentToken = scanner.moveToNextToken();
}
}
catch ( final Exception e )
{
}