From d81fa3312871851f8d894c486453a50ba922eee7 Mon Sep 17 00:00:00 2001 From: Terence Parr Date: Tue, 30 Jun 2015 14:25:12 -0700 Subject: [PATCH] mv files into proper position for folding into main antlr4 repo; delete already moved stuff --- .gitignore | 6 - LICENSE.txt => runtime/Python3/LICENSE.txt | 0 MANIFEST => runtime/Python3/MANIFEST | 0 MANIFEST.in => runtime/Python3/MANIFEST.in | 0 README.txt => runtime/Python3/README.txt | 0 .../Python3/RELEASE-4.5.txt | 0 {bin => runtime/Python3/bin}/pygrun | 0 {bin => runtime/Python3/bin}/pygrun.bat | 0 setup.py => runtime/Python3/setup.py | 0 .../src}/antlr4/BufferedTokenStream.py | 0 .../Python3/src}/antlr4/CommonTokenFactory.py | 0 .../Python3/src}/antlr4/CommonTokenStream.py | 0 .../Python3/src}/antlr4/FileStream.py | 0 .../Python3/src}/antlr4/InputStream.py | 0 .../Python3/src}/antlr4/IntervalSet.py | 0 .../Python3/src}/antlr4/LL1Analyzer.py | 0 {src => runtime/Python3/src}/antlr4/Lexer.py | 0 .../Python3/src}/antlr4/ListTokenSource.py | 0 {src => runtime/Python3/src}/antlr4/Parser.py | 0 .../Python3/src}/antlr4/ParserInterpreter.py | 0 .../Python3/src}/antlr4/ParserRuleContext.py | 0 .../Python3/src}/antlr4/PredictionContext.py | 0 .../Python3/src}/antlr4/Recognizer.py | 0 .../Python3/src}/antlr4/RuleContext.py | 0 {src => runtime/Python3/src}/antlr4/Token.py | 0 {src => runtime/Python3/src}/antlr4/Utils.py | 0 .../Python3/src}/antlr4/__init__.py | 0 .../Python3/src}/antlr4/atn/ATN.py | 0 .../Python3/src}/antlr4/atn/ATNConfig.py | 0 .../Python3/src}/antlr4/atn/ATNConfigSet.py | 0 .../antlr4/atn/ATNDeserializationOptions.py | 0 .../src}/antlr4/atn/ATNDeserializer.py | 0 .../Python3/src}/antlr4/atn/ATNSimulator.py | 0 .../Python3/src}/antlr4/atn/ATNState.py | 0 .../Python3/src}/antlr4/atn/ATNType.py | 0 .../src}/antlr4/atn/LexerATNSimulator.py | 0 .../Python3/src}/antlr4/atn/LexerAction.py | 0 .../src}/antlr4/atn/LexerActionExecutor.py | 0 .../src}/antlr4/atn/ParserATNSimulator.py | 0 .../Python3/src}/antlr4/atn/PredictionMode.py | 0 .../src}/antlr4/atn/SemanticContext.py | 0 .../Python3/src}/antlr4/atn/Transition.py | 0 .../Python3/src}/antlr4/atn/__init__.py | 0 .../Python3/src}/antlr4/dfa/DFA.py | 0 .../Python3/src}/antlr4/dfa/DFASerializer.py | 0 .../Python3/src}/antlr4/dfa/DFAState.py | 0 .../Python3/src}/antlr4/dfa/__init__.py | 0 .../antlr4/error/DiagnosticErrorListener.py | 0 .../src}/antlr4/error/ErrorListener.py | 0 .../src}/antlr4/error/ErrorStrategy.py | 0 .../Python3/src}/antlr4/error/Errors.py | 0 .../Python3/src}/antlr4/error/__init__.py | 0 .../Python3/src}/antlr4/tree/Chunk.py | 0 .../src}/antlr4/tree/ParseTreeMatch.py | 0 .../src}/antlr4/tree/ParseTreePattern.py | 0 .../antlr4/tree/ParseTreePatternMatcher.py | 0 .../Python3/src}/antlr4/tree/RuleTagToken.py | 0 .../Python3/src}/antlr4/tree/TokenTagToken.py | 0 .../Python3/src}/antlr4/tree/Tree.py | 0 .../Python3/src}/antlr4/tree/Trees.py | 0 .../Python3/src}/antlr4/tree/__init__.py | 0 .../Python3/src}/antlr4/xpath/XPath.py | 0 .../Python3/src}/antlr4/xpath/__init__.py | 0 .../src}/test/TestAtomicPerformance.py | 0 .../Python3/src}/test/TestXPath.py | 0 .../templates/codegen/Python3/Python3.stg | 810 ------------- .../org/antlr/v4/codegen/Python3Target.java | 141 --- .../test/runtime/python/BasePythonTest.java | 1071 ----------------- .../test/runtime/python3/BasePython3Test.java | 122 -- .../v4/test/runtime/python3/Python3.test.stg | 381 ------ 70 files changed, 2531 deletions(-) delete mode 100644 .gitignore rename LICENSE.txt => runtime/Python3/LICENSE.txt (100%) rename MANIFEST => runtime/Python3/MANIFEST (100%) rename MANIFEST.in => runtime/Python3/MANIFEST.in (100%) rename README.txt => runtime/Python3/README.txt (100%) rename RELEASE-4.5.txt => runtime/Python3/RELEASE-4.5.txt (100%) rename {bin => runtime/Python3/bin}/pygrun (100%) rename {bin => runtime/Python3/bin}/pygrun.bat (100%) rename setup.py => runtime/Python3/setup.py (100%) rename {src => runtime/Python3/src}/antlr4/BufferedTokenStream.py (100%) rename {src => runtime/Python3/src}/antlr4/CommonTokenFactory.py (100%) rename {src => runtime/Python3/src}/antlr4/CommonTokenStream.py (100%) rename {src => runtime/Python3/src}/antlr4/FileStream.py (100%) rename {src => runtime/Python3/src}/antlr4/InputStream.py (100%) rename {src => runtime/Python3/src}/antlr4/IntervalSet.py (100%) rename {src => runtime/Python3/src}/antlr4/LL1Analyzer.py (100%) rename {src => runtime/Python3/src}/antlr4/Lexer.py (100%) rename {src => runtime/Python3/src}/antlr4/ListTokenSource.py (100%) rename {src => runtime/Python3/src}/antlr4/Parser.py (100%) rename {src => runtime/Python3/src}/antlr4/ParserInterpreter.py (100%) rename {src => runtime/Python3/src}/antlr4/ParserRuleContext.py (100%) rename {src => runtime/Python3/src}/antlr4/PredictionContext.py (100%) rename {src => runtime/Python3/src}/antlr4/Recognizer.py (100%) rename {src => runtime/Python3/src}/antlr4/RuleContext.py (100%) rename {src => runtime/Python3/src}/antlr4/Token.py (100%) rename {src => runtime/Python3/src}/antlr4/Utils.py (100%) rename {src => runtime/Python3/src}/antlr4/__init__.py (100%) rename {src => runtime/Python3/src}/antlr4/atn/ATN.py (100%) rename {src => runtime/Python3/src}/antlr4/atn/ATNConfig.py (100%) rename {src => runtime/Python3/src}/antlr4/atn/ATNConfigSet.py (100%) rename {src => runtime/Python3/src}/antlr4/atn/ATNDeserializationOptions.py (100%) rename {src => runtime/Python3/src}/antlr4/atn/ATNDeserializer.py (100%) rename {src => runtime/Python3/src}/antlr4/atn/ATNSimulator.py (100%) rename {src => runtime/Python3/src}/antlr4/atn/ATNState.py (100%) rename {src => runtime/Python3/src}/antlr4/atn/ATNType.py (100%) rename {src => runtime/Python3/src}/antlr4/atn/LexerATNSimulator.py (100%) rename {src => runtime/Python3/src}/antlr4/atn/LexerAction.py (100%) rename {src => runtime/Python3/src}/antlr4/atn/LexerActionExecutor.py (100%) rename {src => runtime/Python3/src}/antlr4/atn/ParserATNSimulator.py (100%) rename {src => runtime/Python3/src}/antlr4/atn/PredictionMode.py (100%) rename {src => runtime/Python3/src}/antlr4/atn/SemanticContext.py (100%) rename {src => runtime/Python3/src}/antlr4/atn/Transition.py (100%) rename {src => runtime/Python3/src}/antlr4/atn/__init__.py (100%) rename {src => runtime/Python3/src}/antlr4/dfa/DFA.py (100%) rename {src => runtime/Python3/src}/antlr4/dfa/DFASerializer.py (100%) rename {src => runtime/Python3/src}/antlr4/dfa/DFAState.py (100%) rename {src => runtime/Python3/src}/antlr4/dfa/__init__.py (100%) rename {src => runtime/Python3/src}/antlr4/error/DiagnosticErrorListener.py (100%) rename {src => runtime/Python3/src}/antlr4/error/ErrorListener.py (100%) rename {src => runtime/Python3/src}/antlr4/error/ErrorStrategy.py (100%) rename {src => runtime/Python3/src}/antlr4/error/Errors.py (100%) rename {src => runtime/Python3/src}/antlr4/error/__init__.py (100%) rename {src => runtime/Python3/src}/antlr4/tree/Chunk.py (100%) rename {src => runtime/Python3/src}/antlr4/tree/ParseTreeMatch.py (100%) rename {src => runtime/Python3/src}/antlr4/tree/ParseTreePattern.py (100%) rename {src => runtime/Python3/src}/antlr4/tree/ParseTreePatternMatcher.py (100%) rename {src => runtime/Python3/src}/antlr4/tree/RuleTagToken.py (100%) rename {src => runtime/Python3/src}/antlr4/tree/TokenTagToken.py (100%) rename {src => runtime/Python3/src}/antlr4/tree/Tree.py (100%) rename {src => runtime/Python3/src}/antlr4/tree/Trees.py (100%) rename {src => runtime/Python3/src}/antlr4/tree/__init__.py (100%) rename {src => runtime/Python3/src}/antlr4/xpath/XPath.py (100%) rename {src => runtime/Python3/src}/antlr4/xpath/__init__.py (100%) rename {src => runtime/Python3/src}/test/TestAtomicPerformance.py (100%) rename {src => runtime/Python3/src}/test/TestXPath.py (100%) delete mode 100644 tool/resources/org/antlr/v4/tool/templates/codegen/Python3/Python3.stg delete mode 100644 tool/src/org/antlr/v4/codegen/Python3Target.java delete mode 100644 tool/test/org/antlr/v4/test/runtime/python/BasePythonTest.java delete mode 100644 tool/test/org/antlr/v4/test/runtime/python3/BasePython3Test.java delete mode 100644 tool/test/org/antlr/v4/test/runtime/python3/Python3.test.stg diff --git a/.gitignore b/.gitignore deleted file mode 100644 index b31adb41f..000000000 --- a/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/.idea -*.pyc -__pycache__ -src/TestAntLR.py -/dist -.DS_Store \ No newline at end of file diff --git a/LICENSE.txt b/runtime/Python3/LICENSE.txt similarity index 100% rename from LICENSE.txt rename to runtime/Python3/LICENSE.txt diff --git a/MANIFEST b/runtime/Python3/MANIFEST similarity index 100% rename from MANIFEST rename to runtime/Python3/MANIFEST diff --git a/MANIFEST.in b/runtime/Python3/MANIFEST.in similarity index 100% rename from MANIFEST.in rename to runtime/Python3/MANIFEST.in diff --git a/README.txt b/runtime/Python3/README.txt similarity index 100% rename from README.txt rename to runtime/Python3/README.txt diff --git a/RELEASE-4.5.txt b/runtime/Python3/RELEASE-4.5.txt similarity index 100% rename from RELEASE-4.5.txt rename to runtime/Python3/RELEASE-4.5.txt diff --git a/bin/pygrun b/runtime/Python3/bin/pygrun similarity index 100% rename from bin/pygrun rename to runtime/Python3/bin/pygrun diff --git a/bin/pygrun.bat b/runtime/Python3/bin/pygrun.bat similarity index 100% rename from bin/pygrun.bat rename to runtime/Python3/bin/pygrun.bat diff --git a/setup.py b/runtime/Python3/setup.py similarity index 100% rename from setup.py rename to runtime/Python3/setup.py diff --git a/src/antlr4/BufferedTokenStream.py b/runtime/Python3/src/antlr4/BufferedTokenStream.py similarity index 100% rename from src/antlr4/BufferedTokenStream.py rename to runtime/Python3/src/antlr4/BufferedTokenStream.py diff --git a/src/antlr4/CommonTokenFactory.py b/runtime/Python3/src/antlr4/CommonTokenFactory.py similarity index 100% rename from src/antlr4/CommonTokenFactory.py rename to runtime/Python3/src/antlr4/CommonTokenFactory.py diff --git a/src/antlr4/CommonTokenStream.py b/runtime/Python3/src/antlr4/CommonTokenStream.py similarity index 100% rename from src/antlr4/CommonTokenStream.py rename to runtime/Python3/src/antlr4/CommonTokenStream.py diff --git a/src/antlr4/FileStream.py b/runtime/Python3/src/antlr4/FileStream.py similarity index 100% rename from src/antlr4/FileStream.py rename to runtime/Python3/src/antlr4/FileStream.py diff --git a/src/antlr4/InputStream.py b/runtime/Python3/src/antlr4/InputStream.py similarity index 100% rename from src/antlr4/InputStream.py rename to runtime/Python3/src/antlr4/InputStream.py diff --git a/src/antlr4/IntervalSet.py b/runtime/Python3/src/antlr4/IntervalSet.py similarity index 100% rename from src/antlr4/IntervalSet.py rename to runtime/Python3/src/antlr4/IntervalSet.py diff --git a/src/antlr4/LL1Analyzer.py b/runtime/Python3/src/antlr4/LL1Analyzer.py similarity index 100% rename from src/antlr4/LL1Analyzer.py rename to runtime/Python3/src/antlr4/LL1Analyzer.py diff --git a/src/antlr4/Lexer.py b/runtime/Python3/src/antlr4/Lexer.py similarity index 100% rename from src/antlr4/Lexer.py rename to runtime/Python3/src/antlr4/Lexer.py diff --git a/src/antlr4/ListTokenSource.py b/runtime/Python3/src/antlr4/ListTokenSource.py similarity index 100% rename from src/antlr4/ListTokenSource.py rename to runtime/Python3/src/antlr4/ListTokenSource.py diff --git a/src/antlr4/Parser.py b/runtime/Python3/src/antlr4/Parser.py similarity index 100% rename from src/antlr4/Parser.py rename to runtime/Python3/src/antlr4/Parser.py diff --git a/src/antlr4/ParserInterpreter.py b/runtime/Python3/src/antlr4/ParserInterpreter.py similarity index 100% rename from src/antlr4/ParserInterpreter.py rename to runtime/Python3/src/antlr4/ParserInterpreter.py diff --git a/src/antlr4/ParserRuleContext.py b/runtime/Python3/src/antlr4/ParserRuleContext.py similarity index 100% rename from src/antlr4/ParserRuleContext.py rename to runtime/Python3/src/antlr4/ParserRuleContext.py diff --git a/src/antlr4/PredictionContext.py b/runtime/Python3/src/antlr4/PredictionContext.py similarity index 100% rename from src/antlr4/PredictionContext.py rename to runtime/Python3/src/antlr4/PredictionContext.py diff --git a/src/antlr4/Recognizer.py b/runtime/Python3/src/antlr4/Recognizer.py similarity index 100% rename from src/antlr4/Recognizer.py rename to runtime/Python3/src/antlr4/Recognizer.py diff --git a/src/antlr4/RuleContext.py b/runtime/Python3/src/antlr4/RuleContext.py similarity index 100% rename from src/antlr4/RuleContext.py rename to runtime/Python3/src/antlr4/RuleContext.py diff --git a/src/antlr4/Token.py b/runtime/Python3/src/antlr4/Token.py similarity index 100% rename from src/antlr4/Token.py rename to runtime/Python3/src/antlr4/Token.py diff --git a/src/antlr4/Utils.py b/runtime/Python3/src/antlr4/Utils.py similarity index 100% rename from src/antlr4/Utils.py rename to runtime/Python3/src/antlr4/Utils.py diff --git a/src/antlr4/__init__.py b/runtime/Python3/src/antlr4/__init__.py similarity index 100% rename from src/antlr4/__init__.py rename to runtime/Python3/src/antlr4/__init__.py diff --git a/src/antlr4/atn/ATN.py b/runtime/Python3/src/antlr4/atn/ATN.py similarity index 100% rename from src/antlr4/atn/ATN.py rename to runtime/Python3/src/antlr4/atn/ATN.py diff --git a/src/antlr4/atn/ATNConfig.py b/runtime/Python3/src/antlr4/atn/ATNConfig.py similarity index 100% rename from src/antlr4/atn/ATNConfig.py rename to runtime/Python3/src/antlr4/atn/ATNConfig.py diff --git a/src/antlr4/atn/ATNConfigSet.py b/runtime/Python3/src/antlr4/atn/ATNConfigSet.py similarity index 100% rename from src/antlr4/atn/ATNConfigSet.py rename to runtime/Python3/src/antlr4/atn/ATNConfigSet.py diff --git a/src/antlr4/atn/ATNDeserializationOptions.py b/runtime/Python3/src/antlr4/atn/ATNDeserializationOptions.py similarity index 100% rename from src/antlr4/atn/ATNDeserializationOptions.py rename to runtime/Python3/src/antlr4/atn/ATNDeserializationOptions.py diff --git a/src/antlr4/atn/ATNDeserializer.py b/runtime/Python3/src/antlr4/atn/ATNDeserializer.py similarity index 100% rename from src/antlr4/atn/ATNDeserializer.py rename to runtime/Python3/src/antlr4/atn/ATNDeserializer.py diff --git a/src/antlr4/atn/ATNSimulator.py b/runtime/Python3/src/antlr4/atn/ATNSimulator.py similarity index 100% rename from src/antlr4/atn/ATNSimulator.py rename to runtime/Python3/src/antlr4/atn/ATNSimulator.py diff --git a/src/antlr4/atn/ATNState.py b/runtime/Python3/src/antlr4/atn/ATNState.py similarity index 100% rename from src/antlr4/atn/ATNState.py rename to runtime/Python3/src/antlr4/atn/ATNState.py diff --git a/src/antlr4/atn/ATNType.py b/runtime/Python3/src/antlr4/atn/ATNType.py similarity index 100% rename from src/antlr4/atn/ATNType.py rename to runtime/Python3/src/antlr4/atn/ATNType.py diff --git a/src/antlr4/atn/LexerATNSimulator.py b/runtime/Python3/src/antlr4/atn/LexerATNSimulator.py similarity index 100% rename from src/antlr4/atn/LexerATNSimulator.py rename to runtime/Python3/src/antlr4/atn/LexerATNSimulator.py diff --git a/src/antlr4/atn/LexerAction.py b/runtime/Python3/src/antlr4/atn/LexerAction.py similarity index 100% rename from src/antlr4/atn/LexerAction.py rename to runtime/Python3/src/antlr4/atn/LexerAction.py diff --git a/src/antlr4/atn/LexerActionExecutor.py b/runtime/Python3/src/antlr4/atn/LexerActionExecutor.py similarity index 100% rename from src/antlr4/atn/LexerActionExecutor.py rename to runtime/Python3/src/antlr4/atn/LexerActionExecutor.py diff --git a/src/antlr4/atn/ParserATNSimulator.py b/runtime/Python3/src/antlr4/atn/ParserATNSimulator.py similarity index 100% rename from src/antlr4/atn/ParserATNSimulator.py rename to runtime/Python3/src/antlr4/atn/ParserATNSimulator.py diff --git a/src/antlr4/atn/PredictionMode.py b/runtime/Python3/src/antlr4/atn/PredictionMode.py similarity index 100% rename from src/antlr4/atn/PredictionMode.py rename to runtime/Python3/src/antlr4/atn/PredictionMode.py diff --git a/src/antlr4/atn/SemanticContext.py b/runtime/Python3/src/antlr4/atn/SemanticContext.py similarity index 100% rename from src/antlr4/atn/SemanticContext.py rename to runtime/Python3/src/antlr4/atn/SemanticContext.py diff --git a/src/antlr4/atn/Transition.py b/runtime/Python3/src/antlr4/atn/Transition.py similarity index 100% rename from src/antlr4/atn/Transition.py rename to runtime/Python3/src/antlr4/atn/Transition.py diff --git a/src/antlr4/atn/__init__.py b/runtime/Python3/src/antlr4/atn/__init__.py similarity index 100% rename from src/antlr4/atn/__init__.py rename to runtime/Python3/src/antlr4/atn/__init__.py diff --git a/src/antlr4/dfa/DFA.py b/runtime/Python3/src/antlr4/dfa/DFA.py similarity index 100% rename from src/antlr4/dfa/DFA.py rename to runtime/Python3/src/antlr4/dfa/DFA.py diff --git a/src/antlr4/dfa/DFASerializer.py b/runtime/Python3/src/antlr4/dfa/DFASerializer.py similarity index 100% rename from src/antlr4/dfa/DFASerializer.py rename to runtime/Python3/src/antlr4/dfa/DFASerializer.py diff --git a/src/antlr4/dfa/DFAState.py b/runtime/Python3/src/antlr4/dfa/DFAState.py similarity index 100% rename from src/antlr4/dfa/DFAState.py rename to runtime/Python3/src/antlr4/dfa/DFAState.py diff --git a/src/antlr4/dfa/__init__.py b/runtime/Python3/src/antlr4/dfa/__init__.py similarity index 100% rename from src/antlr4/dfa/__init__.py rename to runtime/Python3/src/antlr4/dfa/__init__.py diff --git a/src/antlr4/error/DiagnosticErrorListener.py b/runtime/Python3/src/antlr4/error/DiagnosticErrorListener.py similarity index 100% rename from src/antlr4/error/DiagnosticErrorListener.py rename to runtime/Python3/src/antlr4/error/DiagnosticErrorListener.py diff --git a/src/antlr4/error/ErrorListener.py b/runtime/Python3/src/antlr4/error/ErrorListener.py similarity index 100% rename from src/antlr4/error/ErrorListener.py rename to runtime/Python3/src/antlr4/error/ErrorListener.py diff --git a/src/antlr4/error/ErrorStrategy.py b/runtime/Python3/src/antlr4/error/ErrorStrategy.py similarity index 100% rename from src/antlr4/error/ErrorStrategy.py rename to runtime/Python3/src/antlr4/error/ErrorStrategy.py diff --git a/src/antlr4/error/Errors.py b/runtime/Python3/src/antlr4/error/Errors.py similarity index 100% rename from src/antlr4/error/Errors.py rename to runtime/Python3/src/antlr4/error/Errors.py diff --git a/src/antlr4/error/__init__.py b/runtime/Python3/src/antlr4/error/__init__.py similarity index 100% rename from src/antlr4/error/__init__.py rename to runtime/Python3/src/antlr4/error/__init__.py diff --git a/src/antlr4/tree/Chunk.py b/runtime/Python3/src/antlr4/tree/Chunk.py similarity index 100% rename from src/antlr4/tree/Chunk.py rename to runtime/Python3/src/antlr4/tree/Chunk.py diff --git a/src/antlr4/tree/ParseTreeMatch.py b/runtime/Python3/src/antlr4/tree/ParseTreeMatch.py similarity index 100% rename from src/antlr4/tree/ParseTreeMatch.py rename to runtime/Python3/src/antlr4/tree/ParseTreeMatch.py diff --git a/src/antlr4/tree/ParseTreePattern.py b/runtime/Python3/src/antlr4/tree/ParseTreePattern.py similarity index 100% rename from src/antlr4/tree/ParseTreePattern.py rename to runtime/Python3/src/antlr4/tree/ParseTreePattern.py diff --git a/src/antlr4/tree/ParseTreePatternMatcher.py b/runtime/Python3/src/antlr4/tree/ParseTreePatternMatcher.py similarity index 100% rename from src/antlr4/tree/ParseTreePatternMatcher.py rename to runtime/Python3/src/antlr4/tree/ParseTreePatternMatcher.py diff --git a/src/antlr4/tree/RuleTagToken.py b/runtime/Python3/src/antlr4/tree/RuleTagToken.py similarity index 100% rename from src/antlr4/tree/RuleTagToken.py rename to runtime/Python3/src/antlr4/tree/RuleTagToken.py diff --git a/src/antlr4/tree/TokenTagToken.py b/runtime/Python3/src/antlr4/tree/TokenTagToken.py similarity index 100% rename from src/antlr4/tree/TokenTagToken.py rename to runtime/Python3/src/antlr4/tree/TokenTagToken.py diff --git a/src/antlr4/tree/Tree.py b/runtime/Python3/src/antlr4/tree/Tree.py similarity index 100% rename from src/antlr4/tree/Tree.py rename to runtime/Python3/src/antlr4/tree/Tree.py diff --git a/src/antlr4/tree/Trees.py b/runtime/Python3/src/antlr4/tree/Trees.py similarity index 100% rename from src/antlr4/tree/Trees.py rename to runtime/Python3/src/antlr4/tree/Trees.py diff --git a/src/antlr4/tree/__init__.py b/runtime/Python3/src/antlr4/tree/__init__.py similarity index 100% rename from src/antlr4/tree/__init__.py rename to runtime/Python3/src/antlr4/tree/__init__.py diff --git a/src/antlr4/xpath/XPath.py b/runtime/Python3/src/antlr4/xpath/XPath.py similarity index 100% rename from src/antlr4/xpath/XPath.py rename to runtime/Python3/src/antlr4/xpath/XPath.py diff --git a/src/antlr4/xpath/__init__.py b/runtime/Python3/src/antlr4/xpath/__init__.py similarity index 100% rename from src/antlr4/xpath/__init__.py rename to runtime/Python3/src/antlr4/xpath/__init__.py diff --git a/src/test/TestAtomicPerformance.py b/runtime/Python3/src/test/TestAtomicPerformance.py similarity index 100% rename from src/test/TestAtomicPerformance.py rename to runtime/Python3/src/test/TestAtomicPerformance.py diff --git a/src/test/TestXPath.py b/runtime/Python3/src/test/TestXPath.py similarity index 100% rename from src/test/TestXPath.py rename to runtime/Python3/src/test/TestXPath.py diff --git a/tool/resources/org/antlr/v4/tool/templates/codegen/Python3/Python3.stg b/tool/resources/org/antlr/v4/tool/templates/codegen/Python3/Python3.stg deleted file mode 100644 index 4ba1e385b..000000000 --- a/tool/resources/org/antlr/v4/tool/templates/codegen/Python3/Python3.stg +++ /dev/null @@ -1,810 +0,0 @@ -/* - * [The "BSD license"] - * Copyright (c) 2012 Terence Parr - * Copyright (c) 2012 Sam Harwell - * Copyright (c) 2014 Eric Vergnaud - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** ANTLR tool checks output templates are compatible with tool code generation. - * For now, a simple string match used on x.y of x.y.z scheme. - * Must match Tool.VERSION during load to templates. - * - * REQUIRED. - */ - -pythonTypeInitMap ::= [ - "bool":"False", - "int":"0", - "float":"0.0", - "str":"", - default:"None" // anything other than a primitive type is an object -] - -// args must be , - -ParserFile(file, parser, namedActions) ::= << - -# encoding: utf-8 -from antlr4 import * -from io import StringIO - - - - ->> - -ListenerFile(file, header) ::= << - -from antlr4 import * -if __name__ is not None and "." in __name__: - from . import -else: - from import -
- -# This class defines a complete listener for a parse tree produced by . -class Listener(ParseTreeListener): - - #. -def enter(self, ctx:.Context): - pass - -# Exit a parse tree produced by #. -def exit(self, ctx:.Context): - pass - -}; separator="\n"> - ->> - - -VisitorFile(file, header) ::= << - -from antlr4 import * -if __name__ is not None and "." in __name__: - from . import -else: - from import -
- -# This class defines a complete generic visitor for a parse tree produced by . - -class Visitor(ParseTreeVisitor): - - #. -def visit(self, ctx:.Context): - return self.visitChildren(ctx) - -}; separator="\n"> - -del ->> - - -fileHeader(grammarFileName, ANTLRVersion) ::= << -# Generated from by ANTLR ->> - -Parser(parser, funcs, atn, sempredFuncs, superClass) ::= << - ->> - -Parser_(parser, funcs, atn, sempredFuncs, ctor, superClass) ::= << - -from . import - - - - -class ( Parser ): - - grammarFileName = "" - - atn = ATNDeserializer().deserialize(serializedATN()) - - decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ] - - sharedContextCache = PredictionContextCache() - - literalNames = [ }; null="\"\\"", separator=", ", wrap, anchor> ] - - symbolicNames = [ }; null="\"\\"", separator=", ", wrap, anchor> ] - - = }; separator="\n", wrap, anchor> - - ruleNames = [ "}; separator=", ", wrap, anchor> ] - - EOF = .EOF - - =}; separator="\n", wrap, anchor> - - - - - - - - - - - def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int): - if self._predicates == None: - self._predicates = dict() -] = self._sempred}; separator="\n "> - pred = self._predicates.get(ruleIndex, None) - if pred is None: - raise Exception("No predicate with index:" + str(ruleIndex)) - else: - return pred(localctx, predIndex) - - - - - - ->> - -dumpActions(recog, argFuncs, actionFuncs, sempredFuncs) ::= << - -def action(self, localctx:RuleContext, ruleIndex:int, actionIndex:int): - if self._actions is None: - actions = dict() -] = self._action }; separator="\n"> - self._actions = actions - action = self._actions.get(ruleIndex, None) - if action is not None: - action(localctx, actionIndex) - else: - raise Exception("No registered action for:" + str(ruleIndex)) - - - - - -def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int): - if self._predicates is None: - preds = dict() -] = self._sempred}; separator="\n"> - self._predicates = preds - pred = self._predicates.get(ruleIndex, None) - if pred is not None: - return pred(localctx, predIndex) - else: - raise Exception("No registered predicate for:" + str(ruleIndex)) - - - ->> - -parser_ctor(p) ::= << -def __init__(self, input:TokenStream): - super().__init__(input) - self.checkVersion("") - self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache) - self._predicates = None - ->> - -/* This generates a private method since the actionIndex is generated, making an - * overriding implementation impossible to maintain. - */ -RuleActionFunction(r, actions) ::= << - -def _action(self, localctx: , actionIndex:int): - - if actionIndex == : - - - elif actionIndex == : - - }; separator="\n"> ->> - -/* This generates a private method since the predIndex is generated, making an - * overriding implementation impossible to maintain. - */ -RuleSempredFunction(r, actions) ::= << -def _sempred(self, localctx:, predIndex:int): - - if predIndex == : - return - - elif predIndex == : - return - }; separator="\n"> - ->> - -RuleFunction(currentRule,args,code,locals,ruleCtx,altLabelCtxs,namedActions,finallyAction,postamble,exceptions) ::= << - - - -}; separator="\n"> - -def (self:}>): - - localctx = .(self, self._ctx, self.state}>) - self.enterRule(localctx, , self.RULE_) - - - try: - - - - - - - except RecognitionException as re: - localctx.exception = re - self._errHandler.reportError(self, re) - self._errHandler.recover(self, re) - - finally: - - self.exitRule() - return localctx - ->> - -LeftRecursiveRuleFunction(currentRule,args,code,locals,ruleCtx,altLabelCtxs, - namedActions,finallyAction,postamble) ::= -<< - - -}; separator="\n"> - -def (self, _p:int=0, }>): - _parentctx = self._ctx - _parentState = self.state - localctx = .(self, self._ctx, _parentState}>) - _prevctx = localctx - _startState = - self.enterRecursionRule(localctx, , self.RULE_, _p) - - - try: - - - - except RecognitionException as re: - localctx.exception = re - self._errHandler.reportError(self, re) - self._errHandler.recover(self, re) - finally: - - self.unrollRecursionContexts(_parentctx) - return localctx - ->> - -CodeBlockForOuterMostAlt(currentOuterMostAltCodeBlock, locals, preamble, ops) ::= << -localctx = .Context(self, localctx) -self.enterOuterAlt(localctx, ) - ->> - -CodeBlockForAlt(currentAltCodeBlock, locals, preamble, ops) ::= << - - - ->> - -LL1AltBlock(choice, preamble, alts, error) ::= << -self.state = - - = _input.LT(1) - -token = self._input.LA(1) - - - }; separator="\nel"> -else: - - ->> - -LL1OptionalBlock(choice, alts, error) ::= << -self.state = - -token = self._input.LA(1) - - - pass}; separator="\nel"> -else: - ->> - -LL1OptionalBlockSingleAlt(choice, expr, alts, preamble, error, followExpr) ::= << -self.state = - - -if : - - -) ) !> ->> - - -LL1StarBlockSingleAlt(choice, loopExpr, alts, preamble, iteration) ::= << -self.state = -self._errHandler.sync(self) - -while : - - self.state = - self._errHandler.sync(self) - - ->> - -LL1PlusBlockSingleAlt(choice, loopExpr, alts, preamble, iteration) ::= << -self.state = -self._errHandler.sync(self) - -while True: - - self.state = - self._errHandler.sync(self) - - if not (): - break - ->> - -// LL(*) stuff - -AltBlock(choice, preamble, alts, error) ::= << -self.state = - - = _input.LT(1) - -la_ = self._interp.adaptivePredict(self._input,,self._ctx) -: - - pass -}; separator="\nel"> - ->> - -OptionalBlock(choice, alts, error) ::= << -self.state = - -la_ = self._interp.adaptivePredict(self._input,,self._ctx) -+1: - -}; separator="\nel"> - ->> - -StarBlock(choice, alts, sync, iteration) ::= << -self.state = -self._errHandler.sync(self) -_alt = self._interp.adaptivePredict(self._input,,self._ctx) -while _alt!= and _alt!=ATN.INVALID_ALT_NUMBER: - if _alt==1+1: - - - self.state = - self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,,self._ctx) - ->> - -PlusBlock(choice, alts, error) ::= << -self.state = -self._errHandler.sync(self) -_alt = 1+1 -while _alt!= and _alt!=ATN.INVALID_ALT_NUMBER: - +1: - -}; separator="\nel"> - else: - - self.state = - self._errHandler.sync(self) - _alt = self._interp.adaptivePredict(self._input,,self._ctx) - ->> - -Sync(s) ::= "sync()" - -ThrowNoViableAlt(t) ::= "raise NoViableAltException(self)" - -TestSetInline(s) ::= << -}; separator=" or "> ->> - -// Java language spec 15.19 - shift operators mask operands rather than overflow to 0... need range test -testShiftInRange(shiftAmount) ::= << -(() & ~0x3f) == 0 ->> - -// produces smaller bytecode only when bits.ttypes contains more than two items -bitsetBitfieldComparison(s, bits) ::= <% -(})> and ((1 \<\< ) & ()}; separator=" | ">)) != 0) -%> - -isZero ::= [ -"0":true, -default:false -] - -offsetShiftVar(shiftAmount, offset) ::= <% -( - ) -%> - -offsetShiftType(shiftAmount, offset) ::= <% -(. - ). -%> - -// produces more efficient bytecode when bits.ttypes contains at most two items -bitsetInlineComparison(s, bits) ::= <% -==.}; separator=" or "> -%> - -cases(ttypes) ::= << -if token in [.}; separator=", ">]: ->> - -InvokeRule(r, argExprsChunks) ::= << -self.state = - = }>self.(,) ->> - -MatchToken(m) ::= << -self.state = - = }>self.match(.) ->> - -MatchSet(m, expr, capture) ::= "" - -MatchNotSet(m, expr, capture) ::= "" - -CommonSetStuff(m, expr, capture, invert) ::= << -self.state = - = }>self._input.LT(1) - -if \<= 0 or if not(): - = }> self._errHandler.recoverInline(self) -else: - self.consume() ->> - -Wildcard(w) ::= << -self.state = - = }>self.matchWildcard() ->> - -// ACTION STUFF - -Action(a, foo, chunks) ::= "" - -ArgAction(a, chunks) ::= "" - -SemPred(p, chunks, failChunks) ::= << -self.state = -if not : - from antlr4.error.Errors import FailedPredicateException - raise FailedPredicateException(self, , , ) ->> - -ExceptionClause(e, catchArg, catchAction) ::= << -catch () { - -} ->> - -// lexer actions are not associated with model objects - -LexerSkipCommand() ::= "skip()" -LexerMoreCommand() ::= "more()" -LexerPopModeCommand() ::= "popMode()" - -LexerTypeCommand(arg) ::= "_type = " -LexerChannelCommand(arg) ::= "_channel = " -LexerModeCommand(arg) ::= "_mode = " -LexerPushModeCommand(arg) ::= "pushMode()" - -ActionText(t) ::= "" -ActionTemplate(t) ::= "" -ArgRef(a) ::= "localctx." -LocalRef(a) ::= "localctx." -RetValueRef(a) ::= "localctx." -QRetValueRef(a) ::= ".." -/** How to translate $tokenLabel */ -TokenRef(t) ::= "." -LabelRef(t) ::= "." -ListLabelRef(t) ::= "." -SetAttr(s,rhsChunks) ::= ". = " - -TokenLabelType() ::= "" -InputSymbolType() ::= "" - -TokenPropertyRef_text(t) ::= "(None if . is None else ..text)" -TokenPropertyRef_type(t) ::= "(0 if . is None else ..type()" -TokenPropertyRef_line(t) ::= "(0 if . is None else ..line)" -TokenPropertyRef_pos(t) ::= "(0 if . is None else ..column)" -TokenPropertyRef_channel(t) ::= "(0 if (. is None else ..channel)" -TokenPropertyRef_index(t) ::= "(0 if . is None else ..tokenIndex)" -TokenPropertyRef_int(t) ::= "(0 if . is None else int(..text))" - -RulePropertyRef_start(r) ::= "(None if . is None else ..start)" -RulePropertyRef_stop(r) ::= "(None if . is None else ..stop)" -RulePropertyRef_text(r) ::= "(None if . is None else self._input.getText((..start,..stop)))" -RulePropertyRef_ctx(r) ::= "." -RulePropertyRef_parser(r) ::= "self" - -ThisRulePropertyRef_start(r) ::= "localctx.start" -ThisRulePropertyRef_stop(r) ::= "localctx.stop" -ThisRulePropertyRef_text(r) ::= "self._input.getText((localctx.start, self._input.LT(-1)))" -ThisRulePropertyRef_ctx(r) ::= "localctx" -ThisRulePropertyRef_parser(r) ::= "self" - -NonLocalAttrRef(s) ::= "getInvokingContext()." -SetNonLocalAttr(s, rhsChunks) ::= "getInvokingContext(). = " - -AddToLabelList(a) ::= "..append()" - -TokenDecl(t) ::= "self. = None # " -TokenTypeDecl(t) ::= "self. = 0 # type" -TokenListDecl(t) ::= "self. = list() # of s" -RuleContextDecl(r) ::= "self. = None # " -RuleContextListDecl(rdecl) ::= "self. = list() # of s" - -ContextTokenGetterDecl(t) ::= << -def (self): - return self.getToken(., 0) ->> - -// should never be called -ContextTokenListGetterDecl(t) ::= << -def _list(self): - return self.getTokens(.) ->> - -ContextTokenListIndexedGetterDecl(t) ::= << -def (self, i:int=None): - if i is None: - return self.getTokens(.) - else: - return self.getToken(., i) ->> - -ContextRuleGetterDecl(r) ::= << -def (self): - return self.getTypedRuleContext(.,0) - ->> - -// should never be called -ContextRuleListGetterDecl(r) ::= << -def _list(self): - return self.getTypedRuleContexts(.) - ->> - -ContextRuleListIndexedGetterDecl(r) ::= << -def (self, i:int=None): - if i is None: - return self.getTypedRuleContexts(.) - else: - return self.getTypedRuleContext(.,i) - ->> - -LexerRuleContext() ::= "RuleContext" - -/** The rule context name is the rule followed by a suffix; e.g., - * r becomes rContext. - */ -RuleContextNameSuffix() ::= "Context" - -ImplicitTokenLabel(tokenName) ::= "_" -ImplicitRuleLabel(ruleName) ::= "_" -ImplicitSetLabel(id) ::= "_tset" -ListLabelName(label) ::= "