public JavacParser newParser(CharSequence input, boolean keepDocComments, boolean keepEndPos, boolean keepLineMap) { Lexer lexer = scannerFactory.newScanner(input, keepDocComments); return new JavacParser(this, lexer, keepDocComments, keepLineMap, keepEndPos); } }
public JavacParser newParser(CharSequence input, boolean keepDocComments, boolean keepEndPos, boolean keepLineMap) { Lexer lexer = scannerFactory.newScanner(input, keepDocComments); return new JavacParser(this, lexer, keepDocComments, keepLineMap, keepEndPos); } }
public JavacParser newParser(CharSequence input, boolean keepDocComments, boolean keepEndPos, boolean keepLineMap) { ScannerFactory scannerFactory = ScannerFactory.instance(context); Lexer lexer = scannerFactory.newScanner(input, true); Object x = new CommentCollectingParser(this, lexer, true, keepLineMap, keepEndPos); return (JavacParser) x; // CCP is based on a stub which extends nothing, but at runtime the stub is replaced with either //javac6's EndPosParser which extends Parser, or javac8's JavacParser which implements Parser. //Either way this will work out. }
public JavacParser newParser(CharSequence input, boolean keepDocComments, boolean keepEndPos, boolean keepLineMap, boolean parseModuleInfo) { ScannerFactory scannerFactory = ScannerFactory.instance(context); Lexer lexer = scannerFactory.newScanner(input, true); Object x = new CommentCollectingParser(this, lexer, true, keepLineMap, keepEndPos, parseModuleInfo); return (JavacParser) x; // CCP is based on a stub which extends nothing, but at runtime the stub is replaced with either //javac6's EndPosParser which extends Parser, or javac-9's JavacParser which implements Parser. //Either way this will work out. }
public JavacParser newParser(CharSequence input, boolean keepDocComments, boolean keepEndPos, boolean keepLineMap, boolean parseModuleInfo) { ScannerFactory scannerFactory = ScannerFactory.instance(context); Lexer lexer = scannerFactory.newScanner(input, true); Object x = new CommentCollectingParser(this, lexer, true, keepLineMap, keepEndPos); return (JavacParser) x; // CCP is based on a stub which extends nothing, but at runtime the stub is replaced with either //javac6's EndPosParser which extends Parser, or javac8's JavacParser which implements Parser. //Either way this will work out. }
public Parser newParser(CharSequence input, boolean keepDocComments, boolean keepEndPos, boolean keepLineMap) { ScannerFactory scannerFactory = ScannerFactory.instance(context); Lexer lexer = scannerFactory.newScanner(input, true); Object x = new CommentCollectingParser(this, lexer, true, keepLineMap); return (Parser) x; // CCP is based on a stub which extends nothing, but at runtime the stub is replaced with either //javac6's EndPosParser which extends Parser, or javac7's EndPosParser which implements Parser. //Either way this will work out. }
public Scanner newScanner(CharSequence input, boolean keepDocComments) { if (input instanceof CharBuffer) { CharBuffer buf = (CharBuffer) input; if (keepDocComments) return new Scanner(this, new JavadocTokenizer(this, buf)); else return new Scanner(this, buf); } else { char[] array = input.toString().toCharArray(); return newScanner(array, array.length, keepDocComments); } }
public Scanner newScanner(CharSequence input, boolean keepDocComments) { if (input instanceof CharBuffer) { CharBuffer buf = (CharBuffer) input; if (keepDocComments) return new Scanner(this, new JavadocTokenizer(this, buf)); else return new Scanner(this, buf); } else { char[] array = input.toString().toCharArray(); return newScanner(array, array.length, keepDocComments); } }