| 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 |
| 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 /** | 5 /** |
| 6 * A keyword in the Dart programming language. | 6 * A keyword in the Dart programming language. |
| 7 */ | 7 */ |
| 8 class Keyword implements SourceString { | 8 class Keyword implements SourceString { |
| 9 static final Keyword BREAK = const Keyword("break"); | 9 static final Keyword BREAK = const Keyword("break"); |
| 10 static final Keyword CASE = const Keyword("case"); | 10 static final Keyword CASE = const Keyword("case"); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 133 |
| 134 void printOn(StringBuffer sb) { | 134 void printOn(StringBuffer sb) { |
| 135 sb.add(syntax); | 135 sb.add(syntax); |
| 136 } | 136 } |
| 137 | 137 |
| 138 String toString() => syntax; | 138 String toString() => syntax; |
| 139 String slowToString() => syntax; | 139 String slowToString() => syntax; |
| 140 String get stringValue() => syntax; | 140 String get stringValue() => syntax; |
| 141 | 141 |
| 142 bool isEmpty() => false; | 142 bool isEmpty() => false; |
| 143 bool isPrivate() => false; |
| 143 } | 144 } |
| 144 | 145 |
| 145 /** | 146 /** |
| 146 * Abstract state in a state machine for scanning keywords. | 147 * Abstract state in a state machine for scanning keywords. |
| 147 */ | 148 */ |
| 148 class KeywordState { | 149 class KeywordState { |
| 149 abstract bool isLeaf(); | 150 abstract bool isLeaf(); |
| 150 abstract KeywordState next(int c); | 151 abstract KeywordState next(int c); |
| 151 abstract Keyword get keyword(); | 152 abstract Keyword get keyword(); |
| 152 | 153 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 final Keyword keyword; | 246 final Keyword keyword; |
| 246 | 247 |
| 247 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax]; | 248 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax]; |
| 248 | 249 |
| 249 bool isLeaf() => true; | 250 bool isLeaf() => true; |
| 250 | 251 |
| 251 KeywordState next(int c) => null; | 252 KeywordState next(int c) => null; |
| 252 | 253 |
| 253 String toString() => keyword.syntax; | 254 String toString() => keyword.syntax; |
| 254 } | 255 } |
| OLD | NEW |