CppParser.java
01 package net.sourceforge.pmd.lang.cpp;
02 
03 import java.io.Reader;
04 import java.util.Map;
05 
06 import net.sourceforge.pmd.lang.AbstractParser;
07 import net.sourceforge.pmd.lang.TokenManager;
08 import net.sourceforge.pmd.lang.ast.AbstractTokenManager;
09 import net.sourceforge.pmd.lang.ast.Node;
10 import net.sourceforge.pmd.lang.ast.ParseException;
11 
12 /**
13  * Adapter for the C++ Parser.
14  */
15 public class CppParser extends AbstractParser {
16 
17     public TokenManager createTokenManager(Reader source) {
18   return new CppTokenManager(source);
19     }
20 
21     public boolean canParse() {
22   return false;
23     }
24 
25     public Node parse(String fileName, Reader sourcethrows ParseException {
26   AbstractTokenManager.setFileName(fileName);
27   throw new UnsupportedOperationException("parse(Reader) is not supported for C++");
28     }
29 
30     public Map<Integer, String> getSuppressMap() {
31   throw new UnsupportedOperationException("getSuppressMap() is not supported for C++");
32     }
33 }