@cparra/apex-reflection 0.1.0-alpha.0 → 0.1.1-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/__tests__/end-to-end.test.ts +256 -0
  2. package/coverage/clover.xml +12857 -0
  3. package/coverage/coverage-final.json +3 -0
  4. package/coverage/lcov-report/base.css +224 -0
  5. package/coverage/lcov-report/block-navigation.js +79 -0
  6. package/coverage/lcov-report/favicon.png +0 -0
  7. package/coverage/lcov-report/index.html +126 -0
  8. package/coverage/lcov-report/index.js.html +104 -0
  9. package/coverage/lcov-report/out.js.html +41126 -0
  10. package/coverage/lcov-report/prettify.css +1 -0
  11. package/coverage/lcov-report/prettify.js +2 -0
  12. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  13. package/coverage/lcov-report/sorter.js +170 -0
  14. package/coverage/lcov.info +24801 -0
  15. package/index.d.ts +118 -0
  16. package/index.js +8 -0
  17. package/index.ts +141 -0
  18. package/jest.config.js +11 -0
  19. package/out.js +13708 -0
  20. package/package.json +22 -17
  21. package/tsconfig.json +5 -3
  22. package/.idea/apexdocs-dart.iml +0 -18
  23. package/.idea/jsLibraryMappings.xml +0 -6
  24. package/.idea/libraries/Dart_Packages.xml +0 -556
  25. package/.idea/libraries/Dart_SDK.xml +0 -28
  26. package/.idea/misc.xml +0 -6
  27. package/.idea/modules.xml +0 -8
  28. package/.idea/runConfigurations/_template__of_Dart_Test.xml +0 -6
  29. package/.idea/vcs.xml +0 -6
  30. package/CHANGELOG.md +0 -3
  31. package/README.md +0 -26
  32. package/TODO.md +0 -5
  33. package/analysis_options.yaml +0 -30
  34. package/antlr4-4.9.2/CHANGELOG.md +0 -4
  35. package/antlr4-4.9.2/LICENSE +0 -52
  36. package/antlr4-4.9.2/README.md +0 -11
  37. package/antlr4-4.9.2/analysis_options.yaml +0 -1
  38. package/antlr4-4.9.2/lib/antlr4.dart +0 -21
  39. package/antlr4-4.9.2/lib/src/atn/atn.dart +0 -18
  40. package/antlr4-4.9.2/lib/src/atn/src/atn.dart +0 -170
  41. package/antlr4-4.9.2/lib/src/atn/src/atn_config.dart +0 -242
  42. package/antlr4-4.9.2/lib/src/atn/src/atn_config_set.dart +0 -283
  43. package/antlr4-4.9.2/lib/src/atn/src/atn_deserializer.dart +0 -809
  44. package/antlr4-4.9.2/lib/src/atn/src/atn_simulator.dart +0 -95
  45. package/antlr4-4.9.2/lib/src/atn/src/atn_state.dart +0 -296
  46. package/antlr4-4.9.2/lib/src/atn/src/atn_type.dart +0 -14
  47. package/antlr4-4.9.2/lib/src/atn/src/info.dart +0 -553
  48. package/antlr4-4.9.2/lib/src/atn/src/lexer_action.dart +0 -601
  49. package/antlr4-4.9.2/lib/src/atn/src/lexer_action_executor.dart +0 -167
  50. package/antlr4-4.9.2/lib/src/atn/src/lexer_atn_simulator.dart +0 -731
  51. package/antlr4-4.9.2/lib/src/atn/src/parser_atn_simulator.dart +0 -2630
  52. package/antlr4-4.9.2/lib/src/atn/src/profiling_atn_simulator.dart +0 -229
  53. package/antlr4-4.9.2/lib/src/atn/src/semantic_context.dart +0 -404
  54. package/antlr4-4.9.2/lib/src/atn/src/transition.dart +0 -305
  55. package/antlr4-4.9.2/lib/src/dfa/dfa.dart +0 -8
  56. package/antlr4-4.9.2/lib/src/dfa/src/dfa.dart +0 -138
  57. package/antlr4-4.9.2/lib/src/dfa/src/dfa_serializer.dart +0 -76
  58. package/antlr4-4.9.2/lib/src/dfa/src/dfa_state.dart +0 -151
  59. package/antlr4-4.9.2/lib/src/error/error.dart +0 -10
  60. package/antlr4-4.9.2/lib/src/error/src/diagnostic_error_listener.dart +0 -116
  61. package/antlr4-4.9.2/lib/src/error/src/error_listener.dart +0 -241
  62. package/antlr4-4.9.2/lib/src/error/src/error_strategy.dart +0 -902
  63. package/antlr4-4.9.2/lib/src/error/src/errors.dart +0 -204
  64. package/antlr4-4.9.2/lib/src/input_stream.dart +0 -335
  65. package/antlr4-4.9.2/lib/src/interval_set.dart +0 -735
  66. package/antlr4-4.9.2/lib/src/lexer.dart +0 -343
  67. package/antlr4-4.9.2/lib/src/ll1_analyzer.dart +0 -204
  68. package/antlr4-4.9.2/lib/src/misc/multi_map.dart +0 -32
  69. package/antlr4-4.9.2/lib/src/misc/pair.dart +0 -34
  70. package/antlr4-4.9.2/lib/src/parser.dart +0 -777
  71. package/antlr4-4.9.2/lib/src/parser_interpreter.dart +0 -393
  72. package/antlr4-4.9.2/lib/src/parser_rule_context.dart +0 -275
  73. package/antlr4-4.9.2/lib/src/prediction_context.dart +0 -877
  74. package/antlr4-4.9.2/lib/src/recognizer.dart +0 -182
  75. package/antlr4-4.9.2/lib/src/rule_context.dart +0 -192
  76. package/antlr4-4.9.2/lib/src/runtime_meta_data.dart +0 -188
  77. package/antlr4-4.9.2/lib/src/token.dart +0 -431
  78. package/antlr4-4.9.2/lib/src/token_factory.dart +0 -88
  79. package/antlr4-4.9.2/lib/src/token_source.dart +0 -241
  80. package/antlr4-4.9.2/lib/src/token_stream.dart +0 -627
  81. package/antlr4-4.9.2/lib/src/tree/src/pattern/chunk.dart +0 -90
  82. package/antlr4-4.9.2/lib/src/tree/src/pattern/parse_tree_match.dart +0 -635
  83. package/antlr4-4.9.2/lib/src/tree/src/tree.dart +0 -370
  84. package/antlr4-4.9.2/lib/src/tree/src/trees.dart +0 -226
  85. package/antlr4-4.9.2/lib/src/tree/tree.dart +0 -10
  86. package/antlr4-4.9.2/lib/src/util/bit_set.dart +0 -308
  87. package/antlr4-4.9.2/lib/src/util/murmur_hash.dart +0 -77
  88. package/antlr4-4.9.2/lib/src/util/utils.dart +0 -31
  89. package/antlr4-4.9.2/lib/src/vocabulary.dart +0 -254
  90. package/antlr4-4.9.2/pubspec.yaml +0 -13
  91. package/example/node_example/index.js +0 -8
  92. package/example/node_example/package.json +0 -12
  93. package/example/node_example_ts/package-lock.json +0 -70
  94. package/example/node_example_ts/package.json +0 -19
  95. package/example/node_example_ts/src/index.js +0 -5
  96. package/example/node_example_ts/src/index.ts +0 -9
  97. package/example/node_example_ts/tsconfig.json +0 -79
  98. package/js/dart2jsout.js +0 -25898
  99. package/js/dart2jsout.js.map +0 -16
  100. package/js/index.d.ts +0 -1
  101. package/js/index.js +0 -4
  102. package/js/out.js +0 -26023
  103. package/js/out.js.map +0 -16
  104. package/js/package-lock.json +0 -57
  105. package/js/preamble.js +0 -125
  106. package/lib/apexdocs_dart.dart +0 -28
  107. package/lib/src/antlr/grammars/Apexdoc/ApexdocLexer.g4 +0 -120
  108. package/lib/src/antlr/grammars/Apexdoc/ApexdocParser.g4 +0 -158
  109. package/lib/src/antlr/grammars/Apexdoc/gen/ApexdocLexer.interp +0 -95
  110. package/lib/src/antlr/grammars/Apexdoc/gen/ApexdocLexer.java +0 -238
  111. package/lib/src/antlr/grammars/Apexdoc/gen/ApexdocLexer.tokens +0 -23
  112. package/lib/src/antlr/grammars/apex/ApexLexer.g4 +0 -255
  113. package/lib/src/antlr/grammars/apex/ApexParser.g4 +0 -567
  114. package/lib/src/antlr/grammars/apex/examples/ApexClass.cls +0 -6
  115. package/lib/src/antlr/lib/apex/ApexLexer.dart +0 -1223
  116. package/lib/src/antlr/lib/apex/ApexLexer.interp +0 -393
  117. package/lib/src/antlr/lib/apex/ApexLexer.tokens +0 -212
  118. package/lib/src/antlr/lib/apex/ApexParser.dart +0 -9349
  119. package/lib/src/antlr/lib/apex/ApexParser.interp +0 -326
  120. package/lib/src/antlr/lib/apex/ApexParser.tokens +0 -212
  121. package/lib/src/antlr/lib/apex/ApexParserBaseListener.dart +0 -1036
  122. package/lib/src/antlr/lib/apex/ApexParserListener.dart +0 -975
  123. package/lib/src/antlr/lib/apexdoc/ApexdocLexer.dart +0 -373
  124. package/lib/src/antlr/lib/apexdoc/ApexdocLexer.interp +0 -95
  125. package/lib/src/antlr/lib/apexdoc/ApexdocLexer.tokens +0 -23
  126. package/lib/src/antlr/lib/apexdoc/ApexdocParser.dart +0 -2471
  127. package/lib/src/antlr/lib/apexdoc/ApexdocParser.interp +0 -69
  128. package/lib/src/antlr/lib/apexdoc/ApexdocParser.tokens +0 -23
  129. package/lib/src/antlr/lib/apexdoc/ApexdocParserBaseListener.dart +0 -252
  130. package/lib/src/antlr/lib/apexdoc/ApexdocParserListener.dart +0 -215
  131. package/lib/src/builders/builders.dart +0 -32
  132. package/lib/src/model/apex_file_manifest.dart +0 -37
  133. package/lib/src/model/apex_file_manifest.g.dart +0 -18
  134. package/lib/src/model/declaration.dart +0 -50
  135. package/lib/src/model/doc_comment.dart +0 -117
  136. package/lib/src/model/doc_comment.g.dart +0 -118
  137. package/lib/src/model/members.dart +0 -143
  138. package/lib/src/model/members.g.dart +0 -105
  139. package/lib/src/model/types.dart +0 -159
  140. package/lib/src/model/types.g.dart +0 -111
  141. package/lib/src/service/apex_listener.dart +0 -226
  142. package/lib/src/service/apexdoc_listener.dart +0 -82
  143. package/lib/src/service/parsers.dart +0 -33
  144. package/lib/src/service/utils/parsing/access_modifiers_parser.dart +0 -33
  145. package/lib/src/service/utils/parsing/parameters_parser.dart +0 -18
  146. package/lib/src/service/utils/parsing/parsing_utils.dart +0 -2
  147. package/lib/src/service/walker.dart +0 -82
  148. package/pubspec.yaml +0 -19
  149. package/test/apex_file_manifest_test.dart +0 -16
  150. package/test/apex_listener_test.dart +0 -703
  151. package/test/apexdoc_parser_test.dart +0 -179
  152. package/test/doc_comment_test.dart +0 -89
  153. package/test/members_serialization_test.dart +0 -158
  154. package/test/members_test.dart +0 -178
  155. package/test/types_serialization_test.dart +0 -191
  156. package/test/types_test.dart +0 -311
  157. package/test/walker_test.dart +0 -58
  158. package/tool/grind.dart +0 -20
@@ -1,283 +0,0 @@
1
- /*
2
- * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
3
- * Use of this file is governed by the BSD 3-clause license that
4
- * can be found in the LICENSE.txt file in the project root.
5
- */
6
-
7
- import 'dart:collection';
8
- import 'dart:math';
9
-
10
- import 'package:collection/collection.dart';
11
-
12
- import '../../misc/pair.dart';
13
- import '../../prediction_context.dart';
14
- import '../../util/bit_set.dart';
15
- import '../../util/utils.dart';
16
- import 'atn.dart';
17
- import 'atn_config.dart';
18
- import 'atn_state.dart';
19
- import 'semantic_context.dart';
20
-
21
- class ATNConfigSet extends Iterable<ATNConfig> {
22
- /// Indicates that the set of configurations is read-only. Do not
23
- /// allow any code to manipulate the set; DFA states will point at
24
- /// the sets and they must not change. This does not protect the other
25
- /// fields; in particular, conflictingAlts is set after
26
- /// we've made this readonly.
27
- bool _readOnly = false;
28
-
29
- bool get readOnly => _readOnly;
30
-
31
- set readOnly(bool readOnly) {
32
- _readOnly = readOnly;
33
- if (readOnly) {
34
- configLookup = null; // can't mod, no need for lookup cache
35
- }
36
- }
37
-
38
- /// The reason that we need this is because we don't want the hash map to use
39
- /// the standard hash code and equals. We need all configurations with the same
40
- /// {@code (s,i,_,semctx)} to be equal. Unfortunately, this key effectively doubles
41
- /// the number of objects associated with ATNConfigs. The other solution is to
42
- /// use a hash table that lets us specify the equals/hashcode operation.
43
- ///
44
- /// All configs but hashed by (s, i, _, pi) not including context. Wiped out
45
- /// when we go readonly as this set becomes a DFA state.
46
- Set<ATNConfig> configLookup = HashSet<ATNConfig>(equals: (a, b) {
47
- if (a == null || b == null) return false;
48
- return a.state.stateNumber == b.state.stateNumber &&
49
- a.alt == b.alt &&
50
- a.semanticContext == b.semanticContext;
51
- }, hashCode: (ATNConfig o) {
52
- var hashCode = 7;
53
- hashCode = 31 * hashCode + o.state.stateNumber;
54
- hashCode = 31 * hashCode + o.alt;
55
- hashCode = 31 * hashCode + o.semanticContext.hashCode;
56
- return hashCode;
57
- });
58
-
59
- /// Track the elements as they are added to the set; supports get(i) */
60
- final List<ATNConfig> configs = [];
61
-
62
- // TODO: these fields make me pretty uncomfortable but nice to pack up info together, saves recomputation
63
- // TODO: can we track conflicts as they are added to save scanning configs later?
64
- int uniqueAlt = 0;
65
-
66
- /// Currently this is only used when we detect SLL conflict; this does
67
- /// not necessarily represent the ambiguous alternatives. In fact,
68
- /// I should also point out that this seems to include predicated alternatives
69
- /// that have predicates that evaluate to false. Computed in computeTargetState().
70
- BitSet conflictingAlts;
71
-
72
- // Used in parser and lexer. In lexer, it indicates we hit a pred
73
- // while computing a closure operation. Don't make a DFA state from this.
74
- bool hasSemanticContext = false;
75
- bool dipsIntoOuterContext = false;
76
-
77
- /// Indicates that this configuration set is part of a full context
78
- /// LL prediction. It will be used to determine how to merge $. With SLL
79
- /// it's a wildcard whereas it is not for LL context merge.
80
- bool fullCtx;
81
-
82
- int cachedHashCode = -1;
83
-
84
- ATNConfigSet([this.fullCtx = true]);
85
-
86
- ATNConfigSet.dup(ATNConfigSet old) {
87
- fullCtx = old.fullCtx;
88
- addAll(old);
89
- uniqueAlt = old.uniqueAlt;
90
- conflictingAlts = old.conflictingAlts;
91
- hasSemanticContext = old.hasSemanticContext;
92
- dipsIntoOuterContext = old.dipsIntoOuterContext;
93
- }
94
-
95
- /// Adding a new config means merging contexts with existing configs for
96
- /// {@code (s, i, pi, _)}, where [s] is the
97
- /// {@link ATNConfig#state}, [i] is the {@link ATNConfig#alt}, and
98
- /// [pi] is the {@link ATNConfig#semanticContext}. We use
99
- /// {@code (s,i,pi)} as key.
100
- ///
101
- /// <p>This method updates {@link #dipsIntoOuterContext} and
102
- /// {@link #hasSemanticContext} when necessary.</p>
103
- bool add(ATNConfig config,
104
- [Map<Pair<PredictionContext, PredictionContext>, PredictionContext>
105
- mergeCache]) {
106
- if (readOnly) throw StateError('This set is readonly');
107
- if (config.semanticContext != SemanticContext.NONE) {
108
- hasSemanticContext = true;
109
- }
110
- if (config.outerContextDepth > 0) {
111
- dipsIntoOuterContext = true;
112
- }
113
- final existing = configLookup.lookup(config) ?? config;
114
- if (identical(existing, config)) {
115
- // we added this new one
116
- cachedHashCode = -1;
117
- configLookup.add(config);
118
- configs.add(config); // track order here
119
- return true;
120
- }
121
- // a previous (s,i,pi,_), merge with it and save result
122
- final rootIsWildcard = !fullCtx;
123
- final merged = PredictionContext.merge(
124
- existing.context, config.context, rootIsWildcard, mergeCache);
125
- // no need to check for existing.context, config.context in cache
126
- // since only way to create new graphs is "call rule" and here. We
127
- // cache at both places.
128
- existing.reachesIntoOuterContext =
129
- max(existing.reachesIntoOuterContext, config.reachesIntoOuterContext);
130
-
131
- // make sure to preserve the precedence filter suppression during the merge
132
- if (config.isPrecedenceFilterSuppressed()) {
133
- existing.setPrecedenceFilterSuppressed(true);
134
- }
135
-
136
- existing.context = merged; // replace context; no need to alt mapping
137
- return true;
138
- }
139
-
140
- /// Return a List holding list of configs */
141
- List<ATNConfig> get elements {
142
- return configs;
143
- }
144
-
145
- Set<ATNState> get states {
146
- final states = <ATNState>{};
147
- for (var i = 0; i < configs.length; i++) {
148
- states.add(configs[i].state);
149
- }
150
- return states;
151
- }
152
-
153
- /// Gets the complete set of represented alternatives for the configuration
154
- /// set.
155
- ///
156
- /// @return the set of represented alternatives in this configuration set
157
- ///
158
- /// @since 4.3
159
- BitSet get alts {
160
- final alts = BitSet();
161
- for (var config in configs) {
162
- alts.set(config.alt);
163
- }
164
- return alts;
165
- }
166
-
167
- List<SemanticContext> get predicates {
168
- final preds = <SemanticContext>[];
169
- for (var c in configs) {
170
- if (c.semanticContext != SemanticContext.NONE) {
171
- preds.add(c.semanticContext);
172
- }
173
- }
174
- return preds;
175
- }
176
-
177
- ATNConfig get(int i) {
178
- return configs[i];
179
- }
180
-
181
- void optimizeConfigs(interpreter) {
182
- if (readOnly) throw StateError('This set is readonly');
183
-
184
- if (configLookup.isEmpty) return;
185
-
186
- for (var config in configs) {
187
- // int before = PredictionContext.getAllContextNodes(config.context).length;
188
- config.context = interpreter.getCachedContext(config.context);
189
- // int after = PredictionContext.getAllContextNodes(config.context).length;
190
- // System.out.println("configs "+before+"->"+after);
191
- }
192
- }
193
-
194
- bool addAll(coll) {
195
- for (ATNConfig c in coll) {
196
- add(c);
197
- }
198
- return false;
199
- }
200
-
201
- @override
202
- bool operator ==(other) {
203
- return identical(this, other) ||
204
- (other is ATNConfigSet &&
205
- other != null &&
206
- ListEquality().equals(configs, other.configs) &&
207
- fullCtx == other.fullCtx &&
208
- uniqueAlt == other.uniqueAlt &&
209
- conflictingAlts == other.conflictingAlts &&
210
- hasSemanticContext == other.hasSemanticContext &&
211
- dipsIntoOuterContext == other.dipsIntoOuterContext);
212
- }
213
-
214
- @override
215
- int get hashCode {
216
- if (readOnly) {
217
- if (cachedHashCode == -1) {
218
- cachedHashCode = ListEquality().hash(configs);
219
- }
220
-
221
- return cachedHashCode;
222
- }
223
-
224
- return ListEquality().hash(configs);
225
- }
226
-
227
- @override
228
- int get length {
229
- return configs.length;
230
- }
231
-
232
- @override
233
- bool get isEmpty => configs.isEmpty;
234
-
235
- void updateHashCode(hash) {
236
- if (readOnly) {
237
- if (cachedHashCode == -1) {
238
- cachedHashCode = hashCode;
239
- }
240
- hash.update(cachedHashCode);
241
- } else {
242
- hash.update(hashCode);
243
- }
244
- }
245
-
246
- @override
247
- bool contains(Object o) {
248
- if (configLookup == null) {
249
- throw UnsupportedError(
250
- 'This method is not implemented for readonly sets.');
251
- }
252
-
253
- return configLookup.contains(o);
254
- }
255
-
256
- @override
257
- Iterator<ATNConfig> get iterator => configs.iterator;
258
-
259
- void clear() {
260
- if (readOnly) throw StateError('This set is readonly');
261
- configs.clear();
262
- cachedHashCode = -1;
263
- configLookup.clear();
264
- }
265
-
266
- @override
267
- String toString() {
268
- final buf = StringBuffer();
269
- buf.write(arrayToString(elements));
270
- if (hasSemanticContext) {
271
- buf.write(',hasSemanticContext=$hasSemanticContext');
272
- }
273
- if (uniqueAlt != ATN.INVALID_ALT_NUMBER) buf.write(',uniqueAlt=$uniqueAlt');
274
- if (conflictingAlts != null) buf.write(',conflictingAlts=$conflictingAlts');
275
- if (dipsIntoOuterContext) buf.write(',dipsIntoOuterContext');
276
- return buf.toString();
277
- }
278
- }
279
-
280
- class OrderedATNConfigSet extends ATNConfigSet {
281
- @override
282
- final configLookup = <ATNConfig>{};
283
- }