Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail From: Jeff Higgins Newsgroups: comp.lang.java.programmer Subject: Re: How to scan Java source texts? Date: Wed, 12 Jun 2013 15:38:28 -0400 Organization: A noiseless patient Spider Lines: 12 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 12 Jun 2013 19:32:23 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="6b9e92482af47766954d85fb77d372f5"; logging-data="1472"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Dncr3AukKXzksqvknVXQjouAaFfOoX2I=" User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130529 Icedove/17.0.5 In-Reply-To: Cancel-Lock: sha1:kljoO73SuivYbuNIoCkiNEgfOPU= Xref: csiph.com comp.lang.java.programmer:24393 On 06/12/2013 02:45 PM, Stefan Ram wrote: > Jeff Higgins writes: >> The only problem I see now is gaining access to the protected >> Scanner constructor outside of the com.sun.tools.javac.parser package. > > You need to use a factory method of a ScannerFactory, and to > get that, you need to use yet another factory-like method of > ScannerFactory, which needs a Context, but this time you can > use Context's default constructor. > ScannerFactory.instance(new Context()).newScanner(args[0], true); Wonderful! Thanks.