equal
deleted
inserted
replaced
25 |
25 |
26 package com.sun.tools.javac.parser; |
26 package com.sun.tools.javac.parser; |
27 |
27 |
28 import java.nio.CharBuffer; |
28 import java.nio.CharBuffer; |
29 |
29 |
|
30 import com.sun.tools.javac.code.Preview; |
30 import com.sun.tools.javac.code.Source; |
31 import com.sun.tools.javac.code.Source; |
31 import com.sun.tools.javac.util.Context; |
32 import com.sun.tools.javac.util.Context; |
32 import com.sun.tools.javac.util.Log; |
33 import com.sun.tools.javac.util.Log; |
33 import com.sun.tools.javac.util.Names; |
34 import com.sun.tools.javac.util.Names; |
34 |
35 |
54 } |
55 } |
55 |
56 |
56 final Log log; |
57 final Log log; |
57 final Names names; |
58 final Names names; |
58 final Source source; |
59 final Source source; |
|
60 final Preview preview; |
59 final Tokens tokens; |
61 final Tokens tokens; |
60 |
62 |
61 /** Create a new scanner factory. */ |
63 /** Create a new scanner factory. */ |
62 protected ScannerFactory(Context context) { |
64 protected ScannerFactory(Context context) { |
63 context.put(scannerFactoryKey, this); |
65 context.put(scannerFactoryKey, this); |
64 this.log = Log.instance(context); |
66 this.log = Log.instance(context); |
65 this.names = Names.instance(context); |
67 this.names = Names.instance(context); |
66 this.source = Source.instance(context); |
68 this.source = Source.instance(context); |
|
69 this.preview = Preview.instance(context); |
67 this.tokens = Tokens.instance(context); |
70 this.tokens = Tokens.instance(context); |
68 } |
71 } |
69 |
72 |
70 public Scanner newScanner(CharSequence input, boolean keepDocComments) { |
73 public Scanner newScanner(CharSequence input, boolean keepDocComments) { |
71 if (input instanceof CharBuffer) { |
74 if (input instanceof CharBuffer) { |