JspParser.java
01 /**
02  * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
03  */
04 package net.sourceforge.pmd.lang.jsp;
05 
06 import java.io.Reader;
07 import java.util.HashMap;
08 import java.util.Map;
09 
10 import net.sourceforge.pmd.lang.AbstractParser;
11 import net.sourceforge.pmd.lang.TokenManager;
12 import net.sourceforge.pmd.lang.ast.AbstractTokenManager;
13 import net.sourceforge.pmd.lang.ast.JavaCharStream;
14 import net.sourceforge.pmd.lang.ast.Node;
15 import net.sourceforge.pmd.lang.ast.ParseException;
16 
17 /**
18  * Adapter for the JspParser.
19  */
20 public class JspParser extends AbstractParser {
21 
22     public TokenManager createTokenManager(Reader source) {
23   return new JspTokenManager(source);
24     }
25 
26     public boolean canParse() {
27   return true;
28     }
29 
30     public Node parse(String fileName, Reader sourcethrows ParseException {
31   AbstractTokenManager.setFileName(fileName);
32   return new net.sourceforge.pmd.lang.jsp.ast.JspParser(new JavaCharStream(source)).CompilationUnit();
33     }
34 
35     public Map<Integer, String> getSuppressMap() {
36   return new HashMap<Integer, String>()// FIXME
37     }
38 }