Extract changes from #2166 to 7.0.x

* Make Java nodes text-available
* Introduce shared JavaccToken in pmd-core
* Use factory to produce char streams

Tests are still on java-grammar,
since they use the DSL & newer
AST structure.

This is to prepare for other changes
that concern all javacc languages and
should not be done on java-grammar
This commit is contained in:
Clément Fournier
2020-01-10 18:26:50 +01:00
parent d6296bd85f
commit 99700d7526
56 changed files with 1119 additions and 462 deletions

View File

@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.python;
import java.io.Reader;
import net.sourceforge.pmd.lang.TokenManager;
import net.sourceforge.pmd.lang.ast.SimpleCharStream;
import net.sourceforge.pmd.lang.ast.impl.javacc.CharStreamFactory;
import net.sourceforge.pmd.lang.python.ast.PythonParserTokenManager;
/**
@ -23,7 +23,7 @@ public class PythonTokenManager implements TokenManager {
* the source code
*/
public PythonTokenManager(Reader source) {
tokenManager = new PythonParserTokenManager(new SimpleCharStream(source));
tokenManager = new PythonParserTokenManager(CharStreamFactory.simpleCharStream(source));
}
@Override