OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// Class hiarchy for semantic wrapping of serializable values. | 5 /// Class hierarchy for semantic wrapping of serializable values. |
6 | 6 |
7 library dart2js.serialization.values; | 7 library dart2js.serialization.values; |
8 | 8 |
9 import '../constants/expressions.dart'; | 9 import '../constants/expressions.dart'; |
10 import '../elements/resolution_types.dart'; | 10 import '../elements/resolution_types.dart'; |
11 import '../elements/elements.dart'; | 11 import '../elements/elements.dart'; |
12 import 'keys.dart'; | 12 import 'keys.dart'; |
13 | 13 |
14 /// Intermediate representation of a serializable value. | 14 /// Intermediate representation of a serializable value. |
15 /// | 15 /// |
16 /// Serializable values are | 16 /// Serializable values are |
17 /// * [bool], | 17 /// * [bool], |
18 /// * [int], | 18 /// * [int], |
19 /// * [double], | 19 /// * [double], |
20 /// * [String], | 20 /// * [String], |
21 /// * enum values, | 21 /// * enum values, |
22 /// * [ConstantExpression], | 22 /// * [ConstantExpression], |
23 /// * [DartType], | 23 /// * [DartType], |
24 /// * [Element], | 24 /// * [Element], |
25 /// * [Uri], | 25 /// * [Uri], |
26 /// * lists of serializeable values, | 26 /// * lists of serializeable values, |
27 /// * maps from arbitrary strings to serializable values; these are called | 27 /// * maps from arbitrary strings to serializable values; these are called |
28 /// `Map` values, and | 28 /// `Map` values, and |
29 /// * maps from [Key] to serializable values; these are called `Object` | 29 /// * maps from [Key] to serializable values; these are called `Object` |
30 /// values. | 30 /// values. |
31 /// | 31 /// |
32 /// The distinction between map and object values is chosen to provide a more | 32 /// The distinction between map and object values is chosen to provide a more |
33 /// robust and checkable implementation of the latter; since the keys are drawn | 33 /// robust and checkable implementation of the latter; since the keys are drawn |
34 /// from a fixed typed set of values, consistency between serialization and | 34 /// from a fixed typed set of values, consistency between serialization and |
35 /// deserialization is easierly maintained. | 35 /// deserialization is more easily maintained. |
36 abstract class Value { | 36 abstract class Value { |
37 accept(ValueVisitor visitor, arg); | 37 accept(ValueVisitor visitor, arg); |
38 } | 38 } |
39 | 39 |
40 class ElementValue implements Value { | 40 class ElementValue implements Value { |
41 final Element element; | 41 final Element element; |
42 final Value id; | 42 final Value id; |
43 | 43 |
44 ElementValue(this.element, this.id); | 44 ElementValue(this.element, this.id); |
45 | 45 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 R visitBool(BoolValue value, A arg); | 169 R visitBool(BoolValue value, A arg); |
170 R visitInt(IntValue value, A arg); | 170 R visitInt(IntValue value, A arg); |
171 R visitDouble(DoubleValue value, A arg); | 171 R visitDouble(DoubleValue value, A arg); |
172 R visitString(StringValue value, A arg); | 172 R visitString(StringValue value, A arg); |
173 R visitObject(ObjectValue value, A arg); | 173 R visitObject(ObjectValue value, A arg); |
174 R visitMap(MapValue value, A arg); | 174 R visitMap(MapValue value, A arg); |
175 R visitList(ListValue value, A arg); | 175 R visitList(ListValue value, A arg); |
176 R visitEnum(EnumValue value, A arg); | 176 R visitEnum(EnumValue value, A arg); |
177 R visitUri(UriValue value, A arg); | 177 R visitUri(UriValue value, A arg); |
178 } | 178 } |
OLD | NEW |