View Javadoc

1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   package net.sourceforge.pmd.lang.vm;
5   
6   import java.io.Reader;
7   
8   import net.sourceforge.pmd.lang.TokenManager;
9   import net.sourceforge.pmd.lang.ast.AbstractTokenManager;
10  import net.sourceforge.pmd.lang.vm.ast.VmParserTokenManager;
11  import net.sourceforge.pmd.lang.vm.util.VelocityCharStream;
12  
13  public class VmTokenManager implements TokenManager {
14  
15      private final VmParserTokenManager vmParserTokenManager;
16  
17      public VmTokenManager(final Reader source) {
18          vmParserTokenManager = new VmParserTokenManager(new VelocityCharStream(source, 1, 1));
19      }
20  
21      public Object getNextToken() {
22          return vmParserTokenManager.getNextToken();
23      }
24  
25      public void setFileName(final String fileName) {
26          AbstractTokenManager.setFileName(fileName);
27      }
28  
29  }