Package de.bokelberg.flex.parser

Examples of de.bokelberg.flex.parser.AS3Scanner


   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 )
      {
      }
View Full Code Here


      }
   }

   private AS3Scanner initializeScanner( final SourceCode tokens )
   {
      final AS3Scanner scanner = new AS3Scanner();

      final IFlexFile flexFile = FileUtils.create( new File( tokens.getFileName() ),
                                                   new File( "" ) );

      if ( flexFile instanceof IMxmlFile )
      {
         final IMxmlFile mxml = ( IMxmlFile ) flexFile;

         scanner.setLines( mxml.getScriptBlock() );
      }
      else
      {
         scanner.setLines( tokens.getCode().toArray( new String[ tokens.getCode().size() ] ) );
      }
      return scanner;
   }
View Full Code Here

TOP

Related Classes of de.bokelberg.flex.parser.AS3Scanner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.