OLD | NEW |
---|---|
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
Brian Wilkerson
2012/06/25 14:24:38
nit: copyright year
scheglov
2012/06/26 19:46:34
Done.
| |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 package com.google.dart.compiler.parser; | 5 package com.google.dart.compiler.parser; |
6 | 6 |
7 import com.google.dart.compiler.DartCompilationError; | 7 import com.google.dart.compiler.DartCompilationError; |
8 import com.google.dart.compiler.DartCompilerListener; | 8 import com.google.dart.compiler.DartCompilerListener; |
9 import com.google.dart.compiler.DartSource; | 9 import com.google.dart.compiler.DartSource; |
10 import com.google.dart.compiler.Source; | 10 import com.google.dart.compiler.Source; |
11 import com.google.dart.compiler.ast.DartUnit; | 11 import com.google.dart.compiler.ast.DartUnit; |
12 import com.google.dart.compiler.common.HasSourceInfo; | 12 import com.google.dart.compiler.common.HasSourceInfo; |
13 import com.google.dart.compiler.common.HasSourceInfoSetter; | 13 import com.google.dart.compiler.common.HasSourceInfoSetter; |
14 import com.google.dart.compiler.common.SourceInfo; | 14 import com.google.dart.compiler.common.SourceInfo; |
15 import com.google.dart.compiler.metrics.CompilerMetrics; | 15 import com.google.dart.compiler.metrics.CompilerMetrics; |
16 import com.google.dart.compiler.parser.DartScanner.Location; | 16 import com.google.dart.compiler.parser.DartScanner.Location; |
17 import com.google.dart.compiler.parser.DartScanner.State; | 17 import com.google.dart.compiler.parser.DartScanner.State; |
18 | 18 |
19 import java.util.ArrayDeque; | 19 import java.util.ArrayDeque; |
20 import java.util.Deque; | 20 import java.util.Deque; |
21 import java.util.Stack; | 21 import java.util.Stack; |
22 | 22 |
23 /** | 23 /** |
24 * A ParserContext backed by a DartScanner. | 24 * A ParserContext backed by a DartScanner. |
25 */ | 25 */ |
26 public class DartScannerParserContext implements ParserContext { | 26 class DartScannerParserContext implements ParserContext { |
27 private DartScanner scanner; | 27 private DartScanner scanner; |
28 private Deque<DartScanner.State> stateStack = new ArrayDeque<DartScanner.State >(); | 28 private Deque<DartScanner.State> stateStack = new ArrayDeque<DartScanner.State >(); |
29 private Deque<DartScanner.Position> positionStack = new ArrayDeque<DartScanner .Position>(); | 29 private Deque<DartScanner.Position> positionStack = new ArrayDeque<DartScanner .Position>(); |
30 private Source source; | 30 private Source source; |
31 private DartCompilerListener listener; | 31 private DartCompilerListener listener; |
32 private final CompilerMetrics compilerMetrics; | 32 private final CompilerMetrics compilerMetrics; |
33 | 33 |
34 public DartScannerParserContext(Source source, String sourceCode, | 34 public DartScannerParserContext(Source source, String sourceCode, |
35 DartCompilerListener listener) { | 35 DartCompilerListener listener) { |
36 this(source, sourceCode, listener, null); | 36 this(source, sourceCode, listener, null); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
192 | 192 |
193 protected DartScanner createScanner(String sourceCode) { | 193 protected DartScanner createScanner(String sourceCode) { |
194 return new DartScanner(sourceCode); | 194 return new DartScanner(sourceCode); |
195 } | 195 } |
196 | 196 |
197 @Override | 197 @Override |
198 public Source getSource() { | 198 public Source getSource() { |
199 return source; | 199 return source; |
200 } | 200 } |
201 } | 201 } |
OLD | NEW |