expressir 1.2.3 → 1.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.cross_rubies +0 -6
- data/.github/workflows/rake.yml +223 -31
- data/.gitignore +7 -1
- data/.gitmodules +3 -0
- data/.rubocop.yml +13 -4
- data/README.adoc +8 -0
- data/Rakefile +4 -1
- data/bin/console +0 -1
- data/bin/rspec +3 -3
- data/exe/expressir +4 -2
- data/exe/format +1 -1
- data/exe/format-test +25 -25
- data/exe/generate-parser +16 -13
- data/expressir.gemspec +11 -9
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/CMakeLists.txt +44 -9
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2013.vcxproj +11 -5
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2013.vcxproj.filters +0 -3
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2015.vcxproj +11 -4
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2015.vcxproj.filters +0 -3
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2017.vcxproj +11 -4
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2017.vcxproj.filters +0 -3
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2019.vcxproj +19 -4
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2019.vcxproj.filters +0 -3
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/project.pbxproj +51 -35
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/xcshareddata/xcschemes/antlr4.xcscheme +1 -1
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/xcshareddata/xcschemes/antlr4_ios.xcscheme +1 -5
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/xcshareddata/xcschemes/antlr4_static.xcscheme +1 -5
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRFileStream.cpp +1 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRFileStream.h +9 -6
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRInputStream.cpp +43 -18
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRInputStream.h +16 -6
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonToken.cpp +2 -4
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenFactory.cpp +1 -1
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenFactory.h +1 -1
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/DefaultErrorStrategy.cpp +16 -13
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Exceptions.cpp +2 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Exceptions.h +2 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/FailedPredicateException.cpp +5 -4
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/FailedPredicateException.h +1 -1
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/IntStream.h +1 -1
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Lexer.cpp +2 -3
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Lexer.h +9 -9
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerInterpreter.cpp +0 -15
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerInterpreter.h +1 -7
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ListTokenSource.cpp +2 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ListTokenSource.h +2 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Parser.cpp +51 -31
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Parser.h +1 -7
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserInterpreter.cpp +27 -39
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserInterpreter.h +1 -7
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserRuleContext.cpp +20 -23
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserRuleContext.h +21 -21
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ProxyErrorListener.cpp +4 -4
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RecognitionException.cpp +0 -1
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Recognizer.cpp +16 -27
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Recognizer.h +12 -17
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContext.cpp +4 -3
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContext.h +5 -1
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RuntimeMetaData.cpp +2 -1
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Token.h +7 -7
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenSource.h +1 -1
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStreamRewriter.cpp +6 -6
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStreamRewriter.h +4 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedCharStream.cpp +15 -18
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedCharStream.h +12 -18
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Version.h +42 -0
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Vocabulary.cpp +13 -53
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Vocabulary.h +11 -27
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/antlr4-common.h +19 -58
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/antlr4-runtime.h +7 -5
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATN.cpp +6 -57
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATN.h +35 -15
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfig.cpp +29 -36
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfig.h +36 -27
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfigSet.cpp +58 -54
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfigSet.h +77 -31
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.cpp +22 -32
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.h +22 -24
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializer.cpp +335 -464
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializer.h +9 -62
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNSimulator.cpp +9 -39
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNSimulator.h +6 -22
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNState.cpp +10 -26
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNState.h +42 -36
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNStateType.cpp +33 -0
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNStateType.h +36 -0
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ActionTransition.cpp +2 -6
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ActionTransition.h +4 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.cpp +49 -22
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.h +20 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AtomTransition.cpp +1 -5
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AtomTransition.h +5 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BasicBlockStartState.h +4 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BasicState.h +4 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BlockEndState.h +5 -3
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BlockStartState.h +10 -1
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionInfo.h +1 -1
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionState.cpp +0 -5
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionState.h +12 -8
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/EpsilonTransition.cpp +2 -6
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/EpsilonTransition.h +6 -3
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LL1Analyzer.cpp +139 -108
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LL1Analyzer.h +10 -43
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNConfig.cpp +16 -33
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNConfig.h +12 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNSimulator.cpp +69 -82
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNSimulator.h +17 -28
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerAction.cpp +12 -6
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerAction.h +45 -11
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerActionExecutor.cpp +48 -44
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerActionExecutor.h +31 -18
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerActionType.h +3 -1
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerChannelAction.cpp +14 -26
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerChannelAction.h +12 -16
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerCustomAction.cpp +15 -32
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerCustomAction.h +12 -24
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.cpp +23 -29
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.h +13 -19
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerModeAction.cpp +13 -26
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerModeAction.h +12 -16
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerMoreAction.cpp +6 -17
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerMoreAction.h +12 -16
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPopModeAction.cpp +6 -17
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPopModeAction.h +12 -16
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPushModeAction.cpp +13 -26
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPushModeAction.h +12 -16
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerSkipAction.cpp +6 -17
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerSkipAction.h +11 -15
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerTypeAction.cpp +13 -26
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerTypeAction.h +13 -17
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LoopEndState.h +5 -1
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/NotSetTransition.cpp +1 -6
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/NotSetTransition.h +4 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.cpp +6 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.h +8 -3
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp +169 -152
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParserATNSimulator.h +26 -19
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParserATNSimulatorOptions.h +50 -0
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PlusBlockStartState.h +5 -1
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PlusLoopbackState.h +5 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.cpp +2 -11
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.h +15 -9
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.cpp +2 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.h +2 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateTransition.cpp +4 -14
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateTransition.h +22 -11
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContext.cpp +255 -338
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContext.h +87 -116
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextCache.cpp +56 -0
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextCache.h +64 -0
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextMergeCache.cpp +167 -0
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextMergeCache.h +101 -0
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextMergeCacheOptions.h +71 -0
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextType.h +21 -0
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionMode.cpp +18 -17
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionMode.h +1 -1
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.cpp +2 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.h +2 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RangeTransition.cpp +1 -5
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RangeTransition.h +4 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleStartState.h +4 -3
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleStopState.h +4 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleTransition.cpp +1 -5
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleTransition.h +5 -3
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SemanticContext.cpp +197 -156
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SemanticContext.h +92 -81
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SemanticContextType.h +23 -0
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SerializedATNView.h +101 -0
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SetTransition.cpp +2 -6
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SetTransition.h +11 -3
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.cpp +39 -34
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.h +17 -10
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarBlockStartState.h +5 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopEntryState.h +4 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopbackState.cpp +6 -6
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopbackState.h +6 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/TokensStartState.h +5 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/Transition.cpp +1 -9
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/Transition.h +11 -22
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/TransitionType.cpp +27 -0
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/TransitionType.h +33 -0
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/WildcardTransition.cpp +1 -5
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/WildcardTransition.h +4 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFA.cpp +11 -23
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFA.h +20 -15
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFASerializer.cpp +2 -9
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFASerializer.h +4 -4
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFAState.cpp +9 -50
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFAState.h +57 -48
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.cpp +1 -4
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.h +3 -4
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/InterpreterDataReader.cpp +2 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/InterpreterDataReader.h +3 -1
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Interval.cpp +1 -29
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Interval.h +10 -10
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/IntervalSet.cpp +15 -28
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/IntervalSet.h +1 -9
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/MurmurHash.cpp +54 -68
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/MurmurHash.h +35 -9
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Any.cpp +0 -5
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Any.h +1 -155
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Arrays.cpp +2 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Arrays.h +39 -0
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/BitSet.h +1 -1
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/CPPUtils.cpp +13 -54
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/CPPUtils.h +16 -29
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Casts.h +34 -0
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Declarations.h +0 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/StringUtils.cpp +25 -23
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/StringUtils.h +2 -40
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Unicode.h +28 -0
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Utf8.cpp +242 -0
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Utf8.h +54 -0
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/AbstractParseTreeVisitor.h +13 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNode.h +7 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.cpp +36 -5
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.h +14 -4
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/IterativeParseTreeWalker.cpp +14 -19
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTree.cpp +0 -3
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTree.h +14 -5
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeType.h +22 -0
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeVisitor.h +4 -4
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeWalker.cpp +8 -9
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeWalker.h +30 -6
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNode.h +10 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.cpp +2 -5
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.h +4 -5
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/Trees.cpp +1 -1
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePattern.cpp +1 -1
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePatternMatcher.cpp +1 -2
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPath.cpp +1 -1
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp +128 -119
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.h +18 -27
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleElement.cpp +1 -1
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenElement.cpp +1 -1
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/tests/Utf8Test.cpp +110 -0
- data/ext/express-parser/antlrgen/Express.interp +1 -1
- data/ext/express-parser/antlrgen/ExpressBaseListener.cpp +1 -1
- data/ext/express-parser/antlrgen/ExpressBaseListener.h +1 -1
- data/ext/express-parser/antlrgen/ExpressBaseVisitor.cpp +1 -1
- data/ext/express-parser/antlrgen/ExpressBaseVisitor.h +200 -200
- data/ext/express-parser/antlrgen/ExpressLexer.cpp +645 -1129
- data/ext/express-parser/antlrgen/ExpressLexer.h +20 -27
- data/ext/express-parser/antlrgen/ExpressLexer.interp +1 -1
- data/ext/express-parser/antlrgen/ExpressListener.cpp +1 -1
- data/ext/express-parser/antlrgen/ExpressListener.h +1 -1
- data/ext/express-parser/antlrgen/ExpressParser.cpp +1754 -1447
- data/ext/express-parser/antlrgen/ExpressParser.h +219 -223
- data/ext/express-parser/antlrgen/ExpressVisitor.cpp +1 -1
- data/ext/express-parser/antlrgen/ExpressVisitor.h +200 -200
- data/ext/express-parser/express_parser.cpp +165 -101
- data/ext/express-parser/extconf.rb +14 -14
- data/lib/expressir/config.rb +1 -1
- data/lib/expressir/express/parser.rb +17 -15
- data/lib/expressir/express/visitor.rb +7 -3
- data/lib/expressir/model.rb +78 -78
- data/lib/expressir/version.rb +1 -1
- data/rakelib/antlr4-native.rake +161 -0
- data/rakelib/cross-ruby.rake +213 -162
- data/spec/acceptance/version_spec.rb +17 -2
- data/spec/expressir/express/cache_spec.rb +23 -5
- data/spec/expressir/express/formatter_spec.rb +54 -8
- data/spec/expressir/express/parser_spec.rb +47 -11
- data/spec/expressir/model/model_element_spec.rb +198 -146
- data/spec/spec_helper.rb +7 -0
- metadata +79 -91
- data/demo.rb +0 -18
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNSerializer.cpp +0 -621
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNSerializer.h +0 -61
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AbstractPredicateTransition.cpp +0 -14
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AbstractPredicateTransition.h +0 -24
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BasicBlockStartState.cpp +0 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BasicState.cpp +0 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BlockEndState.cpp +0 -15
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BlockStartState.cpp +0 -9
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/EmptyPredictionContext.cpp +0 -35
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/EmptyPredictionContext.h +0 -27
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LoopEndState.cpp +0 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/Makefile +0 -67
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PlusBlockStartState.cpp +0 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PlusLoopbackState.cpp +0 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleStartState.cpp +0 -16
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleStopState.cpp +0 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarBlockStartState.cpp +0 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopEntryState.cpp +0 -15
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/TokensStartState.cpp +0 -12
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/guid.cpp +0 -303
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/guid.h +0 -112
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNode.cpp +0 -9
- data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNode.cpp +0 -9
- data/original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.exp +0 -9589
- data/original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.owl +0 -36619
- data/original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.xml +0 -13294
- data/original/examples/employment/eclipse/.project +0 -17
- data/original/examples/employment/eclipse/Export/Employment.png +0 -0
- data/original/examples/employment/eclipse/Express/employment_schema.exp +0 -33
- data/original/examples/employment/eclipse/Express/employment_schema.xmi +0 -77
- data/original/examples/employment/eclipse/Express/employment_schema.xml +0 -93
- data/original/examples/employment/eclipse/Models/Employment.uml +0 -4
- data/original/examples/employment/eclipse/Models/Employment.umldi +0 -240
- data/original/examples/employment/eclipse/readme.txt +0 -7
- data/original/examples/employment/employment_schema.exp +0 -33
- data/original/examples/employment/employment_schema.rb +0 -232
- data/original/examples/employment/employment_schema.xml +0 -93
- data/original/examples/employment/employment_schema___module.rb +0 -46
- data/original/examples/employment/employment_schema___p28attr.rb +0 -126
- data/original/examples/employment/employment_schema___p28inst.rb +0 -26
- data/original/examples/employment/example_employment_data.xml +0 -1
- data/original/examples/employment/example_employment_data_copy.xml +0 -1
- data/original/examples/employment/example_employment_reader.rb +0 -30
- data/original/examples/employment/example_employment_writer.rb +0 -51
- data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.exp +0 -3710
- data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.owl +0 -35880
- data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.xmi +0 -15357
- data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.xml +0 -9468
- data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.exp +0 -8404
- data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.owl +0 -43147
- data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.xmi +0 -18341
- data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.xml +0 -11632
- data/original/exp2ruby.rb +0 -525
- data/original/expsm.rb +0 -34
- data/original/mapping_owl.rb +0 -1018
- data/original/mapping_sysml.rb +0 -2281
- data/original/mapping_uml2.rb +0 -599
- data/original/mapping_uml2_eclipse.rb +0 -433
- data/original/reeper.rb +0 -134
- data/spec/expressr_spec.rb +0 -5
data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/project.pbxproj
CHANGED
@@ -3,12 +3,11 @@
|
|
3
3
|
archiveVersion = 1;
|
4
4
|
classes = {
|
5
5
|
};
|
6
|
-
objectVersion =
|
6
|
+
objectVersion = 54;
|
7
7
|
objects = {
|
8
8
|
|
9
9
|
/* Begin PBXBuildFile section */
|
10
10
|
270C67F31CDB4F1E00116E17 /* antlrcpp_ios.h in Headers */ = {isa = PBXBuildFile; fileRef = 270C67F21CDB4F1E00116E17 /* antlrcpp_ios.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
11
|
-
270C69E01CDB536A00116E17 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 270C69DF1CDB536A00116E17 /* CoreFoundation.framework */; };
|
12
11
|
276566E01DA93BFB000869BE /* ParseTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 276566DF1DA93BFB000869BE /* ParseTree.cpp */; };
|
13
12
|
276566E11DA93BFB000869BE /* ParseTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 276566DF1DA93BFB000869BE /* ParseTree.cpp */; };
|
14
13
|
276566E21DA93BFB000869BE /* ParseTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 276566DF1DA93BFB000869BE /* ParseTree.cpp */; };
|
@@ -645,12 +644,12 @@
|
|
645
644
|
276E5FBC1CDB57AA003FF4B4 /* Declarations.h in Headers */ = {isa = PBXBuildFile; fileRef = 276E5CEA1CDB57AA003FF4B4 /* Declarations.h */; };
|
646
645
|
276E5FBD1CDB57AA003FF4B4 /* Declarations.h in Headers */ = {isa = PBXBuildFile; fileRef = 276E5CEA1CDB57AA003FF4B4 /* Declarations.h */; };
|
647
646
|
276E5FBE1CDB57AA003FF4B4 /* Declarations.h in Headers */ = {isa = PBXBuildFile; fileRef = 276E5CEA1CDB57AA003FF4B4 /* Declarations.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
648
|
-
276E5FBF1CDB57AA003FF4B4 /*
|
649
|
-
276E5FC01CDB57AA003FF4B4 /*
|
650
|
-
276E5FC11CDB57AA003FF4B4 /*
|
651
|
-
276E5FC21CDB57AA003FF4B4 /*
|
652
|
-
276E5FC31CDB57AA003FF4B4 /*
|
653
|
-
276E5FC41CDB57AA003FF4B4 /*
|
647
|
+
276E5FBF1CDB57AA003FF4B4 /* Guid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 276E5CEB1CDB57AA003FF4B4 /* Guid.cpp */; };
|
648
|
+
276E5FC01CDB57AA003FF4B4 /* Guid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 276E5CEB1CDB57AA003FF4B4 /* Guid.cpp */; };
|
649
|
+
276E5FC11CDB57AA003FF4B4 /* Guid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 276E5CEB1CDB57AA003FF4B4 /* Guid.cpp */; };
|
650
|
+
276E5FC21CDB57AA003FF4B4 /* Guid.h in Headers */ = {isa = PBXBuildFile; fileRef = 276E5CEC1CDB57AA003FF4B4 /* Guid.h */; };
|
651
|
+
276E5FC31CDB57AA003FF4B4 /* Guid.h in Headers */ = {isa = PBXBuildFile; fileRef = 276E5CEC1CDB57AA003FF4B4 /* Guid.h */; };
|
652
|
+
276E5FC41CDB57AA003FF4B4 /* Guid.h in Headers */ = {isa = PBXBuildFile; fileRef = 276E5CEC1CDB57AA003FF4B4 /* Guid.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
654
653
|
276E5FC51CDB57AA003FF4B4 /* StringUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 276E5CED1CDB57AA003FF4B4 /* StringUtils.cpp */; };
|
655
654
|
276E5FC61CDB57AA003FF4B4 /* StringUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 276E5CED1CDB57AA003FF4B4 /* StringUtils.cpp */; };
|
656
655
|
276E5FC71CDB57AA003FF4B4 /* StringUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 276E5CED1CDB57AA003FF4B4 /* StringUtils.cpp */; };
|
@@ -927,7 +926,6 @@
|
|
927
926
|
270C67F01CDB4F1E00116E17 /* antlr4_ios.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = antlr4_ios.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
928
927
|
270C67F21CDB4F1E00116E17 /* antlrcpp_ios.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = antlrcpp_ios.h; sourceTree = "<group>"; wrapsLines = 0; };
|
929
928
|
270C67F41CDB4F1E00116E17 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
930
|
-
270C69DF1CDB536A00116E17 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/CoreFoundation.framework; sourceTree = DEVELOPER_DIR; };
|
931
929
|
276566DF1DA93BFB000869BE /* ParseTree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParseTree.cpp; sourceTree = "<group>"; };
|
932
930
|
276E5C0C1CDB57AA003FF4B4 /* ANTLRErrorListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANTLRErrorListener.h; sourceTree = "<group>"; wrapsLines = 0; };
|
933
931
|
276E5C0D1CDB57AA003FF4B4 /* ANTLRErrorStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANTLRErrorStrategy.h; sourceTree = "<group>"; };
|
@@ -1140,8 +1138,8 @@
|
|
1140
1138
|
276E5CE81CDB57AA003FF4B4 /* CPPUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CPPUtils.cpp; sourceTree = "<group>"; wrapsLines = 0; };
|
1141
1139
|
276E5CE91CDB57AA003FF4B4 /* CPPUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPPUtils.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
1142
1140
|
276E5CEA1CDB57AA003FF4B4 /* Declarations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Declarations.h; sourceTree = "<group>"; };
|
1143
|
-
276E5CEB1CDB57AA003FF4B4 /*
|
1144
|
-
276E5CEC1CDB57AA003FF4B4 /*
|
1141
|
+
276E5CEB1CDB57AA003FF4B4 /* Guid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Guid.cpp; sourceTree = "<group>"; };
|
1142
|
+
276E5CEC1CDB57AA003FF4B4 /* Guid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Guid.h; sourceTree = "<group>"; };
|
1145
1143
|
276E5CED1CDB57AA003FF4B4 /* StringUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringUtils.cpp; sourceTree = "<group>"; };
|
1146
1144
|
276E5CEE1CDB57AA003FF4B4 /* StringUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringUtils.h; sourceTree = "<group>"; };
|
1147
1145
|
276E5CF01CDB57AA003FF4B4 /* Token.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Token.h; sourceTree = "<group>"; };
|
@@ -1242,7 +1240,6 @@
|
|
1242
1240
|
isa = PBXFrameworksBuildPhase;
|
1243
1241
|
buildActionMask = 2147483647;
|
1244
1242
|
files = (
|
1245
|
-
270C69E01CDB536A00116E17 /* CoreFoundation.framework in Frameworks */,
|
1246
1243
|
);
|
1247
1244
|
runOnlyForDeploymentPostprocessing = 0;
|
1248
1245
|
};
|
@@ -1553,8 +1550,8 @@
|
|
1553
1550
|
276E5CE81CDB57AA003FF4B4 /* CPPUtils.cpp */,
|
1554
1551
|
276E5CE91CDB57AA003FF4B4 /* CPPUtils.h */,
|
1555
1552
|
276E5CEA1CDB57AA003FF4B4 /* Declarations.h */,
|
1556
|
-
276E5CEB1CDB57AA003FF4B4 /*
|
1557
|
-
276E5CEC1CDB57AA003FF4B4 /*
|
1553
|
+
276E5CEB1CDB57AA003FF4B4 /* Guid.cpp */,
|
1554
|
+
276E5CEC1CDB57AA003FF4B4 /* Guid.h */,
|
1558
1555
|
276E5CED1CDB57AA003FF4B4 /* StringUtils.cpp */,
|
1559
1556
|
276E5CEE1CDB57AA003FF4B4 /* StringUtils.h */,
|
1560
1557
|
);
|
@@ -1618,7 +1615,6 @@
|
|
1618
1615
|
27874F221CCBB34200AF1C53 /* Linked Frameworks */ = {
|
1619
1616
|
isa = PBXGroup;
|
1620
1617
|
children = (
|
1621
|
-
270C69DF1CDB536A00116E17 /* CoreFoundation.framework */,
|
1622
1618
|
27874F1D1CCB7A0700AF1C53 /* CoreFoundation.framework */,
|
1623
1619
|
);
|
1624
1620
|
name = "Linked Frameworks";
|
@@ -1767,7 +1763,7 @@
|
|
1767
1763
|
276E5F581CDB57AA003FF4B4 /* LexerNoViableAltException.h in Headers */,
|
1768
1764
|
276E5D811CDB57AA003FF4B4 /* ATNSimulator.h in Headers */,
|
1769
1765
|
27DB44B61D0463CC007E790B /* XPathLexer.h in Headers */,
|
1770
|
-
276E5FC41CDB57AA003FF4B4 /*
|
1766
|
+
276E5FC41CDB57AA003FF4B4 /* Guid.h in Headers */,
|
1771
1767
|
276E602D1CDB57AA003FF4B4 /* TagChunk.h in Headers */,
|
1772
1768
|
276E5E951CDB57AA003FF4B4 /* RuleStopState.h in Headers */,
|
1773
1769
|
276E5F761CDB57AA003FF4B4 /* Predicate.h in Headers */,
|
@@ -1934,7 +1930,7 @@
|
|
1934
1930
|
276E60141CDB57AA003FF4B4 /* ParseTreeMatch.h in Headers */,
|
1935
1931
|
276E5F571CDB57AA003FF4B4 /* LexerNoViableAltException.h in Headers */,
|
1936
1932
|
276E5D801CDB57AA003FF4B4 /* ATNSimulator.h in Headers */,
|
1937
|
-
276E5FC31CDB57AA003FF4B4 /*
|
1933
|
+
276E5FC31CDB57AA003FF4B4 /* Guid.h in Headers */,
|
1938
1934
|
276E602C1CDB57AA003FF4B4 /* TagChunk.h in Headers */,
|
1939
1935
|
276E5E941CDB57AA003FF4B4 /* RuleStopState.h in Headers */,
|
1940
1936
|
276E5F751CDB57AA003FF4B4 /* Predicate.h in Headers */,
|
@@ -2092,7 +2088,7 @@
|
|
2092
2088
|
276E60131CDB57AA003FF4B4 /* ParseTreeMatch.h in Headers */,
|
2093
2089
|
276E5F561CDB57AA003FF4B4 /* LexerNoViableAltException.h in Headers */,
|
2094
2090
|
276E5D7F1CDB57AA003FF4B4 /* ATNSimulator.h in Headers */,
|
2095
|
-
276E5FC21CDB57AA003FF4B4 /*
|
2091
|
+
276E5FC21CDB57AA003FF4B4 /* Guid.h in Headers */,
|
2096
2092
|
276E602B1CDB57AA003FF4B4 /* TagChunk.h in Headers */,
|
2097
2093
|
276E5E931CDB57AA003FF4B4 /* RuleStopState.h in Headers */,
|
2098
2094
|
276E5F741CDB57AA003FF4B4 /* Predicate.h in Headers */,
|
@@ -2226,7 +2222,7 @@
|
|
2226
2222
|
37D727A21867AF1E007B6D10 /* Project object */ = {
|
2227
2223
|
isa = PBXProject;
|
2228
2224
|
attributes = {
|
2229
|
-
LastUpgradeCheck =
|
2225
|
+
LastUpgradeCheck = 1240;
|
2230
2226
|
ORGANIZATIONNAME = ANTLR;
|
2231
2227
|
TargetAttributes = {
|
2232
2228
|
270C67EF1CDB4F1E00116E17 = {
|
@@ -2238,7 +2234,7 @@
|
|
2238
2234
|
};
|
2239
2235
|
};
|
2240
2236
|
buildConfigurationList = 37D727A51867AF1E007B6D10 /* Build configuration list for PBXProject "antlrcpp" */;
|
2241
|
-
compatibilityVersion = "Xcode
|
2237
|
+
compatibilityVersion = "Xcode 12.0";
|
2242
2238
|
developmentRegion = en;
|
2243
2239
|
hasScannedForEncodings = 0;
|
2244
2240
|
knownRegions = (
|
@@ -2368,7 +2364,7 @@
|
|
2368
2364
|
276E5E861CDB57AA003FF4B4 /* RangeTransition.cpp in Sources */,
|
2369
2365
|
276E5D7E1CDB57AA003FF4B4 /* ATNSimulator.cpp in Sources */,
|
2370
2366
|
276E5D9C1CDB57AA003FF4B4 /* BasicState.cpp in Sources */,
|
2371
|
-
276E5FC11CDB57AA003FF4B4 /*
|
2367
|
+
276E5FC11CDB57AA003FF4B4 /* Guid.cpp in Sources */,
|
2372
2368
|
276E5E801CDB57AA003FF4B4 /* ProfilingATNSimulator.cpp in Sources */,
|
2373
2369
|
2793DCA91F08095F00A84290 /* ANTLRErrorStrategy.cpp in Sources */,
|
2374
2370
|
276E5F401CDB57AA003FF4B4 /* IntStream.cpp in Sources */,
|
@@ -2522,7 +2518,7 @@
|
|
2522
2518
|
276E5E851CDB57AA003FF4B4 /* RangeTransition.cpp in Sources */,
|
2523
2519
|
276E5D7D1CDB57AA003FF4B4 /* ATNSimulator.cpp in Sources */,
|
2524
2520
|
276E5D9B1CDB57AA003FF4B4 /* BasicState.cpp in Sources */,
|
2525
|
-
276E5FC01CDB57AA003FF4B4 /*
|
2521
|
+
276E5FC01CDB57AA003FF4B4 /* Guid.cpp in Sources */,
|
2526
2522
|
276E5E7F1CDB57AA003FF4B4 /* ProfilingATNSimulator.cpp in Sources */,
|
2527
2523
|
2793DCA81F08095F00A84290 /* ANTLRErrorStrategy.cpp in Sources */,
|
2528
2524
|
276E5F3F1CDB57AA003FF4B4 /* IntStream.cpp in Sources */,
|
@@ -2676,7 +2672,7 @@
|
|
2676
2672
|
276E5E841CDB57AA003FF4B4 /* RangeTransition.cpp in Sources */,
|
2677
2673
|
276E5D7C1CDB57AA003FF4B4 /* ATNSimulator.cpp in Sources */,
|
2678
2674
|
276E5D9A1CDB57AA003FF4B4 /* BasicState.cpp in Sources */,
|
2679
|
-
276E5FBF1CDB57AA003FF4B4 /*
|
2675
|
+
276E5FBF1CDB57AA003FF4B4 /* Guid.cpp in Sources */,
|
2680
2676
|
276E5E7E1CDB57AA003FF4B4 /* ProfilingATNSimulator.cpp in Sources */,
|
2681
2677
|
2793DCA71F08095F00A84290 /* ANTLRErrorStrategy.cpp in Sources */,
|
2682
2678
|
276E5F3E1CDB57AA003FF4B4 /* IntStream.cpp in Sources */,
|
@@ -2737,6 +2733,7 @@
|
|
2737
2733
|
isa = XCBuildConfiguration;
|
2738
2734
|
buildSettings = {
|
2739
2735
|
CLANG_ANALYZER_NONNULL = YES;
|
2736
|
+
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
|
2740
2737
|
CLANG_ENABLE_MODULES = YES;
|
2741
2738
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
2742
2739
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
@@ -2751,8 +2748,12 @@
|
|
2751
2748
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
2752
2749
|
INFOPLIST_FILE = "antlrcpp-ios/Info.plist";
|
2753
2750
|
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
2754
|
-
IPHONEOS_DEPLOYMENT_TARGET =
|
2755
|
-
LD_RUNPATH_SEARCH_PATHS =
|
2751
|
+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
2752
|
+
LD_RUNPATH_SEARCH_PATHS = (
|
2753
|
+
"$(inherited)",
|
2754
|
+
"@executable_path/Frameworks",
|
2755
|
+
"@loader_path/Frameworks",
|
2756
|
+
);
|
2756
2757
|
MTL_ENABLE_DEBUG_INFO = YES;
|
2757
2758
|
PRODUCT_BUNDLE_IDENTIFIER = "org.antlr.v4.runtime.antlrcpp-ios";
|
2758
2759
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
@@ -2768,6 +2769,7 @@
|
|
2768
2769
|
isa = XCBuildConfiguration;
|
2769
2770
|
buildSettings = {
|
2770
2771
|
CLANG_ANALYZER_NONNULL = YES;
|
2772
|
+
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
|
2771
2773
|
CLANG_ENABLE_MODULES = YES;
|
2772
2774
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
2773
2775
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
@@ -2782,8 +2784,12 @@
|
|
2782
2784
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
2783
2785
|
INFOPLIST_FILE = "antlrcpp-ios/Info.plist";
|
2784
2786
|
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
2785
|
-
IPHONEOS_DEPLOYMENT_TARGET =
|
2786
|
-
LD_RUNPATH_SEARCH_PATHS =
|
2787
|
+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
2788
|
+
LD_RUNPATH_SEARCH_PATHS = (
|
2789
|
+
"$(inherited)",
|
2790
|
+
"@executable_path/Frameworks",
|
2791
|
+
"@loader_path/Frameworks",
|
2792
|
+
);
|
2787
2793
|
MTL_ENABLE_DEBUG_INFO = NO;
|
2788
2794
|
PRODUCT_BUNDLE_IDENTIFIER = "org.antlr.v4.runtime.antlrcpp-ios";
|
2789
2795
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
@@ -2799,6 +2805,7 @@
|
|
2799
2805
|
37C1471F1B4D5A04008EDDDB /* Debug */ = {
|
2800
2806
|
isa = XCBuildConfiguration;
|
2801
2807
|
buildSettings = {
|
2808
|
+
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
|
2802
2809
|
CLANG_ENABLE_MODULES = YES;
|
2803
2810
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
2804
2811
|
COMBINE_HIDPI_IMAGES = YES;
|
@@ -2821,6 +2828,7 @@
|
|
2821
2828
|
37C147201B4D5A04008EDDDB /* Release */ = {
|
2822
2829
|
isa = XCBuildConfiguration;
|
2823
2830
|
buildSettings = {
|
2831
|
+
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
|
2824
2832
|
CLANG_ENABLE_MODULES = YES;
|
2825
2833
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
2826
2834
|
COMBINE_HIDPI_IMAGES = YES;
|
@@ -2841,8 +2849,7 @@
|
|
2841
2849
|
buildSettings = {
|
2842
2850
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
2843
2851
|
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
2844
|
-
CLANG_CXX_LANGUAGE_STANDARD = "c++
|
2845
|
-
CLANG_CXX_LIBRARY = "libc++";
|
2852
|
+
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
|
2846
2853
|
CLANG_ENABLE_OBJC_ARC = YES;
|
2847
2854
|
CLANG_WARN_ASSIGN_ENUM = YES;
|
2848
2855
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
@@ -2857,6 +2864,7 @@
|
|
2857
2864
|
CLANG_WARN_INT_CONVERSION = YES;
|
2858
2865
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
2859
2866
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
2867
|
+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
2860
2868
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
2861
2869
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
2862
2870
|
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
|
@@ -2889,8 +2897,12 @@
|
|
2889
2897
|
GCC_WARN_UNUSED_LABEL = YES;
|
2890
2898
|
GCC_WARN_UNUSED_PARAMETER = YES;
|
2891
2899
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
2892
|
-
HEADER_SEARCH_PATHS =
|
2893
|
-
|
2900
|
+
HEADER_SEARCH_PATHS = (
|
2901
|
+
src/,
|
2902
|
+
thirdparty/utfcpp/source/,
|
2903
|
+
thirdparty/utfcpp/source/utf8/,
|
2904
|
+
);
|
2905
|
+
MACOSX_DEPLOYMENT_TARGET = 11.1;
|
2894
2906
|
ONLY_ACTIVE_ARCH = YES;
|
2895
2907
|
SDKROOT = macosx;
|
2896
2908
|
};
|
@@ -2901,8 +2913,7 @@
|
|
2901
2913
|
buildSettings = {
|
2902
2914
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
2903
2915
|
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
2904
|
-
CLANG_CXX_LANGUAGE_STANDARD = "c++
|
2905
|
-
CLANG_CXX_LIBRARY = "libc++";
|
2916
|
+
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
|
2906
2917
|
CLANG_ENABLE_OBJC_ARC = YES;
|
2907
2918
|
CLANG_WARN_ASSIGN_ENUM = YES;
|
2908
2919
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
@@ -2917,6 +2928,7 @@
|
|
2917
2928
|
CLANG_WARN_INT_CONVERSION = YES;
|
2918
2929
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
2919
2930
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
2931
|
+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
2920
2932
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
2921
2933
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
2922
2934
|
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
|
@@ -2945,8 +2957,12 @@
|
|
2945
2957
|
GCC_WARN_UNUSED_LABEL = YES;
|
2946
2958
|
GCC_WARN_UNUSED_PARAMETER = YES;
|
2947
2959
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
2948
|
-
HEADER_SEARCH_PATHS =
|
2949
|
-
|
2960
|
+
HEADER_SEARCH_PATHS = (
|
2961
|
+
src/,
|
2962
|
+
thirdparty/utfcpp/source/,
|
2963
|
+
thirdparty/utfcpp/source/utf8/,
|
2964
|
+
);
|
2965
|
+
MACOSX_DEPLOYMENT_TARGET = 11.1;
|
2950
2966
|
SDKROOT = macosx;
|
2951
2967
|
};
|
2952
2968
|
name = Release;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<Scheme
|
3
|
-
LastUpgradeVersion = "
|
3
|
+
LastUpgradeVersion = "1240"
|
4
4
|
version = "1.3">
|
5
5
|
<BuildAction
|
6
6
|
parallelizeBuildables = "YES"
|
@@ -29,8 +29,6 @@
|
|
29
29
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
30
30
|
<Testables>
|
31
31
|
</Testables>
|
32
|
-
<AdditionalOptions>
|
33
|
-
</AdditionalOptions>
|
34
32
|
</TestAction>
|
35
33
|
<LaunchAction
|
36
34
|
buildConfiguration = "Debug"
|
@@ -51,8 +49,6 @@
|
|
51
49
|
ReferencedContainer = "container:antlrcpp.xcodeproj">
|
52
50
|
</BuildableReference>
|
53
51
|
</MacroExpansion>
|
54
|
-
<AdditionalOptions>
|
55
|
-
</AdditionalOptions>
|
56
52
|
</LaunchAction>
|
57
53
|
<ProfileAction
|
58
54
|
buildConfiguration = "Release"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<Scheme
|
3
|
-
LastUpgradeVersion = "
|
3
|
+
LastUpgradeVersion = "1240"
|
4
4
|
version = "1.3">
|
5
5
|
<BuildAction
|
6
6
|
parallelizeBuildables = "YES"
|
@@ -29,8 +29,6 @@
|
|
29
29
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
30
30
|
<Testables>
|
31
31
|
</Testables>
|
32
|
-
<AdditionalOptions>
|
33
|
-
</AdditionalOptions>
|
34
32
|
</TestAction>
|
35
33
|
<LaunchAction
|
36
34
|
buildConfiguration = "Debug"
|
@@ -51,8 +49,6 @@
|
|
51
49
|
ReferencedContainer = "container:antlrcpp.xcodeproj">
|
52
50
|
</BuildableReference>
|
53
51
|
</MacroExpansion>
|
54
|
-
<AdditionalOptions>
|
55
|
-
</AdditionalOptions>
|
56
52
|
</LaunchAction>
|
57
53
|
<ProfileAction
|
58
54
|
buildConfiguration = "Release"
|
@@ -1,30 +1,19 @@
|
|
1
|
-
|
1
|
+
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
2
2
|
* Use of this file is governed by the BSD 3-clause license that
|
3
3
|
* can be found in the LICENSE.txt file in the project root.
|
4
4
|
*/
|
5
5
|
|
6
|
-
#include "support/StringUtils.h"
|
7
|
-
|
8
6
|
#include "ANTLRFileStream.h"
|
9
7
|
|
10
8
|
using namespace antlr4;
|
11
9
|
|
12
|
-
ANTLRFileStream::ANTLRFileStream(const std::string &fileName) {
|
13
|
-
_fileName = fileName;
|
14
|
-
loadFromFile(fileName);
|
15
|
-
}
|
16
|
-
|
17
10
|
void ANTLRFileStream::loadFromFile(const std::string &fileName) {
|
18
11
|
_fileName = fileName;
|
19
12
|
if (_fileName.empty()) {
|
20
13
|
return;
|
21
14
|
}
|
22
15
|
|
23
|
-
#ifdef _MSC_VER
|
24
|
-
std::ifstream stream(antlrcpp::s2ws(fileName), std::ios::binary);
|
25
|
-
#else
|
26
16
|
std::ifstream stream(fileName, std::ios::binary);
|
27
|
-
#endif
|
28
17
|
|
29
18
|
ANTLRInputStream::load(stream);
|
30
19
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
2
2
|
* Use of this file is governed by the BSD 3-clause license that
|
3
3
|
* can be found in the LICENSE.txt file in the project root.
|
4
4
|
*/
|
@@ -13,15 +13,18 @@ namespace antlr4 {
|
|
13
13
|
/// when you construct the object (or call load()).
|
14
14
|
// TODO: this class needs testing.
|
15
15
|
class ANTLR4CPP_PUBLIC ANTLRFileStream : public ANTLRInputStream {
|
16
|
-
protected:
|
17
|
-
std::string _fileName; // UTF-8 encoded file name.
|
18
|
-
|
19
16
|
public:
|
20
|
-
|
21
|
-
ANTLRFileStream(const std::string &
|
17
|
+
ANTLRFileStream() = default;
|
18
|
+
ANTLRFileStream(const std::string &) = delete;
|
19
|
+
ANTLRFileStream(const char *data, size_t length) = delete;
|
20
|
+
ANTLRFileStream(std::istream &stream) = delete;
|
22
21
|
|
22
|
+
// Assumes a file name encoded in UTF-8 and file content in the same encoding (with or w/o BOM).
|
23
23
|
virtual void loadFromFile(const std::string &fileName);
|
24
24
|
virtual std::string getSourceName() const override;
|
25
|
+
|
26
|
+
private:
|
27
|
+
std::string _fileName; // UTF-8 encoded file name.
|
25
28
|
};
|
26
29
|
|
27
30
|
} // namespace antlr4
|
@@ -1,13 +1,15 @@
|
|
1
|
-
|
1
|
+
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
2
2
|
* Use of this file is governed by the BSD 3-clause license that
|
3
3
|
* can be found in the LICENSE.txt file in the project root.
|
4
4
|
*/
|
5
5
|
|
6
|
+
#include <string.h>
|
7
|
+
|
6
8
|
#include "Exceptions.h"
|
7
9
|
#include "misc/Interval.h"
|
8
10
|
#include "IntStream.h"
|
9
11
|
|
10
|
-
#include "support/
|
12
|
+
#include "support/Utf8.h"
|
11
13
|
#include "support/CPPUtils.h"
|
12
14
|
|
13
15
|
#include "ANTLRInputStream.h"
|
@@ -17,38 +19,53 @@ using namespace antlrcpp;
|
|
17
19
|
|
18
20
|
using misc::Interval;
|
19
21
|
|
20
|
-
ANTLRInputStream::ANTLRInputStream(
|
22
|
+
ANTLRInputStream::ANTLRInputStream() {
|
21
23
|
InitializeInstanceFields();
|
22
|
-
load(input);
|
23
24
|
}
|
24
25
|
|
25
|
-
ANTLRInputStream::ANTLRInputStream(
|
26
|
-
|
26
|
+
ANTLRInputStream::ANTLRInputStream(std::string_view input): ANTLRInputStream() {
|
27
|
+
load(input.data(), input.length());
|
27
28
|
}
|
28
29
|
|
29
|
-
ANTLRInputStream::ANTLRInputStream(
|
30
|
-
|
30
|
+
ANTLRInputStream::ANTLRInputStream(const char *data, size_t length) {
|
31
|
+
load(data, length);
|
32
|
+
}
|
33
|
+
|
34
|
+
ANTLRInputStream::ANTLRInputStream(std::istream &stream): ANTLRInputStream() {
|
31
35
|
load(stream);
|
32
36
|
}
|
33
37
|
|
34
|
-
void ANTLRInputStream::load(const std::string &input) {
|
38
|
+
void ANTLRInputStream::load(const std::string &input, bool lenient) {
|
39
|
+
load(input.data(), input.size(), lenient);
|
40
|
+
}
|
41
|
+
|
42
|
+
void ANTLRInputStream::load(const char *data, size_t length, bool lenient) {
|
35
43
|
// Remove the UTF-8 BOM if present.
|
36
|
-
const char bom
|
37
|
-
if (
|
38
|
-
|
39
|
-
|
40
|
-
|
44
|
+
const char *bom = "\xef\xbb\xbf";
|
45
|
+
if (length >= 3 && strncmp(data, bom, 3) == 0) {
|
46
|
+
data += 3;
|
47
|
+
length -= 3;
|
48
|
+
}
|
49
|
+
if (lenient) {
|
50
|
+
_data = Utf8::lenientDecode(std::string_view(data, length));
|
51
|
+
} else {
|
52
|
+
auto maybe_utf32 = Utf8::strictDecode(std::string_view(data, length));
|
53
|
+
if (!maybe_utf32.has_value()) {
|
54
|
+
throw IllegalArgumentException("UTF-8 string contains an illegal byte sequence");
|
55
|
+
}
|
56
|
+
_data = std::move(maybe_utf32).value();
|
57
|
+
}
|
41
58
|
p = 0;
|
42
59
|
}
|
43
60
|
|
44
|
-
void ANTLRInputStream::load(std::istream &stream) {
|
61
|
+
void ANTLRInputStream::load(std::istream &stream, bool lenient) {
|
45
62
|
if (!stream.good() || stream.eof()) // No fail, bad or EOF.
|
46
63
|
return;
|
47
64
|
|
48
65
|
_data.clear();
|
49
66
|
|
50
67
|
std::string s((std::istreambuf_iterator<char>(stream)), std::istreambuf_iterator<char>());
|
51
|
-
load(s);
|
68
|
+
load(s.data(), s.length(), lenient);
|
52
69
|
}
|
53
70
|
|
54
71
|
void ANTLRInputStream::reset() {
|
@@ -136,7 +153,11 @@ std::string ANTLRInputStream::getText(const Interval &interval) {
|
|
136
153
|
return "";
|
137
154
|
}
|
138
155
|
|
139
|
-
|
156
|
+
auto maybeUtf8 = Utf8::strictEncode(std::u32string_view(_data).substr(start, count));
|
157
|
+
if (!maybeUtf8.has_value()) {
|
158
|
+
throw IllegalArgumentException("Input stream contains invalid Unicode code points");
|
159
|
+
}
|
160
|
+
return std::move(maybeUtf8).value();
|
140
161
|
}
|
141
162
|
|
142
163
|
std::string ANTLRInputStream::getSourceName() const {
|
@@ -147,7 +168,11 @@ std::string ANTLRInputStream::getSourceName() const {
|
|
147
168
|
}
|
148
169
|
|
149
170
|
std::string ANTLRInputStream::toString() const {
|
150
|
-
|
171
|
+
auto maybeUtf8 = Utf8::strictEncode(_data);
|
172
|
+
if (!maybeUtf8.has_value()) {
|
173
|
+
throw IllegalArgumentException("Input stream contains invalid Unicode code points");
|
174
|
+
}
|
175
|
+
return std::move(maybeUtf8).value();
|
151
176
|
}
|
152
177
|
|
153
178
|
void ANTLRInputStream::InitializeInstanceFields() {
|
@@ -1,10 +1,12 @@
|
|
1
|
-
|
1
|
+
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
2
2
|
* Use of this file is governed by the BSD 3-clause license that
|
3
3
|
* can be found in the LICENSE.txt file in the project root.
|
4
4
|
*/
|
5
5
|
|
6
6
|
#pragma once
|
7
7
|
|
8
|
+
#include <string_view>
|
9
|
+
|
8
10
|
#include "CharStream.h"
|
9
11
|
|
10
12
|
namespace antlr4 {
|
@@ -16,7 +18,7 @@ namespace antlr4 {
|
|
16
18
|
protected:
|
17
19
|
/// The data being scanned.
|
18
20
|
// UTF-32
|
19
|
-
|
21
|
+
std::u32string _data;
|
20
22
|
|
21
23
|
/// 0..n-1 index into string of next char </summary>
|
22
24
|
size_t p;
|
@@ -25,12 +27,20 @@ namespace antlr4 {
|
|
25
27
|
/// What is name or source of this char stream?
|
26
28
|
std::string name;
|
27
29
|
|
28
|
-
ANTLRInputStream(
|
29
|
-
|
30
|
+
ANTLRInputStream();
|
31
|
+
|
32
|
+
ANTLRInputStream(std::string_view input);
|
33
|
+
|
34
|
+
ANTLRInputStream(const char *data, size_t length);
|
30
35
|
ANTLRInputStream(std::istream &stream);
|
31
36
|
|
32
|
-
virtual void load(const std::string &input);
|
33
|
-
virtual void load(
|
37
|
+
virtual void load(const std::string &input, bool lenient);
|
38
|
+
virtual void load(const char *data, size_t length, bool lenient);
|
39
|
+
virtual void load(std::istream &stream, bool lenient);
|
40
|
+
|
41
|
+
virtual void load(const std::string &input) { load(input, false); }
|
42
|
+
virtual void load(const char *data, size_t length) { load(data, length, false); }
|
43
|
+
virtual void load(std::istream &stream) { load(stream, false); }
|
34
44
|
|
35
45
|
/// Reset the stream so that it's in the same state it was
|
36
46
|
/// when the object was created *except* the data array is not
|
@@ -10,8 +10,8 @@
|
|
10
10
|
|
11
11
|
#include "misc/Interval.h"
|
12
12
|
|
13
|
-
#include "support/StringUtils.h"
|
14
13
|
#include "support/CPPUtils.h"
|
14
|
+
#include "support/StringUtils.h"
|
15
15
|
|
16
16
|
#include "CommonToken.h"
|
17
17
|
|
@@ -165,9 +165,7 @@ std::string CommonToken::toString(Recognizer *r) const {
|
|
165
165
|
}
|
166
166
|
std::string txt = getText();
|
167
167
|
if (!txt.empty()) {
|
168
|
-
antlrcpp::
|
169
|
-
antlrcpp::replaceAll(txt, "\r", "\\r");
|
170
|
-
antlrcpp::replaceAll(txt, "\t", "\\t");
|
168
|
+
txt = antlrcpp::escapeWhitespace(txt);
|
171
169
|
} else {
|
172
170
|
txt = "<no text>";
|
173
171
|
}
|
@@ -11,7 +11,7 @@
|
|
11
11
|
|
12
12
|
using namespace antlr4;
|
13
13
|
|
14
|
-
const
|
14
|
+
const std::unique_ptr<TokenFactory<CommonToken>> CommonTokenFactory::DEFAULT(new CommonTokenFactory);
|
15
15
|
|
16
16
|
CommonTokenFactory::CommonTokenFactory(bool copyText_) : copyText(copyText_) {
|
17
17
|
}
|
@@ -22,7 +22,7 @@ namespace antlr4 {
|
|
22
22
|
* This token factory does not explicitly copy token text when constructing
|
23
23
|
* tokens.</p>
|
24
24
|
*/
|
25
|
-
static const
|
25
|
+
static const std::unique_ptr<TokenFactory<CommonToken>> DEFAULT;
|
26
26
|
|
27
27
|
protected:
|
28
28
|
/**
|