1 |
| package net.sourceforge.pmd.parsers; |
2 |
| |
3 |
| import net.sourceforge.pmd.ast.JavaCharStream; |
4 |
| import net.sourceforge.pmd.ast.JavaParser; |
5 |
| import net.sourceforge.pmd.ast.ParseException; |
6 |
| |
7 |
| import java.io.Reader; |
8 |
| import java.util.Map; |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| public class Java14Parser implements Parser { |
16 |
| |
17 |
| private JavaParser parser; |
18 |
| private String marker; |
19 |
| |
20 |
1207
| public Object parse(Reader source) throws ParseException {
|
21 |
1207
| parser = new JavaParser(new JavaCharStream(source));
|
22 |
1207
| parser.setExcludeMarker(marker);
|
23 |
1207
| return parser.CompilationUnit();
|
24 |
| } |
25 |
| |
26 |
1207
| public Map getExcludeMap() {
|
27 |
1207
| return parser.getExcludeMap();
|
28 |
| } |
29 |
| |
30 |
1207
| public void setExcludeMarker(String marker) {
|
31 |
1207
| this.marker = marker;
|
32 |
| } |
33 |
| |
34 |
| } |