|
1 |
| package net.sourceforge.pmd.sourcetypehandlers; |
|
2 |
| |
|
3 |
| import net.sourceforge.pmd.ast.ParseException; |
|
4 |
| import net.sourceforge.pmd.jsp.ast.JspCharStream; |
|
5 |
| import net.sourceforge.pmd.parsers.Parser; |
|
6 |
| import net.sourceforge.pmd.symboltable.JspSymbolFacade; |
|
7 |
| |
|
8 |
| import java.io.Reader; |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| public class JspTypeHandler implements SourceTypeHandler { |
|
16 |
| DummyVisitorStarter dummyVisitor = new DummyVisitorStarter(); |
|
17 |
| |
|
18 |
24
| public Parser getParser() {
|
|
19 |
24
| return new Parser() {
|
|
20 |
24
| public Object parse(Reader source) throws ParseException {
|
|
21 |
24
| return new net.sourceforge.pmd.jsp.ast.JspParser(new JspCharStream(source))
|
|
22 |
| .CompilationUnit(); |
|
23 |
| } |
|
24 |
| }; |
|
25 |
| } |
|
26 |
| |
|
27 |
0
| public VisitorStarter getDataFlowFacade() {
|
|
28 |
0
| return dummyVisitor;
|
|
29 |
| } |
|
30 |
| |
|
31 |
24
| public VisitorStarter getSymbolFacade() {
|
|
32 |
24
| return new JspSymbolFacade();
|
|
33 |
| } |
|
34 |
| |
|
35 |
| } |