View Javadoc
1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   package net.sourceforge.pmd.lang.objectivec;
5   
6   import java.io.Reader;
7   
8   import net.sourceforge.pmd.lang.TokenManager;
9   import net.sourceforge.pmd.lang.ast.SimpleCharStream;
10  import net.sourceforge.pmd.lang.objectivec.ast.ObjectiveCParserTokenManager;
11  
12  /**
13   * Objective-C Token Manager implementation.
14   */
15  public class ObjectiveCTokenManager implements TokenManager {
16      private final ObjectiveCParserTokenManager tokenManager;
17  
18      /**
19       * Creates a new Objective-C Token Manager from the given source code.
20       * @param source the source code
21       */
22      public ObjectiveCTokenManager(Reader source) {
23          tokenManager = new ObjectiveCParserTokenManager(new SimpleCharStream(source));
24      }
25  
26      public Object getNextToken() {
27          return tokenManager.getNextToken();
28      }
29  
30      @Override
31      public void setFileName(String fileName) {
32          ObjectiveCParserTokenManager.setFileName(fileName);
33      }
34  }