expressir 1.4.3 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/codeql.yml +2 -14
- data/.github/workflows/rake.yml +6 -364
- data/.github/workflows/release.yml +15 -178
- data/.github/workflows/stress.yml +1 -18
- data/.rubocop.yml +1 -0
- data/.rubocop_todo.yml +7 -0
- data/Gemfile +13 -0
- data/README.adoc +6 -19
- data/Rakefile +6 -7
- data/expressir.gemspec +23 -32
- data/expressir_wrapped.txt +23068 -0
- data/lib/expressir/cli.rb +1 -1
- data/lib/expressir/express/formatter.rb +661 -661
- data/lib/expressir/express/parser.rb +299 -33
- data/lib/expressir/express/visitor.rb +238 -133
- data/lib/expressir/model/declarations/interface_item.rb +1 -1
- data/lib/expressir/version.rb +1 -1
- metadata +15 -573
- data/.cross_rubies +0 -28
- data/.gitmodules +0 -6
- data/.yardopts +0 -11
- data/exe/generate-parser +0 -51
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/CMakeLists.txt +0 -191
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2019.vcxproj +0 -652
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2019.vcxproj.filters +0 -948
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2022.vcxproj +0 -652
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2022.vcxproj.filters +0 -948
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp-ios/Info.plist +0 -26
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp-ios/antlrcpp_ios.h +0 -17
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/project.pbxproj +0 -3040
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/xcshareddata/xcschemes/antlr4.xcscheme +0 -76
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/xcshareddata/xcschemes/antlr4_ios.xcscheme +0 -76
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/xcshareddata/xcschemes/antlr4_static.xcscheme +0 -76
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/nuget/ANTLR4.Runtime.cpp.noarch.nuspec +0 -23
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/nuget/ANTLR4.Runtime.cpp.noarch.targets +0 -8
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/nuget/ANTLR4.Runtime.cpp.shared.nuspec +0 -30
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/nuget/ANTLR4.Runtime.cpp.shared.props +0 -21
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/nuget/ANTLR4.Runtime.cpp.shared.targets +0 -44
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/nuget/ANTLR4.Runtime.cpp.static.nuspec +0 -29
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/nuget/ANTLR4.Runtime.cpp.static.targets +0 -44
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/nuget/antlr4.jpg +0 -0
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/nuget/pack.cmd +0 -93
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorListener.cpp +0 -10
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorListener.h +0 -167
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorStrategy.cpp +0 -10
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorStrategy.h +0 -121
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRFileStream.cpp +0 -23
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRFileStream.h +0 -30
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRInputStream.cpp +0 -180
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRInputStream.h +0 -79
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/BailErrorStrategy.cpp +0 -61
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/BailErrorStrategy.h +0 -59
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/BaseErrorListener.cpp +0 -25
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/BaseErrorListener.h +0 -36
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/BufferedTokenStream.cpp +0 -414
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/BufferedTokenStream.h +0 -200
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/CharStream.cpp +0 -11
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/CharStream.h +0 -37
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonToken.cpp +0 -193
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonToken.h +0 -158
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenFactory.cpp +0 -39
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenFactory.h +0 -74
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenStream.cpp +0 -78
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenStream.h +0 -79
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/ConsoleErrorListener.cpp +0 -15
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/ConsoleErrorListener.h +0 -35
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/DefaultErrorStrategy.cpp +0 -336
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/DefaultErrorStrategy.h +0 -466
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/DiagnosticErrorListener.cpp +0 -84
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/DiagnosticErrorListener.h +0 -80
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/Exceptions.cpp +0 -64
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/Exceptions.h +0 -99
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/FailedPredicateException.cpp +0 -52
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/FailedPredicateException.h +0 -32
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/FlatHashMap.h +0 -57
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/FlatHashSet.h +0 -57
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/InputMismatchException.cpp +0 -18
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/InputMismatchException.h +0 -24
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/IntStream.cpp +0 -12
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/IntStream.h +0 -218
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/InterpreterRuleContext.cpp +0 -19
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/InterpreterRuleContext.h +0 -45
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/Lexer.cpp +0 -294
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/Lexer.h +0 -196
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerInterpreter.cpp +0 -60
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerInterpreter.h +0 -46
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerNoViableAltException.cpp +0 -36
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerNoViableAltException.h +0 -31
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/ListTokenSource.cpp +0 -92
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/ListTokenSource.h +0 -88
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/NoViableAltException.cpp +0 -46
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/NoViableAltException.h +0 -42
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/Parser.cpp +0 -670
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/Parser.h +0 -461
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserInterpreter.cpp +0 -294
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserInterpreter.h +0 -173
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserRuleContext.cpp +0 -138
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserRuleContext.h +0 -147
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/ProxyErrorListener.cpp +0 -53
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/ProxyErrorListener.h +0 -38
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/RecognitionException.cpp +0 -65
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/RecognitionException.h +0 -98
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/Recognizer.cpp +0 -157
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/Recognizer.h +0 -160
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContext.cpp +0 -144
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContext.h +0 -141
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContextWithAltNum.cpp +0 -27
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContextWithAltNum.h +0 -32
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/RuntimeMetaData.cpp +0 -54
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/RuntimeMetaData.h +0 -155
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/Token.cpp +0 -9
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/Token.h +0 -92
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenFactory.h +0 -30
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenSource.cpp +0 -9
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenSource.h +0 -85
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStream.cpp +0 -11
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStream.h +0 -137
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStreamRewriter.cpp +0 -425
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStreamRewriter.h +0 -295
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedCharStream.cpp +0 -208
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedCharStream.h +0 -117
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedTokenStream.cpp +0 -270
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedTokenStream.h +0 -115
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/Version.h +0 -42
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/Vocabulary.cpp +0 -64
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/Vocabulary.h +0 -177
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/WritableToken.cpp +0 -9
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/WritableToken.h +0 -23
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/antlr4-common.h +0 -101
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/antlr4-runtime.h +0 -168
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATN.cpp +0 -159
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATN.h +0 -133
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfig.cpp +0 -106
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfig.h +0 -157
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfigSet.cpp +0 -233
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfigSet.h +0 -157
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.cpp +0 -39
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.h +0 -48
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializer.cpp +0 -628
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializer.h +0 -32
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNSimulator.cpp +0 -33
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNSimulator.h +0 -71
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNState.cpp +0 -56
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNState.h +0 -139
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNStateType.cpp +0 -33
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNStateType.h +0 -36
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNType.h +0 -20
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ActionTransition.cpp +0 -29
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ActionTransition.h +0 -35
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AmbiguityInfo.cpp +0 -16
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AmbiguityInfo.h +0 -68
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.cpp +0 -129
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.h +0 -51
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AtomTransition.cpp +0 -27
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AtomTransition.h +0 -33
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BasicBlockStartState.h +0 -24
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BasicState.h +0 -23
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BlockEndState.h +0 -26
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BlockStartState.h +0 -30
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ContextSensitivityInfo.cpp +0 -14
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ContextSensitivityInfo.h +0 -47
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionEventInfo.cpp +0 -14
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionEventInfo.h +0 -70
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionInfo.cpp +0 -25
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionInfo.h +0 -227
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionState.cpp +0 -12
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionState.h +0 -34
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/EpsilonTransition.cpp +0 -31
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/EpsilonTransition.h +0 -42
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ErrorInfo.cpp +0 -15
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ErrorInfo.h +0 -43
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/HashUtils.h +0 -18
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LL1Analyzer.cpp +0 -189
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LL1Analyzer.h +0 -76
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNConfig.cpp +0 -67
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNConfig.h +0 -44
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNSimulator.cpp +0 -621
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNSimulator.h +0 -199
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerAction.cpp +0 -15
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerAction.h +0 -100
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerActionExecutor.cpp +0 -108
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerActionExecutor.h +0 -128
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerActionType.h +0 -57
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerChannelAction.cpp +0 -43
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerChannelAction.h +0 -59
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerCustomAction.cpp +0 -45
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerCustomAction.h +0 -75
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.cpp +0 -50
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.h +0 -76
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerModeAction.cpp +0 -43
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerModeAction.h +0 -57
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerMoreAction.cpp +0 -36
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerMoreAction.h +0 -53
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPopModeAction.cpp +0 -36
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPopModeAction.h +0 -53
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPushModeAction.cpp +0 -43
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPushModeAction.h +0 -57
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerSkipAction.cpp +0 -36
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerSkipAction.h +0 -51
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerTypeAction.cpp +0 -43
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerTypeAction.h +0 -51
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LookaheadEventInfo.cpp +0 -16
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LookaheadEventInfo.h +0 -42
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LoopEndState.h +0 -26
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/NotSetTransition.cpp +0 -22
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/NotSetTransition.h +0 -27
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.cpp +0 -16
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.h +0 -25
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParseInfo.cpp +0 -102
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParseInfo.h +0 -102
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp +0 -1413
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParserATNSimulator.h +0 -911
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParserATNSimulatorOptions.h +0 -50
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PlusBlockStartState.h +0 -29
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PlusLoopbackState.h +0 -25
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.cpp +0 -23
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.h +0 -35
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.cpp +0 -17
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.h +0 -62
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateTransition.cpp +0 -24
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateTransition.h +0 -50
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContext.cpp +0 -601
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContext.h +0 -225
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextCache.cpp +0 -56
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextCache.h +0 -63
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextMergeCache.cpp +0 -167
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextMergeCache.h +0 -101
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextMergeCacheOptions.h +0 -71
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextType.h +0 -21
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionMode.cpp +0 -202
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionMode.h +0 -436
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.cpp +0 -179
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.h +0 -60
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RangeTransition.cpp +0 -26
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RangeTransition.h +0 -31
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleStartState.h +0 -26
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleStopState.h +0 -27
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleTransition.cpp +0 -33
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleTransition.h +0 -42
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SemanticContext.cpp +0 -418
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SemanticContext.h +0 -237
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SemanticContextType.h +0 -23
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SerializedATNView.h +0 -101
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SetTransition.cpp +0 -28
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SetTransition.h +0 -38
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.cpp +0 -79
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.h +0 -43
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarBlockStartState.h +0 -24
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopEntryState.h +0 -37
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopbackState.cpp +0 -19
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopbackState.h +0 -25
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/TokensStartState.h +0 -24
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/Transition.cpp +0 -36
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/Transition.h +0 -65
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/TransitionType.cpp +0 -27
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/TransitionType.h +0 -33
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/WildcardTransition.cpp +0 -21
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/WildcardTransition.h +0 -27
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFA.cpp +0 -115
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFA.h +0 -96
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFASerializer.cpp +0 -60
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFASerializer.h +0 -32
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFAState.cpp +0 -59
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFAState.h +0 -154
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.cpp +0 -17
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.h +0 -22
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/internal/Synchronization.cpp +0 -100
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/internal/Synchronization.h +0 -154
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/InterpreterDataReader.cpp +0 -124
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/InterpreterDataReader.h +0 -33
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Interval.cpp +0 -61
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Interval.h +0 -84
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/IntervalSet.cpp +0 -508
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/IntervalSet.h +0 -190
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/MurmurHash.cpp +0 -120
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/MurmurHash.h +0 -102
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Predicate.cpp +0 -4
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Predicate.h +0 -21
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Any.cpp +0 -8
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Any.h +0 -16
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Arrays.cpp +0 -43
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Arrays.h +0 -149
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/BitSet.h +0 -76
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/CPPUtils.cpp +0 -207
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/CPPUtils.h +0 -65
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Casts.h +0 -34
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Declarations.h +0 -161
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/StringUtils.cpp +0 -38
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/StringUtils.h +0 -16
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Unicode.h +0 -28
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Utf8.cpp +0 -242
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Utf8.h +0 -54
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/AbstractParseTreeVisitor.h +0 -129
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNode.h +0 -24
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.cpp +0 -54
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.h +0 -43
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/IterativeParseTreeWalker.cpp +0 -66
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/IterativeParseTreeWalker.h +0 -53
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTree.cpp +0 -12
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTree.h +0 -111
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeListener.cpp +0 -9
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeListener.h +0 -39
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeProperty.h +0 -50
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeType.h +0 -22
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeVisitor.cpp +0 -9
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeVisitor.h +0 -57
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeWalker.cpp +0 -48
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeWalker.h +0 -55
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNode.h +0 -40
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.cpp +0 -54
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.h +0 -32
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/Trees.cpp +0 -241
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/Trees.h +0 -78
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/Chunk.cpp +0 -9
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/Chunk.h +0 -44
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreeMatch.cpp +0 -69
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreeMatch.h +0 -132
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePattern.cpp +0 -64
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePattern.h +0 -105
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePatternMatcher.cpp +0 -370
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePatternMatcher.h +0 -185
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.cpp +0 -77
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.h +0 -117
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TagChunk.cpp +0 -39
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TagChunk.h +0 -86
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TextChunk.cpp +0 -28
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TextChunk.h +0 -51
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.cpp +0 -36
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.h +0 -80
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPath.cpp +0 -154
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPath.h +0 -86
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathElement.cpp +0 -31
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathElement.h +0 -40
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp +0 -180
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.g4 +0 -64
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.h +0 -53
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.tokens +0 -12
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexerErrorListener.cpp +0 -13
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexerErrorListener.h +0 -22
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleAnywhereElement.cpp +0 -20
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleAnywhereElement.h +0 -27
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleElement.cpp +0 -30
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleElement.h +0 -26
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenAnywhereElement.cpp +0 -20
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenAnywhereElement.h +0 -25
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenElement.cpp +0 -33
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenElement.h +0 -26
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardAnywhereElement.cpp +0 -23
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardAnywhereElement.h +0 -23
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardElement.cpp +0 -24
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardElement.h +0 -23
- data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/tests/Utf8Test.cpp +0 -110
- data/ext/express_parser/antlrgen/Express.interp +0 -532
- data/ext/express_parser/antlrgen/Express.tokens +0 -190
- data/ext/express_parser/antlrgen/ExpressBaseListener.cpp +0 -7
- data/ext/express_parser/antlrgen/ExpressBaseListener.h +0 -623
- data/ext/express_parser/antlrgen/ExpressBaseVisitor.cpp +0 -7
- data/ext/express_parser/antlrgen/ExpressBaseVisitor.h +0 -816
- data/ext/express_parser/antlrgen/ExpressLexer.cpp +0 -685
- data/ext/express_parser/antlrgen/ExpressLexer.h +0 -78
- data/ext/express_parser/antlrgen/ExpressLexer.interp +0 -534
- data/ext/express_parser/antlrgen/ExpressLexer.tokens +0 -190
- data/ext/express_parser/antlrgen/ExpressListener.cpp +0 -7
- data/ext/express_parser/antlrgen/ExpressListener.h +0 -616
- data/ext/express_parser/antlrgen/ExpressParser.cpp +0 -17591
- data/ext/express_parser/antlrgen/ExpressParser.h +0 -3692
- data/ext/express_parser/antlrgen/ExpressVisitor.cpp +0 -7
- data/ext/express_parser/antlrgen/ExpressVisitor.h +0 -422
- data/ext/express_parser/express_parser.cpp +0 -19405
- data/ext/express_parser/extconf.rb +0 -63
- data/rakelib/antlr4-native.rake +0 -173
- data/rakelib/cross-ruby.rake +0 -403
- data/spec/acceptance/version_spec.rb +0 -30
- data/spec/expressir/express/cache_spec.rb +0 -89
- data/spec/expressir/express/formatter_spec.rb +0 -171
- data/spec/expressir/express/parser_spec.rb +0 -141
- data/spec/expressir/model/model_element_spec.rb +0 -343
- data/spec/spec_helper.rb +0 -24
- data/spec/support/console_helper.rb +0 -29
- data/spec/syntax/multiple.exp +0 -23
- data/spec/syntax/multiple.yaml +0 -198
- data/spec/syntax/multiple_formatted.exp +0 -71
- data/spec/syntax/multiple_hyperlink_formatted.exp +0 -71
- data/spec/syntax/multiple_schema_head_hyperlink_formatted.exp +0 -13
- data/spec/syntax/remark.exp +0 -193
- data/spec/syntax/remark.yaml +0 -471
- data/spec/syntax/remark_formatted.exp +0 -228
- data/spec/syntax/single.exp +0 -4
- data/spec/syntax/single.yaml +0 -18
- data/spec/syntax/single_formatted.exp +0 -10
- data/spec/syntax/single_formatted.yaml +0 -36
- data/spec/syntax/syntax.exp +0 -333
- data/spec/syntax/syntax.yaml +0 -3509
- data/spec/syntax/syntax_formatted.exp +0 -902
- data/spec/syntax/syntax_hyperlink_formatted.exp +0 -902
- data/spec/syntax/syntax_schema_head_formatted.exp +0 -18
@@ -1,242 +0,0 @@
|
|
1
|
-
/* Copyright (c) 2021 The ANTLR Project. All rights reserved.
|
2
|
-
* Use of this file is governed by the BSD 3-clause license that
|
3
|
-
* can be found in the LICENSE.txt file in the project root.
|
4
|
-
*/
|
5
|
-
|
6
|
-
#include <cassert>
|
7
|
-
#include <cstdint>
|
8
|
-
|
9
|
-
#include "support/Utf8.h"
|
10
|
-
#include "support/Unicode.h"
|
11
|
-
|
12
|
-
// The below implementation is based off of https://github.com/google/cel-cpp/internal/utf8.cc,
|
13
|
-
// which is itself based off of https://go.googlesource.com/go/+/refs/heads/master/src/unicode/utf8/utf8.go.
|
14
|
-
// If for some reason you feel the need to copy this implementation, please retain a comment
|
15
|
-
// referencing the two source files and giving credit, as well as maintaining any and all
|
16
|
-
// obligations required by the BSD 3-clause license that governs this file.
|
17
|
-
|
18
|
-
namespace antlrcpp {
|
19
|
-
|
20
|
-
namespace {
|
21
|
-
|
22
|
-
#undef SELF
|
23
|
-
constexpr uint8_t SELF = 0x80;
|
24
|
-
|
25
|
-
#undef LOW
|
26
|
-
constexpr uint8_t LOW = 0x80;
|
27
|
-
#undef HIGH
|
28
|
-
constexpr uint8_t HIGH = 0xbf;
|
29
|
-
|
30
|
-
#undef MASKX
|
31
|
-
constexpr uint8_t MASKX = 0x3f;
|
32
|
-
#undef MASK2
|
33
|
-
constexpr uint8_t MASK2 = 0x1f;
|
34
|
-
#undef MASK3
|
35
|
-
constexpr uint8_t MASK3 = 0xf;
|
36
|
-
#undef MASK4
|
37
|
-
constexpr uint8_t MASK4 = 0x7;
|
38
|
-
|
39
|
-
#undef TX
|
40
|
-
constexpr uint8_t TX = 0x80;
|
41
|
-
#undef T2
|
42
|
-
constexpr uint8_t T2 = 0xc0;
|
43
|
-
#undef T3
|
44
|
-
constexpr uint8_t T3 = 0xe0;
|
45
|
-
#undef T4
|
46
|
-
constexpr uint8_t T4 = 0xf0;
|
47
|
-
|
48
|
-
#undef XX
|
49
|
-
constexpr uint8_t XX = 0xf1;
|
50
|
-
#undef AS
|
51
|
-
constexpr uint8_t AS = 0xf0;
|
52
|
-
#undef S1
|
53
|
-
constexpr uint8_t S1 = 0x02;
|
54
|
-
#undef S2
|
55
|
-
constexpr uint8_t S2 = 0x13;
|
56
|
-
#undef S3
|
57
|
-
constexpr uint8_t S3 = 0x03;
|
58
|
-
#undef S4
|
59
|
-
constexpr uint8_t S4 = 0x23;
|
60
|
-
#undef S5
|
61
|
-
constexpr uint8_t S5 = 0x34;
|
62
|
-
#undef S6
|
63
|
-
constexpr uint8_t S6 = 0x04;
|
64
|
-
#undef S7
|
65
|
-
constexpr uint8_t S7 = 0x44;
|
66
|
-
|
67
|
-
// NOLINTBEGIN
|
68
|
-
// clang-format off
|
69
|
-
#undef LEADING
|
70
|
-
constexpr uint8_t LEADING[256] = {
|
71
|
-
// 1 2 3 4 5 6 7 8 9 A B C D E F
|
72
|
-
AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, // 0x00-0x0F
|
73
|
-
AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, // 0x10-0x1F
|
74
|
-
AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, // 0x20-0x2F
|
75
|
-
AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, // 0x30-0x3F
|
76
|
-
AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, // 0x40-0x4F
|
77
|
-
AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, // 0x50-0x5F
|
78
|
-
AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, // 0x60-0x6F
|
79
|
-
AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, // 0x70-0x7F
|
80
|
-
// 1 2 3 4 5 6 7 8 9 A B C D E F
|
81
|
-
XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, // 0x80-0x8F
|
82
|
-
XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, // 0x90-0x9F
|
83
|
-
XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, // 0xA0-0xAF
|
84
|
-
XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, // 0xB0-0xBF
|
85
|
-
XX, XX, S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, // 0xC0-0xCF
|
86
|
-
S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, // 0xD0-0xDF
|
87
|
-
S2, S3, S3, S3, S3, S3, S3, S3, S3, S3, S3, S3, S3, S4, S3, S3, // 0xE0-0xEF
|
88
|
-
S5, S6, S6, S6, S7, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, // 0xF0-0xFF
|
89
|
-
};
|
90
|
-
// clang-format on
|
91
|
-
// NOLINTEND
|
92
|
-
|
93
|
-
#undef ACCEPT
|
94
|
-
constexpr std::pair<uint8_t, uint8_t> ACCEPT[16] = {
|
95
|
-
{LOW, HIGH}, {0xa0, HIGH}, {LOW, 0x9f}, {0x90, HIGH},
|
96
|
-
{LOW, 0x8f}, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0},
|
97
|
-
{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0},
|
98
|
-
{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0},
|
99
|
-
};
|
100
|
-
|
101
|
-
} // namespace
|
102
|
-
|
103
|
-
std::pair<char32_t, size_t> Utf8::decode(std::string_view input) {
|
104
|
-
assert(!input.empty());
|
105
|
-
const auto b = static_cast<uint8_t>(input.front());
|
106
|
-
input.remove_prefix(1);
|
107
|
-
if (b < SELF) {
|
108
|
-
return {static_cast<char32_t>(b), 1};
|
109
|
-
}
|
110
|
-
const auto leading = LEADING[b];
|
111
|
-
if (leading == XX) {
|
112
|
-
return {Unicode::REPLACEMENT_CHARACTER, 1};
|
113
|
-
}
|
114
|
-
auto size = static_cast<size_t>(leading & 7) - 1;
|
115
|
-
if (size > input.size()) {
|
116
|
-
return {Unicode::REPLACEMENT_CHARACTER, 1};
|
117
|
-
}
|
118
|
-
const auto& accept = ACCEPT[leading >> 4];
|
119
|
-
const auto b1 = static_cast<uint8_t>(input.front());
|
120
|
-
input.remove_prefix(1);
|
121
|
-
if (b1 < accept.first || b1 > accept.second) {
|
122
|
-
return {Unicode::REPLACEMENT_CHARACTER, 1};
|
123
|
-
}
|
124
|
-
if (size <= 1) {
|
125
|
-
return {(static_cast<char32_t>(b & MASK2) << 6) |
|
126
|
-
static_cast<char32_t>(b1 & MASKX),
|
127
|
-
2};
|
128
|
-
}
|
129
|
-
const auto b2 = static_cast<uint8_t>(input.front());
|
130
|
-
input.remove_prefix(1);
|
131
|
-
if (b2 < LOW || b2 > HIGH) {
|
132
|
-
return {Unicode::REPLACEMENT_CHARACTER, 1};
|
133
|
-
}
|
134
|
-
if (size <= 2) {
|
135
|
-
return {(static_cast<char32_t>(b & MASK3) << 12) |
|
136
|
-
(static_cast<char32_t>(b1 & MASKX) << 6) |
|
137
|
-
static_cast<char32_t>(b2 & MASKX),
|
138
|
-
3};
|
139
|
-
}
|
140
|
-
const auto b3 = static_cast<uint8_t>(input.front());
|
141
|
-
input.remove_prefix(1);
|
142
|
-
if (b3 < LOW || b3 > HIGH) {
|
143
|
-
return {Unicode::REPLACEMENT_CHARACTER, 1};
|
144
|
-
}
|
145
|
-
return {(static_cast<char32_t>(b & MASK4) << 18) |
|
146
|
-
(static_cast<char32_t>(b1 & MASKX) << 12) |
|
147
|
-
(static_cast<char32_t>(b2 & MASKX) << 6) |
|
148
|
-
static_cast<char32_t>(b3 & MASKX),
|
149
|
-
4};
|
150
|
-
}
|
151
|
-
|
152
|
-
std::optional<std::u32string> Utf8::strictDecode(std::string_view input) {
|
153
|
-
std::u32string output;
|
154
|
-
char32_t codePoint;
|
155
|
-
size_t codeUnits;
|
156
|
-
output.reserve(input.size()); // Worst case is each byte is a single Unicode code point.
|
157
|
-
for (size_t index = 0; index < input.size(); index += codeUnits) {
|
158
|
-
std::tie(codePoint, codeUnits) = Utf8::decode(input.substr(index));
|
159
|
-
if (codePoint == Unicode::REPLACEMENT_CHARACTER && codeUnits == 1) {
|
160
|
-
// Condition is only met when an illegal byte sequence is encountered. See Utf8::decode.
|
161
|
-
return std::nullopt;
|
162
|
-
}
|
163
|
-
output.push_back(codePoint);
|
164
|
-
}
|
165
|
-
output.shrink_to_fit();
|
166
|
-
return output;
|
167
|
-
}
|
168
|
-
|
169
|
-
std::u32string Utf8::lenientDecode(std::string_view input) {
|
170
|
-
std::u32string output;
|
171
|
-
char32_t codePoint;
|
172
|
-
size_t codeUnits;
|
173
|
-
output.reserve(input.size()); // Worst case is each byte is a single Unicode code point.
|
174
|
-
for (size_t index = 0; index < input.size(); index += codeUnits) {
|
175
|
-
std::tie(codePoint, codeUnits) = Utf8::decode(input.substr(index));
|
176
|
-
output.push_back(codePoint);
|
177
|
-
}
|
178
|
-
output.shrink_to_fit();
|
179
|
-
return output;
|
180
|
-
}
|
181
|
-
|
182
|
-
std::string& Utf8::encode(std::string* buffer, char32_t codePoint) {
|
183
|
-
assert(buffer != nullptr);
|
184
|
-
if (!Unicode::isValid(codePoint)) {
|
185
|
-
codePoint = Unicode::REPLACEMENT_CHARACTER;
|
186
|
-
}
|
187
|
-
if (codePoint <= 0x7f) {
|
188
|
-
buffer->push_back(static_cast<char>(static_cast<uint8_t>(codePoint)));
|
189
|
-
} else if (codePoint <= 0x7ff) {
|
190
|
-
buffer->push_back(
|
191
|
-
static_cast<char>(T2 | static_cast<uint8_t>(codePoint >> 6)));
|
192
|
-
buffer->push_back(
|
193
|
-
static_cast<char>(TX | (static_cast<uint8_t>(codePoint) & MASKX)));
|
194
|
-
} else if (codePoint <= 0xffff) {
|
195
|
-
buffer->push_back(
|
196
|
-
static_cast<char>(T3 | static_cast<uint8_t>(codePoint >> 12)));
|
197
|
-
buffer->push_back(static_cast<char>(
|
198
|
-
TX | (static_cast<uint8_t>(codePoint >> 6) & MASKX)));
|
199
|
-
buffer->push_back(
|
200
|
-
static_cast<char>(TX | (static_cast<uint8_t>(codePoint) & MASKX)));
|
201
|
-
} else {
|
202
|
-
buffer->push_back(
|
203
|
-
static_cast<char>(T4 | static_cast<uint8_t>(codePoint >> 18)));
|
204
|
-
buffer->push_back(static_cast<char>(
|
205
|
-
TX | (static_cast<uint8_t>(codePoint >> 12) & MASKX)));
|
206
|
-
buffer->push_back(static_cast<char>(
|
207
|
-
TX | (static_cast<uint8_t>(codePoint >> 6) & MASKX)));
|
208
|
-
buffer->push_back(
|
209
|
-
static_cast<char>(TX | (static_cast<uint8_t>(codePoint) & MASKX)));
|
210
|
-
}
|
211
|
-
return *buffer;
|
212
|
-
}
|
213
|
-
|
214
|
-
std::optional<std::string> Utf8::strictEncode(std::u32string_view input) {
|
215
|
-
std::string output;
|
216
|
-
output.reserve(input.size() * 4); // Worst case is each Unicode code point encodes to 4 bytes.
|
217
|
-
for (size_t index = 0; index < input.size(); index++) {
|
218
|
-
char32_t codePoint = input[index];
|
219
|
-
if (!Unicode::isValid(codePoint)) {
|
220
|
-
return std::nullopt;
|
221
|
-
}
|
222
|
-
Utf8::encode(&output, codePoint);
|
223
|
-
}
|
224
|
-
output.shrink_to_fit();
|
225
|
-
return output;
|
226
|
-
}
|
227
|
-
|
228
|
-
std::string Utf8::lenientEncode(std::u32string_view input) {
|
229
|
-
std::string output;
|
230
|
-
output.reserve(input.size() * 4); // Worst case is each Unicode code point encodes to 4 bytes.
|
231
|
-
for (size_t index = 0; index < input.size(); index++) {
|
232
|
-
char32_t codePoint = input[index];
|
233
|
-
if (!Unicode::isValid(codePoint)) {
|
234
|
-
codePoint = Unicode::REPLACEMENT_CHARACTER;
|
235
|
-
}
|
236
|
-
Utf8::encode(&output, codePoint);
|
237
|
-
}
|
238
|
-
output.shrink_to_fit();
|
239
|
-
return output;
|
240
|
-
}
|
241
|
-
|
242
|
-
}
|
@@ -1,54 +0,0 @@
|
|
1
|
-
/* Copyright (c) 2021 The ANTLR Project. All rights reserved.
|
2
|
-
* Use of this file is governed by the BSD 3-clause license that
|
3
|
-
* can be found in the LICENSE.txt file in the project root.
|
4
|
-
*/
|
5
|
-
|
6
|
-
#pragma once
|
7
|
-
|
8
|
-
#include <optional>
|
9
|
-
#include <string>
|
10
|
-
#include <string_view>
|
11
|
-
#include <tuple>
|
12
|
-
|
13
|
-
#include "antlr4-common.h"
|
14
|
-
|
15
|
-
namespace antlrcpp {
|
16
|
-
|
17
|
-
class ANTLR4CPP_PUBLIC Utf8 final {
|
18
|
-
public:
|
19
|
-
// Decodes the next code point, returning the decoded code point and the number
|
20
|
-
// of code units (a.k.a. bytes) consumed. In the event that an invalid code unit
|
21
|
-
// sequence is returned the replacement character, U+FFFD, is returned with a
|
22
|
-
// code unit count of 1. As U+FFFD requires 3 code units when encoded, this can
|
23
|
-
// be used to differentiate valid input from malformed input.
|
24
|
-
static std::pair<char32_t, size_t> decode(std::string_view input);
|
25
|
-
|
26
|
-
// Decodes the given UTF-8 encoded input into a string of code points.
|
27
|
-
static std::optional<std::u32string> strictDecode(std::string_view input);
|
28
|
-
|
29
|
-
// Decodes the given UTF-8 encoded input into a string of code points. Unlike strictDecode(),
|
30
|
-
// each byte in an illegal byte sequence is replaced with the Unicode replacement character,
|
31
|
-
// U+FFFD.
|
32
|
-
static std::u32string lenientDecode(std::string_view input);
|
33
|
-
|
34
|
-
// Encodes the given code point and appends it to the buffer. If the code point
|
35
|
-
// is an unpaired surrogate or outside of the valid Unicode range it is replaced
|
36
|
-
// with the replacement character, U+FFFD.
|
37
|
-
static std::string& encode(std::string *buffer, char32_t codePoint);
|
38
|
-
|
39
|
-
// Encodes the given Unicode code point string as UTF-8.
|
40
|
-
static std::optional<std::string> strictEncode(std::u32string_view input);
|
41
|
-
|
42
|
-
// Encodes the given Unicode code point string as UTF-8. Unlike strictEncode(),
|
43
|
-
// each invalid Unicode code point is replaced with the Unicode replacement character, U+FFFD.
|
44
|
-
static std::string lenientEncode(std::u32string_view input);
|
45
|
-
|
46
|
-
private:
|
47
|
-
Utf8() = delete;
|
48
|
-
Utf8(const Utf8&) = delete;
|
49
|
-
Utf8(Utf8&&) = delete;
|
50
|
-
Utf8& operator=(const Utf8&) = delete;
|
51
|
-
Utf8& operator=(Utf8&&) = delete;
|
52
|
-
};
|
53
|
-
|
54
|
-
}
|
data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/AbstractParseTreeVisitor.h
DELETED
@@ -1,129 +0,0 @@
|
|
1
|
-
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
2
|
-
* Use of this file is governed by the BSD 3-clause license that
|
3
|
-
* can be found in the LICENSE.txt file in the project root.
|
4
|
-
*/
|
5
|
-
|
6
|
-
#pragma once
|
7
|
-
|
8
|
-
#include "tree/ParseTree.h"
|
9
|
-
#include "tree/ParseTreeVisitor.h"
|
10
|
-
|
11
|
-
namespace antlr4 {
|
12
|
-
namespace tree {
|
13
|
-
|
14
|
-
class ANTLR4CPP_PUBLIC AbstractParseTreeVisitor : public ParseTreeVisitor {
|
15
|
-
public:
|
16
|
-
/// The default implementation calls <seealso cref="ParseTree#accept"/> on the
|
17
|
-
/// specified tree.
|
18
|
-
virtual std::any visit(ParseTree *tree) override {
|
19
|
-
return tree->accept(this);
|
20
|
-
}
|
21
|
-
|
22
|
-
/**
|
23
|
-
* <p>The default implementation initializes the aggregate result to
|
24
|
-
* {@link #defaultResult defaultResult()}. Before visiting each child, it
|
25
|
-
* calls {@link #shouldVisitNextChild shouldVisitNextChild}; if the result
|
26
|
-
* is {@code false} no more children are visited and the current aggregate
|
27
|
-
* result is returned. After visiting a child, the aggregate result is
|
28
|
-
* updated by calling {@link #aggregateResult aggregateResult} with the
|
29
|
-
* previous aggregate result and the result of visiting the child.</p>
|
30
|
-
*
|
31
|
-
* <p>The default implementation is not safe for use in visitors that modify
|
32
|
-
* the tree structure. Visitors that modify the tree should override this
|
33
|
-
* method to behave properly in respect to the specific algorithm in use.</p>
|
34
|
-
*/
|
35
|
-
virtual std::any visitChildren(ParseTree *node) override {
|
36
|
-
std::any result = defaultResult();
|
37
|
-
size_t n = node->children.size();
|
38
|
-
for (size_t i = 0; i < n; i++) {
|
39
|
-
if (!shouldVisitNextChild(node, result)) {
|
40
|
-
break;
|
41
|
-
}
|
42
|
-
|
43
|
-
std::any childResult = node->children[i]->accept(this);
|
44
|
-
result = aggregateResult(std::move(result), std::move(childResult));
|
45
|
-
}
|
46
|
-
|
47
|
-
return result;
|
48
|
-
}
|
49
|
-
|
50
|
-
/// The default implementation returns the result of
|
51
|
-
/// <seealso cref="#defaultResult defaultResult"/>.
|
52
|
-
virtual std::any visitTerminal(TerminalNode * /*node*/) override {
|
53
|
-
return defaultResult();
|
54
|
-
}
|
55
|
-
|
56
|
-
/// The default implementation returns the result of
|
57
|
-
/// <seealso cref="#defaultResult defaultResult"/>.
|
58
|
-
virtual std::any visitErrorNode(ErrorNode * /*node*/) override {
|
59
|
-
return defaultResult();
|
60
|
-
}
|
61
|
-
|
62
|
-
protected:
|
63
|
-
/// <summary>
|
64
|
-
/// Gets the default value returned by visitor methods. This value is
|
65
|
-
/// returned by the default implementations of
|
66
|
-
/// <seealso cref="#visitTerminal visitTerminal"/>, <seealso cref="#visitErrorNode visitErrorNode"/>.
|
67
|
-
/// The default implementation of <seealso cref="#visitChildren visitChildren"/>
|
68
|
-
/// initializes its aggregate result to this value.
|
69
|
-
/// <p/>
|
70
|
-
/// The base implementation returns {@code std::any()}.
|
71
|
-
/// </summary>
|
72
|
-
/// <returns> The default value returned by visitor methods. </returns>
|
73
|
-
virtual std::any defaultResult() {
|
74
|
-
return std::any();
|
75
|
-
}
|
76
|
-
|
77
|
-
/// <summary>
|
78
|
-
/// Aggregates the results of visiting multiple children of a node. After
|
79
|
-
/// either all children are visited or <seealso cref="#shouldVisitNextChild"/> returns
|
80
|
-
/// {@code false}, the aggregate value is returned as the result of
|
81
|
-
/// <seealso cref="#visitChildren"/>.
|
82
|
-
/// <p/>
|
83
|
-
/// The default implementation returns {@code nextResult}, meaning
|
84
|
-
/// <seealso cref="#visitChildren"/> will return the result of the last child visited
|
85
|
-
/// (or return the initial value if the node has no children).
|
86
|
-
/// </summary>
|
87
|
-
/// <param name="aggregate"> The previous aggregate value. In the default
|
88
|
-
/// implementation, the aggregate value is initialized to
|
89
|
-
/// <seealso cref="#defaultResult"/>, which is passed as the {@code aggregate} argument
|
90
|
-
/// to this method after the first child node is visited. </param>
|
91
|
-
/// <param name="nextResult"> The result of the immediately preceeding call to visit
|
92
|
-
/// a child node.
|
93
|
-
/// </param>
|
94
|
-
/// <returns> The updated aggregate result. </returns>
|
95
|
-
virtual std::any aggregateResult(std::any /*aggregate*/, std::any nextResult) {
|
96
|
-
return nextResult;
|
97
|
-
}
|
98
|
-
|
99
|
-
/// <summary>
|
100
|
-
/// This method is called after visiting each child in
|
101
|
-
/// <seealso cref="#visitChildren"/>. This method is first called before the first
|
102
|
-
/// child is visited; at that point {@code currentResult} will be the initial
|
103
|
-
/// value (in the default implementation, the initial value is returned by a
|
104
|
-
/// call to <seealso cref="#defaultResult"/>. This method is not called after the last
|
105
|
-
/// child is visited.
|
106
|
-
/// <p/>
|
107
|
-
/// The default implementation always returns {@code true}, indicating that
|
108
|
-
/// {@code visitChildren} should only return after all children are visited.
|
109
|
-
/// One reason to override this method is to provide a "short circuit"
|
110
|
-
/// evaluation option for situations where the result of visiting a single
|
111
|
-
/// child has the potential to determine the result of the visit operation as
|
112
|
-
/// a whole.
|
113
|
-
/// </summary>
|
114
|
-
/// <param name="node"> The <seealso cref="ParseTree"/> whose children are currently being
|
115
|
-
/// visited. </param>
|
116
|
-
/// <param name="currentResult"> The current aggregate result of the children visited
|
117
|
-
/// to the current point.
|
118
|
-
/// </param>
|
119
|
-
/// <returns> {@code true} to continue visiting children. Otherwise return
|
120
|
-
/// {@code false} to stop visiting children and immediately return the
|
121
|
-
/// current aggregate result from <seealso cref="#visitChildren"/>. </returns>
|
122
|
-
virtual bool shouldVisitNextChild(ParseTree * /*node*/, const std::any &/*currentResult*/) {
|
123
|
-
return true;
|
124
|
-
}
|
125
|
-
|
126
|
-
};
|
127
|
-
|
128
|
-
} // namespace tree
|
129
|
-
} // namespace antlr4
|
@@ -1,24 +0,0 @@
|
|
1
|
-
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
2
|
-
* Use of this file is governed by the BSD 3-clause license that
|
3
|
-
* can be found in the LICENSE.txt file in the project root.
|
4
|
-
*/
|
5
|
-
|
6
|
-
#pragma once
|
7
|
-
|
8
|
-
#include "tree/TerminalNode.h"
|
9
|
-
|
10
|
-
namespace antlr4 {
|
11
|
-
namespace tree {
|
12
|
-
|
13
|
-
class ANTLR4CPP_PUBLIC ErrorNode : public TerminalNode {
|
14
|
-
public:
|
15
|
-
static bool is(const tree::ParseTree &parseTree) { return parseTree.getTreeType() == tree::ParseTreeType::ERROR; }
|
16
|
-
|
17
|
-
static bool is(const tree::ParseTree *parseTree) { return parseTree != nullptr && is(*parseTree); }
|
18
|
-
|
19
|
-
protected:
|
20
|
-
using TerminalNode::TerminalNode;
|
21
|
-
};
|
22
|
-
|
23
|
-
} // namespace tree
|
24
|
-
} // namespace antlr4
|
@@ -1,54 +0,0 @@
|
|
1
|
-
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
2
|
-
* Use of this file is governed by the BSD 3-clause license that
|
3
|
-
* can be found in the LICENSE.txt file in the project root.
|
4
|
-
*/
|
5
|
-
|
6
|
-
#include "misc/Interval.h"
|
7
|
-
#include "Token.h"
|
8
|
-
#include "RuleContext.h"
|
9
|
-
#include "tree/ParseTreeVisitor.h"
|
10
|
-
|
11
|
-
#include "tree/ErrorNodeImpl.h"
|
12
|
-
|
13
|
-
using namespace antlr4;
|
14
|
-
using namespace antlr4::tree;
|
15
|
-
|
16
|
-
Token* ErrorNodeImpl::getSymbol() const {
|
17
|
-
return symbol;
|
18
|
-
}
|
19
|
-
|
20
|
-
void ErrorNodeImpl::setParent(RuleContext *parent_) {
|
21
|
-
this->parent = parent_;
|
22
|
-
}
|
23
|
-
|
24
|
-
misc::Interval ErrorNodeImpl::getSourceInterval() {
|
25
|
-
if (symbol == nullptr) {
|
26
|
-
return misc::Interval::INVALID;
|
27
|
-
}
|
28
|
-
|
29
|
-
size_t tokenIndex = symbol->getTokenIndex();
|
30
|
-
return misc::Interval(tokenIndex, tokenIndex);
|
31
|
-
}
|
32
|
-
|
33
|
-
std::any ErrorNodeImpl::accept(ParseTreeVisitor *visitor) {
|
34
|
-
return visitor->visitErrorNode(this);
|
35
|
-
}
|
36
|
-
|
37
|
-
std::string ErrorNodeImpl::getText() {
|
38
|
-
return symbol->getText();
|
39
|
-
}
|
40
|
-
|
41
|
-
std::string ErrorNodeImpl::toStringTree(Parser * /*parser*/, bool /*pretty*/) {
|
42
|
-
return toString();
|
43
|
-
}
|
44
|
-
|
45
|
-
std::string ErrorNodeImpl::toString() {
|
46
|
-
if (symbol->getType() == Token::EOF) {
|
47
|
-
return "<EOF>";
|
48
|
-
}
|
49
|
-
return symbol->getText();
|
50
|
-
}
|
51
|
-
|
52
|
-
std::string ErrorNodeImpl::toStringTree(bool /*pretty*/) {
|
53
|
-
return toString();
|
54
|
-
}
|
@@ -1,43 +0,0 @@
|
|
1
|
-
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
2
|
-
* Use of this file is governed by the BSD 3-clause license that
|
3
|
-
* can be found in the LICENSE.txt file in the project root.
|
4
|
-
*/
|
5
|
-
|
6
|
-
#pragma once
|
7
|
-
|
8
|
-
#include "tree/ErrorNode.h"
|
9
|
-
#include "tree/TerminalNodeImpl.h"
|
10
|
-
#include "misc/Interval.h"
|
11
|
-
|
12
|
-
#include "support/Any.h"
|
13
|
-
|
14
|
-
namespace antlr4 {
|
15
|
-
namespace tree {
|
16
|
-
|
17
|
-
/// <summary>
|
18
|
-
/// Represents a token that was consumed during resynchronization
|
19
|
-
/// rather than during a valid match operation. For example,
|
20
|
-
/// we will create this kind of a node during single token insertion
|
21
|
-
/// and deletion as well as during "consume until error recovery set"
|
22
|
-
/// upon no viable alternative exceptions.
|
23
|
-
/// </summary>
|
24
|
-
class ANTLR4CPP_PUBLIC ErrorNodeImpl : public ErrorNode {
|
25
|
-
public:
|
26
|
-
Token *symbol;
|
27
|
-
|
28
|
-
explicit ErrorNodeImpl(Token *symbol) : ErrorNode(ParseTreeType::ERROR), symbol(symbol) {}
|
29
|
-
|
30
|
-
virtual Token* getSymbol() const override;
|
31
|
-
virtual void setParent(RuleContext *parent) override;
|
32
|
-
virtual misc::Interval getSourceInterval() override;
|
33
|
-
|
34
|
-
virtual std::any accept(ParseTreeVisitor *visitor) override;
|
35
|
-
|
36
|
-
virtual std::string getText() override;
|
37
|
-
virtual std::string toStringTree(Parser *parser, bool pretty = false) override;
|
38
|
-
virtual std::string toString() override;
|
39
|
-
virtual std::string toStringTree(bool pretty = false) override;
|
40
|
-
};
|
41
|
-
|
42
|
-
} // namespace tree
|
43
|
-
} // namespace antlr4
|
data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/IterativeParseTreeWalker.cpp
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
2
|
-
* Use of this file is governed by the BSD 3-clause license that
|
3
|
-
* can be found in the LICENSE.txt file in the project root.
|
4
|
-
*/
|
5
|
-
|
6
|
-
#include "support/CPPUtils.h"
|
7
|
-
#include "support/Casts.h"
|
8
|
-
|
9
|
-
#include "tree/ParseTreeListener.h"
|
10
|
-
#include "tree/ParseTree.h"
|
11
|
-
#include "tree/ErrorNode.h"
|
12
|
-
|
13
|
-
#include "IterativeParseTreeWalker.h"
|
14
|
-
|
15
|
-
using namespace antlr4::tree;
|
16
|
-
using namespace antlrcpp;
|
17
|
-
|
18
|
-
void IterativeParseTreeWalker::walk(ParseTreeListener *listener, ParseTree *t) const {
|
19
|
-
std::vector<std::pair<ParseTree*, size_t>> stack;
|
20
|
-
ParseTree *currentNode = t;
|
21
|
-
size_t currentIndex = 0;
|
22
|
-
|
23
|
-
while (currentNode != nullptr) {
|
24
|
-
// pre-order visit
|
25
|
-
if (ErrorNode::is(*currentNode)) {
|
26
|
-
listener->visitErrorNode(downCast<ErrorNode*>(currentNode));
|
27
|
-
} else if (TerminalNode::is(*currentNode)) {
|
28
|
-
listener->visitTerminal(downCast<TerminalNode*>(currentNode));
|
29
|
-
} else {
|
30
|
-
enterRule(listener, currentNode);
|
31
|
-
}
|
32
|
-
|
33
|
-
// Move down to first child, if it exists.
|
34
|
-
if (!currentNode->children.empty()) {
|
35
|
-
stack.push_back(std::make_pair(currentNode, currentIndex));
|
36
|
-
currentIndex = 0;
|
37
|
-
currentNode = currentNode->children[0];
|
38
|
-
continue;
|
39
|
-
}
|
40
|
-
|
41
|
-
// No child nodes, so walk tree.
|
42
|
-
do {
|
43
|
-
// post-order visit
|
44
|
-
if (!TerminalNode::is(*currentNode)) {
|
45
|
-
exitRule(listener, currentNode);
|
46
|
-
}
|
47
|
-
|
48
|
-
// No parent, so no siblings.
|
49
|
-
if (stack.empty()) {
|
50
|
-
currentNode = nullptr;
|
51
|
-
currentIndex = 0;
|
52
|
-
break;
|
53
|
-
}
|
54
|
-
|
55
|
-
// Move to next sibling if possible.
|
56
|
-
if (stack.back().first->children.size() > ++currentIndex) {
|
57
|
-
currentNode = stack.back().first->children[currentIndex];
|
58
|
-
break;
|
59
|
-
}
|
60
|
-
|
61
|
-
// No next sibling, so move up.
|
62
|
-
std::tie(currentNode, currentIndex) = stack.back();
|
63
|
-
stack.pop_back();
|
64
|
-
} while (currentNode != nullptr);
|
65
|
-
}
|
66
|
-
}
|
data/ext/express_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/IterativeParseTreeWalker.h
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* [The "BSD license"]
|
3
|
-
* Copyright (c) 2012 Terence Parr
|
4
|
-
* Copyright (c) 2012 Sam Harwell
|
5
|
-
* All rights reserved.
|
6
|
-
*
|
7
|
-
* Redistribution and use in source and binary forms, with or without
|
8
|
-
* modification, are permitted provided that the following conditions
|
9
|
-
* are met:
|
10
|
-
*
|
11
|
-
* 1. Redistributions of source code must retain the above copyright
|
12
|
-
* notice, this list of conditions and the following disclaimer.
|
13
|
-
* 2. Redistributions in binary form must reproduce the above copyright
|
14
|
-
* notice, this list of conditions and the following disclaimer in the
|
15
|
-
* documentation and/or other materials provided with the distribution.
|
16
|
-
* 3. The name of the author may not be used to endorse or promote products
|
17
|
-
* derived from this software without specific prior written permission.
|
18
|
-
*
|
19
|
-
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
20
|
-
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
21
|
-
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
22
|
-
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
23
|
-
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
24
|
-
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
25
|
-
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
26
|
-
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
27
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
28
|
-
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
|
-
*/
|
30
|
-
|
31
|
-
#pragma once
|
32
|
-
|
33
|
-
#include "antlr4-common.h"
|
34
|
-
|
35
|
-
#include "tree/ParseTreeWalker.h"
|
36
|
-
|
37
|
-
namespace antlr4 {
|
38
|
-
namespace tree {
|
39
|
-
|
40
|
-
class ParseTreeListener;
|
41
|
-
|
42
|
-
/**
|
43
|
-
* An iterative (read: non-recursive) pre-order and post-order tree walker that
|
44
|
-
* doesn't use the thread stack but heap-based stacks. Makes it possible to
|
45
|
-
* process deeply nested parse trees.
|
46
|
-
*/
|
47
|
-
class ANTLR4CPP_PUBLIC IterativeParseTreeWalker : public ParseTreeWalker {
|
48
|
-
public:
|
49
|
-
virtual void walk(ParseTreeListener *listener, ParseTree *t) const override;
|
50
|
-
};
|
51
|
-
|
52
|
-
} // namespace tree
|
53
|
-
} // namespace antlr4
|
@@ -1,12 +0,0 @@
|
|
1
|
-
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
2
|
-
* Use of this file is governed by the BSD 3-clause license that
|
3
|
-
* can be found in the LICENSE.txt file in the project root.
|
4
|
-
*/
|
5
|
-
|
6
|
-
#include "tree/ParseTree.h"
|
7
|
-
|
8
|
-
using namespace antlr4::tree;
|
9
|
-
|
10
|
-
bool ParseTree::operator == (const ParseTree &other) const {
|
11
|
-
return &other == this;
|
12
|
-
}
|