@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.
- package/__tests__/end-to-end.test.ts +256 -0
- package/coverage/clover.xml +12857 -0
- package/coverage/coverage-final.json +3 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +79 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +126 -0
- package/coverage/lcov-report/index.js.html +104 -0
- package/coverage/lcov-report/out.js.html +41126 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +170 -0
- package/coverage/lcov.info +24801 -0
- package/index.d.ts +118 -0
- package/index.js +8 -0
- package/index.ts +141 -0
- package/jest.config.js +11 -0
- package/out.js +13708 -0
- package/package.json +22 -17
- package/tsconfig.json +5 -3
- package/.idea/apexdocs-dart.iml +0 -18
- package/.idea/jsLibraryMappings.xml +0 -6
- package/.idea/libraries/Dart_Packages.xml +0 -556
- package/.idea/libraries/Dart_SDK.xml +0 -28
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/runConfigurations/_template__of_Dart_Test.xml +0 -6
- package/.idea/vcs.xml +0 -6
- package/CHANGELOG.md +0 -3
- package/README.md +0 -26
- package/TODO.md +0 -5
- package/analysis_options.yaml +0 -30
- package/antlr4-4.9.2/CHANGELOG.md +0 -4
- package/antlr4-4.9.2/LICENSE +0 -52
- package/antlr4-4.9.2/README.md +0 -11
- package/antlr4-4.9.2/analysis_options.yaml +0 -1
- package/antlr4-4.9.2/lib/antlr4.dart +0 -21
- package/antlr4-4.9.2/lib/src/atn/atn.dart +0 -18
- package/antlr4-4.9.2/lib/src/atn/src/atn.dart +0 -170
- package/antlr4-4.9.2/lib/src/atn/src/atn_config.dart +0 -242
- package/antlr4-4.9.2/lib/src/atn/src/atn_config_set.dart +0 -283
- package/antlr4-4.9.2/lib/src/atn/src/atn_deserializer.dart +0 -809
- package/antlr4-4.9.2/lib/src/atn/src/atn_simulator.dart +0 -95
- package/antlr4-4.9.2/lib/src/atn/src/atn_state.dart +0 -296
- package/antlr4-4.9.2/lib/src/atn/src/atn_type.dart +0 -14
- package/antlr4-4.9.2/lib/src/atn/src/info.dart +0 -553
- package/antlr4-4.9.2/lib/src/atn/src/lexer_action.dart +0 -601
- package/antlr4-4.9.2/lib/src/atn/src/lexer_action_executor.dart +0 -167
- package/antlr4-4.9.2/lib/src/atn/src/lexer_atn_simulator.dart +0 -731
- package/antlr4-4.9.2/lib/src/atn/src/parser_atn_simulator.dart +0 -2630
- package/antlr4-4.9.2/lib/src/atn/src/profiling_atn_simulator.dart +0 -229
- package/antlr4-4.9.2/lib/src/atn/src/semantic_context.dart +0 -404
- package/antlr4-4.9.2/lib/src/atn/src/transition.dart +0 -305
- package/antlr4-4.9.2/lib/src/dfa/dfa.dart +0 -8
- package/antlr4-4.9.2/lib/src/dfa/src/dfa.dart +0 -138
- package/antlr4-4.9.2/lib/src/dfa/src/dfa_serializer.dart +0 -76
- package/antlr4-4.9.2/lib/src/dfa/src/dfa_state.dart +0 -151
- package/antlr4-4.9.2/lib/src/error/error.dart +0 -10
- package/antlr4-4.9.2/lib/src/error/src/diagnostic_error_listener.dart +0 -116
- package/antlr4-4.9.2/lib/src/error/src/error_listener.dart +0 -241
- package/antlr4-4.9.2/lib/src/error/src/error_strategy.dart +0 -902
- package/antlr4-4.9.2/lib/src/error/src/errors.dart +0 -204
- package/antlr4-4.9.2/lib/src/input_stream.dart +0 -335
- package/antlr4-4.9.2/lib/src/interval_set.dart +0 -735
- package/antlr4-4.9.2/lib/src/lexer.dart +0 -343
- package/antlr4-4.9.2/lib/src/ll1_analyzer.dart +0 -204
- package/antlr4-4.9.2/lib/src/misc/multi_map.dart +0 -32
- package/antlr4-4.9.2/lib/src/misc/pair.dart +0 -34
- package/antlr4-4.9.2/lib/src/parser.dart +0 -777
- package/antlr4-4.9.2/lib/src/parser_interpreter.dart +0 -393
- package/antlr4-4.9.2/lib/src/parser_rule_context.dart +0 -275
- package/antlr4-4.9.2/lib/src/prediction_context.dart +0 -877
- package/antlr4-4.9.2/lib/src/recognizer.dart +0 -182
- package/antlr4-4.9.2/lib/src/rule_context.dart +0 -192
- package/antlr4-4.9.2/lib/src/runtime_meta_data.dart +0 -188
- package/antlr4-4.9.2/lib/src/token.dart +0 -431
- package/antlr4-4.9.2/lib/src/token_factory.dart +0 -88
- package/antlr4-4.9.2/lib/src/token_source.dart +0 -241
- package/antlr4-4.9.2/lib/src/token_stream.dart +0 -627
- package/antlr4-4.9.2/lib/src/tree/src/pattern/chunk.dart +0 -90
- package/antlr4-4.9.2/lib/src/tree/src/pattern/parse_tree_match.dart +0 -635
- package/antlr4-4.9.2/lib/src/tree/src/tree.dart +0 -370
- package/antlr4-4.9.2/lib/src/tree/src/trees.dart +0 -226
- package/antlr4-4.9.2/lib/src/tree/tree.dart +0 -10
- package/antlr4-4.9.2/lib/src/util/bit_set.dart +0 -308
- package/antlr4-4.9.2/lib/src/util/murmur_hash.dart +0 -77
- package/antlr4-4.9.2/lib/src/util/utils.dart +0 -31
- package/antlr4-4.9.2/lib/src/vocabulary.dart +0 -254
- package/antlr4-4.9.2/pubspec.yaml +0 -13
- package/example/node_example/index.js +0 -8
- package/example/node_example/package.json +0 -12
- package/example/node_example_ts/package-lock.json +0 -70
- package/example/node_example_ts/package.json +0 -19
- package/example/node_example_ts/src/index.js +0 -5
- package/example/node_example_ts/src/index.ts +0 -9
- package/example/node_example_ts/tsconfig.json +0 -79
- package/js/dart2jsout.js +0 -25898
- package/js/dart2jsout.js.map +0 -16
- package/js/index.d.ts +0 -1
- package/js/index.js +0 -4
- package/js/out.js +0 -26023
- package/js/out.js.map +0 -16
- package/js/package-lock.json +0 -57
- package/js/preamble.js +0 -125
- package/lib/apexdocs_dart.dart +0 -28
- package/lib/src/antlr/grammars/Apexdoc/ApexdocLexer.g4 +0 -120
- package/lib/src/antlr/grammars/Apexdoc/ApexdocParser.g4 +0 -158
- package/lib/src/antlr/grammars/Apexdoc/gen/ApexdocLexer.interp +0 -95
- package/lib/src/antlr/grammars/Apexdoc/gen/ApexdocLexer.java +0 -238
- package/lib/src/antlr/grammars/Apexdoc/gen/ApexdocLexer.tokens +0 -23
- package/lib/src/antlr/grammars/apex/ApexLexer.g4 +0 -255
- package/lib/src/antlr/grammars/apex/ApexParser.g4 +0 -567
- package/lib/src/antlr/grammars/apex/examples/ApexClass.cls +0 -6
- package/lib/src/antlr/lib/apex/ApexLexer.dart +0 -1223
- package/lib/src/antlr/lib/apex/ApexLexer.interp +0 -393
- package/lib/src/antlr/lib/apex/ApexLexer.tokens +0 -212
- package/lib/src/antlr/lib/apex/ApexParser.dart +0 -9349
- package/lib/src/antlr/lib/apex/ApexParser.interp +0 -326
- package/lib/src/antlr/lib/apex/ApexParser.tokens +0 -212
- package/lib/src/antlr/lib/apex/ApexParserBaseListener.dart +0 -1036
- package/lib/src/antlr/lib/apex/ApexParserListener.dart +0 -975
- package/lib/src/antlr/lib/apexdoc/ApexdocLexer.dart +0 -373
- package/lib/src/antlr/lib/apexdoc/ApexdocLexer.interp +0 -95
- package/lib/src/antlr/lib/apexdoc/ApexdocLexer.tokens +0 -23
- package/lib/src/antlr/lib/apexdoc/ApexdocParser.dart +0 -2471
- package/lib/src/antlr/lib/apexdoc/ApexdocParser.interp +0 -69
- package/lib/src/antlr/lib/apexdoc/ApexdocParser.tokens +0 -23
- package/lib/src/antlr/lib/apexdoc/ApexdocParserBaseListener.dart +0 -252
- package/lib/src/antlr/lib/apexdoc/ApexdocParserListener.dart +0 -215
- package/lib/src/builders/builders.dart +0 -32
- package/lib/src/model/apex_file_manifest.dart +0 -37
- package/lib/src/model/apex_file_manifest.g.dart +0 -18
- package/lib/src/model/declaration.dart +0 -50
- package/lib/src/model/doc_comment.dart +0 -117
- package/lib/src/model/doc_comment.g.dart +0 -118
- package/lib/src/model/members.dart +0 -143
- package/lib/src/model/members.g.dart +0 -105
- package/lib/src/model/types.dart +0 -159
- package/lib/src/model/types.g.dart +0 -111
- package/lib/src/service/apex_listener.dart +0 -226
- package/lib/src/service/apexdoc_listener.dart +0 -82
- package/lib/src/service/parsers.dart +0 -33
- package/lib/src/service/utils/parsing/access_modifiers_parser.dart +0 -33
- package/lib/src/service/utils/parsing/parameters_parser.dart +0 -18
- package/lib/src/service/utils/parsing/parsing_utils.dart +0 -2
- package/lib/src/service/walker.dart +0 -82
- package/pubspec.yaml +0 -19
- package/test/apex_file_manifest_test.dart +0 -16
- package/test/apex_listener_test.dart +0 -703
- package/test/apexdoc_parser_test.dart +0 -179
- package/test/doc_comment_test.dart +0 -89
- package/test/members_serialization_test.dart +0 -158
- package/test/members_test.dart +0 -178
- package/test/types_serialization_test.dart +0 -191
- package/test/types_test.dart +0 -311
- package/test/walker_test.dart +0 -58
- package/tool/grind.dart +0 -20
|
@@ -1,167 +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 'package:collection/collection.dart';
|
|
8
|
-
|
|
9
|
-
import '../../input_stream.dart';
|
|
10
|
-
import '../../lexer.dart';
|
|
11
|
-
import '../../util/murmur_hash.dart';
|
|
12
|
-
import 'lexer_action.dart';
|
|
13
|
-
|
|
14
|
-
/// Represents an executor for a sequence of lexer actions which traversed during
|
|
15
|
-
/// the matching operation of a lexer rule (token).
|
|
16
|
-
///
|
|
17
|
-
/// <p>The executor tracks position information for position-dependent lexer actions
|
|
18
|
-
/// efficiently, ensuring that actions appearing only at the end of the rule do
|
|
19
|
-
/// not cause bloating of the [DFA] created for the lexer.</p>
|
|
20
|
-
///
|
|
21
|
-
/// @since 4.2
|
|
22
|
-
class LexerActionExecutor {
|
|
23
|
-
/// Gets the lexer actions to be executed by this executor.
|
|
24
|
-
/// @return The lexer actions to be executed by this executor.
|
|
25
|
-
final List<LexerAction> lexerActions;
|
|
26
|
-
|
|
27
|
-
/// Caches the result of {@link #hashCode} since the hash code is an element
|
|
28
|
-
/// of the performance-critical {@link LexerATNConfig#hashCode} operation.
|
|
29
|
-
@override
|
|
30
|
-
int get hashCode {
|
|
31
|
-
var hash = MurmurHash.initialize();
|
|
32
|
-
for (var lexerAction in lexerActions) {
|
|
33
|
-
hash = MurmurHash.update(hash, lexerAction);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return MurmurHash.finish(hash, lexerActions.length);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/// Constructs an executor for a sequence of [LexerAction] actions.
|
|
40
|
-
/// @param lexerActions The lexer actions to execute.
|
|
41
|
-
LexerActionExecutor(this.lexerActions);
|
|
42
|
-
|
|
43
|
-
/// Creates a [LexerActionExecutor] which executes the actions for
|
|
44
|
-
/// the input [lexerActionExecutor] followed by a specified
|
|
45
|
-
/// [lexerAction].
|
|
46
|
-
///
|
|
47
|
-
/// @param lexerActionExecutor The executor for actions already traversed by
|
|
48
|
-
/// the lexer while matching a token within a particular
|
|
49
|
-
/// [LexerATNConfig]. If this is null, the method behaves as
|
|
50
|
-
/// though it were an empty executor.
|
|
51
|
-
/// @param lexerAction The lexer action to execute after the actions
|
|
52
|
-
/// specified in [lexerActionExecutor].
|
|
53
|
-
///
|
|
54
|
-
/// @return A [LexerActionExecutor] for executing the combine actions
|
|
55
|
-
/// of [lexerActionExecutor] and [lexerAction].
|
|
56
|
-
static LexerActionExecutor append(
|
|
57
|
-
LexerActionExecutor lexerActionExecutor, LexerAction lexerAction) {
|
|
58
|
-
if (lexerActionExecutor == null) {
|
|
59
|
-
return LexerActionExecutor([lexerAction]);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
final lexerActions =
|
|
63
|
-
List<LexerAction>.from(lexerActionExecutor.lexerActions);
|
|
64
|
-
lexerActions.add(lexerAction);
|
|
65
|
-
return LexerActionExecutor(lexerActions);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/// Creates a [LexerActionExecutor] which encodes the current offset
|
|
69
|
-
/// for position-dependent lexer actions.
|
|
70
|
-
///
|
|
71
|
-
/// <p>Normally, when the executor encounters lexer actions where
|
|
72
|
-
/// {@link LexerAction#isPositionDependent} returns [true], it calls
|
|
73
|
-
/// {@link IntStream#seek} on the input [CharStream] to set the input
|
|
74
|
-
/// position to the <em>end</em> of the current token. This behavior provides
|
|
75
|
-
/// for efficient DFA representation of lexer actions which appear at the end
|
|
76
|
-
/// of a lexer rule, even when the lexer rule matches a variable number of
|
|
77
|
-
/// characters.</p>
|
|
78
|
-
///
|
|
79
|
-
/// <p>Prior to traversing a match transition in the ATN, the current offset
|
|
80
|
-
/// from the token start index is assigned to all position-dependent lexer
|
|
81
|
-
/// actions which have not already been assigned a fixed offset. By storing
|
|
82
|
-
/// the offsets relative to the token start index, the DFA representation of
|
|
83
|
-
/// lexer actions which appear in the middle of tokens remains efficient due
|
|
84
|
-
/// to sharing among tokens of the same length, regardless of their absolute
|
|
85
|
-
/// position in the input stream.</p>
|
|
86
|
-
///
|
|
87
|
-
/// <p>If the current executor already has offsets assigned to all
|
|
88
|
-
/// position-dependent lexer actions, the method returns [this].</p>
|
|
89
|
-
///
|
|
90
|
-
/// @param offset The current offset to assign to all position-dependent
|
|
91
|
-
/// lexer actions which do not already have offsets assigned.
|
|
92
|
-
///
|
|
93
|
-
/// @return A [LexerActionExecutor] which stores input stream offsets
|
|
94
|
-
/// for all position-dependent lexer actions.
|
|
95
|
-
LexerActionExecutor fixOffsetBeforeMatch(int offset) {
|
|
96
|
-
List<LexerAction> updatedLexerActions;
|
|
97
|
-
for (var i = 0; i < lexerActions.length; i++) {
|
|
98
|
-
if (lexerActions[i].isPositionDependent &&
|
|
99
|
-
!(lexerActions[i] is LexerIndexedCustomAction)) {
|
|
100
|
-
updatedLexerActions ??= List.from(lexerActions);
|
|
101
|
-
|
|
102
|
-
updatedLexerActions[i] =
|
|
103
|
-
LexerIndexedCustomAction(offset, lexerActions[i]);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (updatedLexerActions == null) {
|
|
108
|
-
return this;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return LexerActionExecutor(updatedLexerActions);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/// Execute the actions encapsulated by this executor within the context of a
|
|
115
|
-
/// particular [Lexer].
|
|
116
|
-
///
|
|
117
|
-
/// <p>This method calls {@link IntStream#seek} to set the position of the
|
|
118
|
-
/// [input] [CharStream] prior to calling
|
|
119
|
-
/// {@link LexerAction#execute} on a position-dependent action. Before the
|
|
120
|
-
/// method returns, the input position will be restored to the same position
|
|
121
|
-
/// it was in when the method was invoked.</p>
|
|
122
|
-
///
|
|
123
|
-
/// @param lexer The lexer instance.
|
|
124
|
-
/// @param input The input stream which is the source for the current token.
|
|
125
|
-
/// When this method is called, the current {@link IntStream#index} for
|
|
126
|
-
/// [input] should be the start of the following token, i.e. 1
|
|
127
|
-
/// character past the end of the current token.
|
|
128
|
-
/// @param startIndex The token start index. This value may be passed to
|
|
129
|
-
/// {@link IntStream#seek} to set the [input] position to the beginning
|
|
130
|
-
/// of the token.
|
|
131
|
-
void execute(Lexer lexer, CharStream input, int startIndex) {
|
|
132
|
-
var requiresSeek = false;
|
|
133
|
-
final stopIndex = input.index;
|
|
134
|
-
try {
|
|
135
|
-
for (var lexerAction in lexerActions) {
|
|
136
|
-
if (lexerAction is LexerIndexedCustomAction) {
|
|
137
|
-
final offset = (lexerAction as LexerIndexedCustomAction).offset;
|
|
138
|
-
input.seek(startIndex + offset);
|
|
139
|
-
lexerAction = (lexerAction as LexerIndexedCustomAction).action;
|
|
140
|
-
requiresSeek = (startIndex + offset) != stopIndex;
|
|
141
|
-
} else if (lexerAction.isPositionDependent) {
|
|
142
|
-
input.seek(stopIndex);
|
|
143
|
-
requiresSeek = false;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
lexerAction.execute(lexer);
|
|
147
|
-
}
|
|
148
|
-
} finally {
|
|
149
|
-
if (requiresSeek) {
|
|
150
|
-
input.seek(stopIndex);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
@override
|
|
156
|
-
bool operator ==(Object obj) {
|
|
157
|
-
if (identical(obj, this)) {
|
|
158
|
-
return true;
|
|
159
|
-
} else if (!(obj is LexerActionExecutor)) {
|
|
160
|
-
return false;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
LexerActionExecutor other = obj;
|
|
164
|
-
return hashCode == other.hashCode &&
|
|
165
|
-
ListEquality().equals(lexerActions, other.lexerActions);
|
|
166
|
-
}
|
|
167
|
-
}
|