public ErrorProneTokens(String source, Context context) { scannerFactory = ScannerFactory.instance(context); char[] buffer = source == null ? new char[] {} : source.toCharArray(); commentSavingTokenizer = new CommentSavingTokenizer(scannerFactory, buffer, buffer.length); }
JavaTokenizer tokenizer = new JavaTokenizer( ScannerFactory.instance(context), CharBuffer.wrap(matchContents)) {}; for (Token token = tokenizer.readToken(); token.kind != TokenKind.EOF;
public ErrorProneTokens(String source, Context context) { scannerFactory = ScannerFactory.instance(context); char[] buffer = source == null ? new char[] {} : source.toCharArray(); commentSavingTokenizer = new CommentSavingTokenizer(scannerFactory, buffer, buffer.length); }
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 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. }
protected ParserFactory(Context context) { super(); context.put(parserFactoryKey, this); this.F = TreeMaker.instance(context); this.docTreeMaker = DocTreeMaker.instance(context); this.log = Log.instance(context); this.names = Names.instance(context); this.tokens = Tokens.instance(context); this.source = Source.instance(context); this.options = Options.instance(context); this.scannerFactory = ScannerFactory.instance(context); this.locale = context.get(Locale.class); }
protected ParserFactory(Context context) { super(); context.put(parserFactoryKey, this); this.F = TreeMaker.instance(context); this.docTreeMaker = DocTreeMaker.instance(context); this.log = Log.instance(context); this.names = Names.instance(context); this.tokens = Tokens.instance(context); this.source = Source.instance(context); this.options = Options.instance(context); this.scannerFactory = ScannerFactory.instance(context); this.locale = context.get(Locale.class); }
JavaTokenizer tokenizer = new JavaTokenizer( ScannerFactory.instance(context), CharBuffer.wrap(matchContents)) {}; for (Token token = tokenizer.readToken(); token.kind != TokenKind.EOF;