From 47e3278f4676d888d864e06ebb4af894736d8ce4 Mon Sep 17 00:00:00 2001 From: Phil Elson Date: Fri, 27 Sep 2024 09:42:09 +0200 Subject: [PATCH] Move the antlr runtime outside of the parser directory, to avoid circular dependencies --- .gitattributes | 1 + cf_units/_udunits2_parser/__init__.py | 7 +-- .../_antlr4_runtime/BufferedTokenStream.py | 14 ++--- .../_antlr4_runtime/CommonTokenFactory.py | 2 +- .../_antlr4_runtime/CommonTokenStream.py | 6 +- .../_antlr4_runtime/FileStream.py | 4 +- .../_antlr4_runtime/InputStream.py | 2 +- .../_antlr4_runtime/IntervalSet.py | 2 +- .../_antlr4_runtime/LL1Analyzer.py | 22 +++---- .../{parser => }/_antlr4_runtime/Lexer.py | 14 ++--- .../_antlr4_runtime/ListTokenSource.py | 6 +- .../{parser => }/_antlr4_runtime/Parser.py | 34 +++++------ .../_antlr4_runtime/ParserInterpreter.py | 26 ++++---- .../_antlr4_runtime/ParserRuleContext.py | 8 +-- .../_antlr4_runtime/PredictionContext.py | 8 +-- .../_antlr4_runtime/Recognizer.py | 12 ++-- .../_antlr4_runtime/RuleContext.py | 4 +- .../_antlr4_runtime/StdinStream.py | 4 +- .../{parser => }/_antlr4_runtime/Token.py | 0 .../_antlr4_runtime/TokenStreamRewriter.py | 2 +- .../{parser => }/_antlr4_runtime/Utils.py | 0 .../_antlr4_runtime/__init__.py | 53 +++++++++++++++++ .../_antlr4_runtime/_antlr4_version.txt | 0 .../{parser => }/_antlr4_runtime/_pygrun.py | 6 +- .../{parser => }/_antlr4_runtime/atn/ATN.py | 18 ++---- .../_antlr4_runtime/atn/ATNConfig.py | 8 +-- .../_antlr4_runtime/atn/ATNConfigSet.py | 16 ++--- .../atn/ATNDeserializationOptions.py | 0 .../_antlr4_runtime/atn/ATNDeserializer.py | 16 +++-- .../_antlr4_runtime/atn/ATNSimulator.py | 10 ++-- .../_antlr4_runtime/atn/ATNState.py | 4 +- .../_antlr4_runtime/atn/ATNType.py | 0 .../_antlr4_runtime/atn/LexerATNSimulator.py | 34 ++++------- .../_antlr4_runtime/atn/LexerAction.py | 0 .../atn/LexerActionExecutor.py | 6 +- .../_antlr4_runtime/atn/ParserATNSimulator.py | 40 ++++++------- .../_antlr4_runtime/atn/PredictionMode.py | 12 ++-- .../_antlr4_runtime/atn/SemanticContext.py | 8 +-- .../_antlr4_runtime/atn/Transition.py | 10 ++-- .../_antlr4_runtime/atn/__init__.py | 0 .../{parser => }/_antlr4_runtime/dfa/DFA.py | 14 ++--- .../_antlr4_runtime/dfa/DFASerializer.py | 8 +-- .../_antlr4_runtime/dfa/DFAState.py | 4 +- .../_antlr4_runtime/dfa/__init__.py | 0 .../error/DiagnosticErrorListener.py | 6 +- .../_antlr4_runtime/error/ErrorListener.py | 0 .../_antlr4_runtime/error/ErrorStrategy.py | 12 ++-- .../_antlr4_runtime/error/Errors.py | 12 ++-- .../_antlr4_runtime/error/__init__.py | 0 .../_antlr4_runtime/tree/Chunk.py | 0 .../_antlr4_runtime/tree/ParseTreeMatch.py | 6 +- .../_antlr4_runtime/tree/ParseTreePattern.py | 6 +- .../tree/ParseTreePatternMatcher.py | 32 +++++----- .../_antlr4_runtime/tree/RuleTagToken.py | 2 +- .../_antlr4_runtime/tree/TokenTagToken.py | 2 +- .../{parser => }/_antlr4_runtime/tree/Tree.py | 2 +- .../_antlr4_runtime/tree/Trees.py | 10 ++-- .../_antlr4_runtime/tree/__init__.py | 0 .../_antlr4_runtime/xpath/XPath.py | 22 +++---- .../_antlr4_runtime/xpath/XPathLexer.py | 2 +- .../_antlr4_runtime/xpath/__init__.py | 0 cf_units/_udunits2_parser/compile.py | 10 ++-- .../parser/_antlr4_runtime/__init__.py | 59 ------------------- .../_udunits2_parser/parser/udunits2Lexer.py | 2 +- .../_udunits2_parser/parser/udunits2Parser.py | 10 ++-- .../parser/udunits2ParserVisitor.py | 2 +- pyproject.toml | 1 + 67 files changed, 273 insertions(+), 370 deletions(-) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/BufferedTokenStream.py (96%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/CommonTokenFactory.py (96%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/CommonTokenStream.py (92%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/FileStream.py (90%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/InputStream.py (96%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/IntervalSet.py (98%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/LL1Analyzer.py (92%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/Lexer.py (96%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/ListTokenSource.py (95%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/Parser.py (95%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/ParserInterpreter.py (88%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/ParserRuleContext.py (96%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/PredictionContext.py (99%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/Recognizer.py (92%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/RuleContext.py (98%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/StdinStream.py (74%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/Token.py (100%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/TokenStreamRewriter.py (99%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/Utils.py (100%) create mode 100644 cf_units/_udunits2_parser/_antlr4_runtime/__init__.py rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/_antlr4_version.txt (100%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/_pygrun.py (97%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/atn/ATN.py (91%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/atn/ATNConfig.py (95%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/atn/ATNConfigSet.py (94%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/atn/ATNDeserializationOptions.py (100%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/atn/ATNDeserializer.py (97%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/atn/ATNSimulator.py (87%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/atn/ATNState.py (98%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/atn/ATNType.py (100%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/atn/LexerATNSimulator.py (96%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/atn/LexerAction.py (100%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/atn/LexerActionExecutor.py (97%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/atn/ParserATNSimulator.py (98%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/atn/PredictionMode.py (98%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/atn/SemanticContext.py (98%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/atn/Transition.py (96%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/atn/__init__.py (100%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/dfa/DFA.py (91%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/dfa/DFASerializer.py (91%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/dfa/DFAState.py (97%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/dfa/__init__.py (100%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/error/DiagnosticErrorListener.py (95%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/error/ErrorListener.py (100%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/error/ErrorStrategy.py (98%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/error/Errors.py (95%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/error/__init__.py (100%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/tree/Chunk.py (100%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/tree/ParseTreeMatch.py (96%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/tree/ParseTreePattern.py (93%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/tree/ParseTreePatternMatcher.py (93%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/tree/RuleTagToken.py (96%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/tree/TokenTagToken.py (95%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/tree/Tree.py (98%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/tree/Trees.py (92%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/tree/__init__.py (100%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/xpath/XPath.py (93%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/xpath/XPathLexer.py (99%) rename cf_units/_udunits2_parser/{parser => }/_antlr4_runtime/xpath/__init__.py (100%) delete mode 100644 cf_units/_udunits2_parser/parser/_antlr4_runtime/__init__.py diff --git a/.gitattributes b/.gitattributes index bda29feb..1df6e00c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ .git_archival.txt export-subst cf_units/_udunits2_parser/parser/**/*.py linguist-generated=true +cf_units/_udunits2_parser/_antlr4_runtime/**/*.py linguist-generated=true diff --git a/cf_units/_udunits2_parser/__init__.py b/cf_units/_udunits2_parser/__init__.py index 2c0b0fcc..6041409a 100644 --- a/cf_units/_udunits2_parser/__init__.py +++ b/cf_units/_udunits2_parser/__init__.py @@ -5,15 +5,14 @@ import unicodedata -from cf_units._udunits2_parser.parser._antlr4_runtime import ( +from . import graph +from ._antlr4_runtime import ( CommonTokenStream, InputStream, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.error import ( +from ._antlr4_runtime.error import ( ErrorListener, ) - -from . import graph from .parser.udunits2Lexer import udunits2Lexer from .parser.udunits2Parser import udunits2Parser from .parser.udunits2ParserVisitor import udunits2ParserVisitor diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/BufferedTokenStream.py b/cf_units/_udunits2_parser/_antlr4_runtime/BufferedTokenStream.py similarity index 96% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/BufferedTokenStream.py rename to cf_units/_udunits2_parser/_antlr4_runtime/BufferedTokenStream.py index 100219a8..530272c3 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/BufferedTokenStream.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/BufferedTokenStream.py @@ -15,10 +15,10 @@ # {@link CommonTokenStream}.

from io import StringIO -from cf_units._udunits2_parser.parser._antlr4_runtime.error.Errors import ( +from cf_units._udunits2_parser._antlr4_runtime.error.Errors import ( IllegalStateException, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.Token import Token # need forward declaration Lexer = None @@ -233,9 +233,7 @@ def getHiddenTokensToRight(self, tokenIndex: int, channel: int = -1): raise Exception( str(tokenIndex) + " not in 0.." + str(len(self.tokens) - 1) ) - from cf_units._udunits2_parser.parser._antlr4_runtime.Lexer import ( - Lexer, - ) + from cf_units._udunits2_parser._antlr4_runtime.Lexer import Lexer nextOnChannel = self.nextTokenOnChannel( tokenIndex + 1, Lexer.DEFAULT_TOKEN_CHANNEL @@ -254,9 +252,7 @@ def getHiddenTokensToLeft(self, tokenIndex: int, channel: int = -1): raise Exception( str(tokenIndex) + " not in 0.." + str(len(self.tokens) - 1) ) - from cf_units._udunits2_parser.parser._antlr4_runtime.Lexer import ( - Lexer, - ) + from cf_units._udunits2_parser._antlr4_runtime.Lexer import Lexer prevOnChannel = self.previousTokenOnChannel( tokenIndex - 1, Lexer.DEFAULT_TOKEN_CHANNEL @@ -273,7 +269,7 @@ def filterForChannel(self, left: int, right: int, channel: int): for i in range(left, right + 1): t = self.tokens[i] if channel == -1: - from cf_units._udunits2_parser.parser._antlr4_runtime.Lexer import ( + from cf_units._udunits2_parser._antlr4_runtime.Lexer import ( Lexer, ) diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/CommonTokenFactory.py b/cf_units/_udunits2_parser/_antlr4_runtime/CommonTokenFactory.py similarity index 96% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/CommonTokenFactory.py rename to cf_units/_udunits2_parser/_antlr4_runtime/CommonTokenFactory.py index b5ea3d6f..0e5730bc 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/CommonTokenFactory.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/CommonTokenFactory.py @@ -8,7 +8,7 @@ # This default implementation of {@link TokenFactory} creates # {@link CommonToken} objects. # -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import CommonToken +from cf_units._udunits2_parser._antlr4_runtime.Token import CommonToken class TokenFactory: diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/CommonTokenStream.py b/cf_units/_udunits2_parser/_antlr4_runtime/CommonTokenStream.py similarity index 92% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/CommonTokenStream.py rename to cf_units/_udunits2_parser/_antlr4_runtime/CommonTokenStream.py index b39d2c1b..ad8a33a2 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/CommonTokenStream.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/CommonTokenStream.py @@ -29,11 +29,11 @@ # channel.

# / -from cf_units._udunits2_parser.parser._antlr4_runtime.BufferedTokenStream import ( +from cf_units._udunits2_parser._antlr4_runtime.BufferedTokenStream import ( BufferedTokenStream, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.Lexer import Lexer -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.Lexer import Lexer +from cf_units._udunits2_parser._antlr4_runtime.Token import Token class CommonTokenStream(BufferedTokenStream): diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/FileStream.py b/cf_units/_udunits2_parser/_antlr4_runtime/FileStream.py similarity index 90% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/FileStream.py rename to cf_units/_udunits2_parser/_antlr4_runtime/FileStream.py index a6c0d140..54a8be25 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/FileStream.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/FileStream.py @@ -11,9 +11,7 @@ import codecs -from cf_units._udunits2_parser.parser._antlr4_runtime.InputStream import ( - InputStream, -) +from cf_units._udunits2_parser._antlr4_runtime.InputStream import InputStream class FileStream(InputStream): diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/InputStream.py b/cf_units/_udunits2_parser/_antlr4_runtime/InputStream.py similarity index 96% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/InputStream.py rename to cf_units/_udunits2_parser/_antlr4_runtime/InputStream.py index d229979b..5c881bb7 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/InputStream.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/InputStream.py @@ -8,7 +8,7 @@ # # Vacuum all input from a string and then treat it like a buffer. # -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.Token import Token class InputStream: diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/IntervalSet.py b/cf_units/_udunits2_parser/_antlr4_runtime/IntervalSet.py similarity index 98% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/IntervalSet.py rename to cf_units/_udunits2_parser/_antlr4_runtime/IntervalSet.py index 5789d324..326c297f 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/IntervalSet.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/IntervalSet.py @@ -6,7 +6,7 @@ from io import StringIO -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.Token import Token # need forward declarations IntervalSet = None diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/LL1Analyzer.py b/cf_units/_udunits2_parser/_antlr4_runtime/LL1Analyzer.py similarity index 92% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/LL1Analyzer.py rename to cf_units/_udunits2_parser/_antlr4_runtime/LL1Analyzer.py index 376e2901..88410306 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/LL1Analyzer.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/LL1Analyzer.py @@ -3,32 +3,26 @@ # Use of this file is governed by the BSD 3-clause license that # can be found in the LICENSE.txt file in the project root. # / -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATN import ATN -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNConfig import ( - ATNConfig, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNState import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ATN import ATN +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNConfig import ATNConfig +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNState import ( ATNState, RuleStopState, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.Transition import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.Transition import ( AbstractPredicateTransition, NotSetTransition, RuleTransition, WildcardTransition, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.IntervalSet import ( - IntervalSet, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.PredictionContext import ( +from cf_units._udunits2_parser._antlr4_runtime.IntervalSet import IntervalSet +from cf_units._udunits2_parser._antlr4_runtime.PredictionContext import ( PredictionContext, PredictionContextFromRuleContext, SingletonPredictionContext, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.RuleContext import ( - RuleContext, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.RuleContext import RuleContext +from cf_units._udunits2_parser._antlr4_runtime.Token import Token class LL1Analyzer: diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/Lexer.py b/cf_units/_udunits2_parser/_antlr4_runtime/Lexer.py similarity index 96% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/Lexer.py rename to cf_units/_udunits2_parser/_antlr4_runtime/Lexer.py index 24311729..127edbc8 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/Lexer.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/Lexer.py @@ -15,21 +15,17 @@ from typing import TextIO else: from typing.io import TextIO -from cf_units._udunits2_parser.parser._antlr4_runtime.CommonTokenFactory import ( +from cf_units._udunits2_parser._antlr4_runtime.CommonTokenFactory import ( CommonTokenFactory, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.error.Errors import ( +from cf_units._udunits2_parser._antlr4_runtime.error.Errors import ( IllegalStateException, LexerNoViableAltException, RecognitionException, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.InputStream import ( - InputStream, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.Recognizer import ( - Recognizer, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.InputStream import InputStream +from cf_units._udunits2_parser._antlr4_runtime.Recognizer import Recognizer +from cf_units._udunits2_parser._antlr4_runtime.Token import Token class TokenSource: diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/ListTokenSource.py b/cf_units/_udunits2_parser/_antlr4_runtime/ListTokenSource.py similarity index 95% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/ListTokenSource.py rename to cf_units/_udunits2_parser/_antlr4_runtime/ListTokenSource.py index a0851a7c..b3255bb3 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/ListTokenSource.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/ListTokenSource.py @@ -12,11 +12,11 @@ # as the EOF token for every call to {@link #nextToken} after the end of the # list is reached. Otherwise, an EOF token will be created.

# -from cf_units._udunits2_parser.parser._antlr4_runtime.CommonTokenFactory import ( +from cf_units._udunits2_parser._antlr4_runtime.CommonTokenFactory import ( CommonTokenFactory, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.Lexer import TokenSource -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.Lexer import TokenSource +from cf_units._udunits2_parser._antlr4_runtime.Token import Token class ListTokenSource(TokenSource): diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/Parser.py b/cf_units/_udunits2_parser/_antlr4_runtime/Parser.py similarity index 95% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/Parser.py rename to cf_units/_udunits2_parser/_antlr4_runtime/Parser.py index 3c17a9a3..e5aeaef4 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/Parser.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/Parser.py @@ -8,43 +8,37 @@ from typing import TextIO else: from typing.io import TextIO -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNDeserializationOptions import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNDeserializationOptions import ( ATNDeserializationOptions, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNDeserializer import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNDeserializer import ( ATNDeserializer, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.BufferedTokenStream import ( +from cf_units._udunits2_parser._antlr4_runtime.BufferedTokenStream import ( TokenStream, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.CommonTokenFactory import ( +from cf_units._udunits2_parser._antlr4_runtime.CommonTokenFactory import ( TokenFactory, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.error.Errors import ( +from cf_units._udunits2_parser._antlr4_runtime.error.Errors import ( RecognitionException, UnsupportedOperationException, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.error.ErrorStrategy import ( +from cf_units._udunits2_parser._antlr4_runtime.error.ErrorStrategy import ( DefaultErrorStrategy, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.InputStream import ( - InputStream, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.Lexer import Lexer -from cf_units._udunits2_parser.parser._antlr4_runtime.ParserRuleContext import ( +from cf_units._udunits2_parser._antlr4_runtime.InputStream import InputStream +from cf_units._udunits2_parser._antlr4_runtime.Lexer import Lexer +from cf_units._udunits2_parser._antlr4_runtime.ParserRuleContext import ( ParserRuleContext, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.Recognizer import ( - Recognizer, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.RuleContext import ( - RuleContext, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token -from cf_units._udunits2_parser.parser._antlr4_runtime.tree.ParseTreePatternMatcher import ( +from cf_units._udunits2_parser._antlr4_runtime.Recognizer import Recognizer +from cf_units._udunits2_parser._antlr4_runtime.RuleContext import RuleContext +from cf_units._udunits2_parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.tree.ParseTreePatternMatcher import ( ParseTreePatternMatcher, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.tree.Tree import ( +from cf_units._udunits2_parser._antlr4_runtime.tree.Tree import ( ErrorNode, ParseTreeListener, TerminalNode, diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/ParserInterpreter.py b/cf_units/_udunits2_parser/_antlr4_runtime/ParserInterpreter.py similarity index 88% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/ParserInterpreter.py rename to cf_units/_udunits2_parser/_antlr4_runtime/ParserInterpreter.py index 9461f67b..f4ce5672 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/ParserInterpreter.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/ParserInterpreter.py @@ -17,37 +17,35 @@ # # See TestParserInterpreter for examples. # -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATN import ATN -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNState import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ATN import ATN +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNState import ( ATNState, LoopEndState, StarLoopEntryState, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ParserATNSimulator import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ParserATNSimulator import ( ParserATNSimulator, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.Transition import ( - Transition, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.BufferedTokenStream import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.Transition import Transition +from cf_units._udunits2_parser._antlr4_runtime.BufferedTokenStream import ( TokenStream, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.dfa.DFA import DFA -from cf_units._udunits2_parser.parser._antlr4_runtime.error.Errors import ( +from cf_units._udunits2_parser._antlr4_runtime.dfa.DFA import DFA +from cf_units._udunits2_parser._antlr4_runtime.error.Errors import ( FailedPredicateException, RecognitionException, UnsupportedOperationException, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.Lexer import Lexer -from cf_units._udunits2_parser.parser._antlr4_runtime.Parser import Parser -from cf_units._udunits2_parser.parser._antlr4_runtime.ParserRuleContext import ( +from cf_units._udunits2_parser._antlr4_runtime.Lexer import Lexer +from cf_units._udunits2_parser._antlr4_runtime.Parser import Parser +from cf_units._udunits2_parser._antlr4_runtime.ParserRuleContext import ( InterpreterRuleContext, ParserRuleContext, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.PredictionContext import ( +from cf_units._udunits2_parser._antlr4_runtime.PredictionContext import ( PredictionContextCache, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.Token import Token class ParserInterpreter(Parser): diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/ParserRuleContext.py b/cf_units/_udunits2_parser/_antlr4_runtime/ParserRuleContext.py similarity index 96% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/ParserRuleContext.py rename to cf_units/_udunits2_parser/_antlr4_runtime/ParserRuleContext.py index 7c877002..1f9e55fd 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/ParserRuleContext.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/ParserRuleContext.py @@ -25,11 +25,9 @@ # group values such as this aggregate. The getters/setters are there to # satisfy the superclass interface. -from cf_units._udunits2_parser.parser._antlr4_runtime.RuleContext import ( - RuleContext, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token -from cf_units._udunits2_parser.parser._antlr4_runtime.tree.Tree import ( +from cf_units._udunits2_parser._antlr4_runtime.RuleContext import RuleContext +from cf_units._udunits2_parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.tree.Tree import ( INVALID_INTERVAL, ErrorNodeImpl, ParseTree, diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/PredictionContext.py b/cf_units/_udunits2_parser/_antlr4_runtime/PredictionContext.py similarity index 99% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/PredictionContext.py rename to cf_units/_udunits2_parser/_antlr4_runtime/PredictionContext.py index 58ae297a..603da8d7 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/PredictionContext.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/PredictionContext.py @@ -5,13 +5,11 @@ # / from io import StringIO -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATN import ATN -from cf_units._udunits2_parser.parser._antlr4_runtime.error.Errors import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ATN import ATN +from cf_units._udunits2_parser._antlr4_runtime.error.Errors import ( IllegalStateException, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.RuleContext import ( - RuleContext, -) +from cf_units._udunits2_parser._antlr4_runtime.RuleContext import RuleContext # dup ParserATNSimulator class var here to avoid circular import; no idea why this can't be in PredictionContext _trace_atn_sim = False diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/Recognizer.py b/cf_units/_udunits2_parser/_antlr4_runtime/Recognizer.py similarity index 92% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/Recognizer.py rename to cf_units/_udunits2_parser/_antlr4_runtime/Recognizer.py index f74fa66a..75886836 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/Recognizer.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/Recognizer.py @@ -3,14 +3,12 @@ # Use of this file is governed by the BSD 3-clause license that # can be found in the LICENSE.txt file in the project root. # -from cf_units._udunits2_parser.parser._antlr4_runtime.error.ErrorListener import ( +from cf_units._udunits2_parser._antlr4_runtime.error.ErrorListener import ( ConsoleErrorListener, ProxyErrorListener, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.RuleContext import ( - RuleContext, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.RuleContext import RuleContext +from cf_units._udunits2_parser._antlr4_runtime.Token import Token # need forward delcaration RecognitionException = None @@ -63,7 +61,7 @@ def removeErrorListeners(self): def getTokenTypeMap(self): tokenNames = self.getTokenNames() if tokenNames is None: - from cf_units._udunits2_parser.parser._antlr4_runtime.error.Errors import ( + from cf_units._udunits2_parser._antlr4_runtime.error.Errors import ( UnsupportedOperationException, ) @@ -84,7 +82,7 @@ def getTokenTypeMap(self): def getRuleIndexMap(self): ruleNames = self.getRuleNames() if ruleNames is None: - from cf_units._udunits2_parser.parser._antlr4_runtime.error.Errors import ( + from cf_units._udunits2_parser._antlr4_runtime.error.Errors import ( UnsupportedOperationException, ) diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/RuleContext.py b/cf_units/_udunits2_parser/_antlr4_runtime/RuleContext.py similarity index 98% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/RuleContext.py rename to cf_units/_udunits2_parser/_antlr4_runtime/RuleContext.py index 9378f5e3..31d83f49 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/RuleContext.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/RuleContext.py @@ -26,12 +26,12 @@ # / from io import StringIO -from cf_units._udunits2_parser.parser._antlr4_runtime.tree.Tree import ( +from cf_units._udunits2_parser._antlr4_runtime.tree.Tree import ( INVALID_INTERVAL, ParseTreeVisitor, RuleNode, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.tree.Trees import Trees +from cf_units._udunits2_parser._antlr4_runtime.tree.Trees import Trees # need forward declarations RuleContext = None diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/StdinStream.py b/cf_units/_udunits2_parser/_antlr4_runtime/StdinStream.py similarity index 74% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/StdinStream.py rename to cf_units/_udunits2_parser/_antlr4_runtime/StdinStream.py index 631e3735..d41ae61e 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/StdinStream.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/StdinStream.py @@ -1,9 +1,7 @@ import codecs import sys -from cf_units._udunits2_parser.parser._antlr4_runtime.InputStream import ( - InputStream, -) +from cf_units._udunits2_parser._antlr4_runtime.InputStream import InputStream class StdinStream(InputStream): diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/Token.py b/cf_units/_udunits2_parser/_antlr4_runtime/Token.py similarity index 100% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/Token.py rename to cf_units/_udunits2_parser/_antlr4_runtime/Token.py diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/TokenStreamRewriter.py b/cf_units/_udunits2_parser/_antlr4_runtime/TokenStreamRewriter.py similarity index 99% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/TokenStreamRewriter.py rename to cf_units/_udunits2_parser/_antlr4_runtime/TokenStreamRewriter.py index d7fe6506..cf57cb30 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/TokenStreamRewriter.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/TokenStreamRewriter.py @@ -6,7 +6,7 @@ from io import StringIO -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.Token import Token class TokenStreamRewriter: diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/Utils.py b/cf_units/_udunits2_parser/_antlr4_runtime/Utils.py similarity index 100% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/Utils.py rename to cf_units/_udunits2_parser/_antlr4_runtime/Utils.py diff --git a/cf_units/_udunits2_parser/_antlr4_runtime/__init__.py b/cf_units/_udunits2_parser/_antlr4_runtime/__init__.py new file mode 100644 index 00000000..e4a633f9 --- /dev/null +++ b/cf_units/_udunits2_parser/_antlr4_runtime/__init__.py @@ -0,0 +1,53 @@ +from cf_units._udunits2_parser._antlr4_runtime.atn.ATN import ATN +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNDeserializer import ( + ATNDeserializer, +) +from cf_units._udunits2_parser._antlr4_runtime.atn.LexerATNSimulator import ( + LexerATNSimulator, +) +from cf_units._udunits2_parser._antlr4_runtime.atn.ParserATNSimulator import ( + ParserATNSimulator, +) +from cf_units._udunits2_parser._antlr4_runtime.atn.PredictionMode import ( + PredictionMode, +) +from cf_units._udunits2_parser._antlr4_runtime.BufferedTokenStream import ( + TokenStream, +) +from cf_units._udunits2_parser._antlr4_runtime.CommonTokenStream import ( + CommonTokenStream, +) +from cf_units._udunits2_parser._antlr4_runtime.dfa.DFA import DFA +from cf_units._udunits2_parser._antlr4_runtime.error.DiagnosticErrorListener import ( + DiagnosticErrorListener, +) +from cf_units._udunits2_parser._antlr4_runtime.error.Errors import ( + IllegalStateException, + NoViableAltException, + RecognitionException, +) +from cf_units._udunits2_parser._antlr4_runtime.error.ErrorStrategy import ( + BailErrorStrategy, +) +from cf_units._udunits2_parser._antlr4_runtime.FileStream import FileStream +from cf_units._udunits2_parser._antlr4_runtime.InputStream import InputStream +from cf_units._udunits2_parser._antlr4_runtime.Lexer import Lexer +from cf_units._udunits2_parser._antlr4_runtime.Parser import Parser +from cf_units._udunits2_parser._antlr4_runtime.ParserRuleContext import ( + ParserRuleContext, + RuleContext, +) +from cf_units._udunits2_parser._antlr4_runtime.PredictionContext import ( + PredictionContextCache, +) +from cf_units._udunits2_parser._antlr4_runtime.StdinStream import StdinStream +from cf_units._udunits2_parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.tree.Tree import ( + ErrorNode, + ParseTreeListener, + ParseTreeVisitor, + ParseTreeWalker, + RuleNode, + TerminalNode, +) +from cf_units._udunits2_parser._antlr4_runtime.Utils import str_list diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/_antlr4_version.txt b/cf_units/_udunits2_parser/_antlr4_runtime/_antlr4_version.txt similarity index 100% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/_antlr4_version.txt rename to cf_units/_udunits2_parser/_antlr4_runtime/_antlr4_version.txt diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/_pygrun.py b/cf_units/_udunits2_parser/_antlr4_runtime/_pygrun.py similarity index 97% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/_pygrun.py rename to cf_units/_udunits2_parser/_antlr4_runtime/_pygrun.py index 4069fdf4..23089137 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/_pygrun.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/_pygrun.py @@ -4,7 +4,7 @@ import os import sys -from cf_units._udunits2_parser.parser._antlr4_runtime import * +from cf_units._udunits2_parser._antlr4_runtime import * # this is a python version of TestRig @@ -177,7 +177,9 @@ def process(input_stream, class_lexer, class_parser): input_stream = FileStream(file_name) process(input_stream, class_lexer, class_parser) else: - print(f"[ERROR] file {os.path.normpath(file_name)} not exist") + print( + f"[ERROR] file {os.path.normpath(file_name)} not exist" + ) if __name__ == "__main__": diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ATN.py b/cf_units/_udunits2_parser/_antlr4_runtime/atn/ATN.py similarity index 91% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ATN.py rename to cf_units/_udunits2_parser/_antlr4_runtime/atn/ATN.py index 780d5ddb..ba7fb2b2 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ATN.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/atn/ATN.py @@ -2,20 +2,14 @@ # Use of this file is governed by the BSD 3-clause license that # can be found in the LICENSE.txt file in the project root. # / -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNState import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNState import ( ATNState, DecisionState, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNType import ( - ATNType, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.IntervalSet import ( - IntervalSet, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.RuleContext import ( - RuleContext, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNType import ATNType +from cf_units._udunits2_parser._antlr4_runtime.IntervalSet import IntervalSet +from cf_units._udunits2_parser._antlr4_runtime.RuleContext import RuleContext +from cf_units._udunits2_parser._antlr4_runtime.Token import Token class ATN: @@ -66,7 +60,7 @@ def __init__(self, grammarType: ATNType, maxTokenType: int): # the rule surrounding {@code s}. In other words, the set will be # restricted to tokens reachable staying within {@code s}'s rule. def nextTokensInContext(self, s: ATNState, ctx: RuleContext): - from cf_units._udunits2_parser.parser._antlr4_runtime.LL1Analyzer import ( + from cf_units._udunits2_parser._antlr4_runtime.LL1Analyzer import ( LL1Analyzer, ) diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ATNConfig.py b/cf_units/_udunits2_parser/_antlr4_runtime/atn/ATNConfig.py similarity index 95% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ATNConfig.py rename to cf_units/_udunits2_parser/_antlr4_runtime/atn/ATNConfig.py index 6b004c47..6aebaa3e 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ATNConfig.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/atn/ATNConfig.py @@ -13,17 +13,17 @@ # / from io import StringIO -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNState import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNState import ( ATNState, DecisionState, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.LexerActionExecutor import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.LexerActionExecutor import ( LexerActionExecutor, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.SemanticContext import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.SemanticContext import ( SemanticContext, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.PredictionContext import ( +from cf_units._udunits2_parser._antlr4_runtime.PredictionContext import ( PredictionContext, ) diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ATNConfigSet.py b/cf_units/_udunits2_parser/_antlr4_runtime/atn/ATNConfigSet.py similarity index 94% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ATNConfigSet.py rename to cf_units/_udunits2_parser/_antlr4_runtime/atn/ATNConfigSet.py index c22f94de..97a9dd20 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ATNConfigSet.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/atn/ATNConfigSet.py @@ -12,21 +12,17 @@ # / from io import StringIO -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATN import ATN -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNConfig import ( - ATNConfig, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.SemanticContext import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ATN import ATN +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNConfig import ATNConfig +from cf_units._udunits2_parser._antlr4_runtime.atn.SemanticContext import ( SemanticContext, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.error.Errors import ( +from cf_units._udunits2_parser._antlr4_runtime.error.Errors import ( IllegalStateException, UnsupportedOperationException, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.PredictionContext import ( - merge, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.Utils import str_list +from cf_units._udunits2_parser._antlr4_runtime.PredictionContext import merge +from cf_units._udunits2_parser._antlr4_runtime.Utils import str_list ATNSimulator = None diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ATNDeserializationOptions.py b/cf_units/_udunits2_parser/_antlr4_runtime/atn/ATNDeserializationOptions.py similarity index 100% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ATNDeserializationOptions.py rename to cf_units/_udunits2_parser/_antlr4_runtime/atn/ATNDeserializationOptions.py diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ATNDeserializer.py b/cf_units/_udunits2_parser/_antlr4_runtime/atn/ATNDeserializer.py similarity index 97% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ATNDeserializer.py rename to cf_units/_udunits2_parser/_antlr4_runtime/atn/ATNDeserializer.py index 101bcbf4..a8e74536 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ATNDeserializer.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/atn/ATNDeserializer.py @@ -2,17 +2,15 @@ # Use of this file is governed by the BSD 3-clause license that # can be found in the LICENSE.txt file in the project root. # / -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATN import ATN -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNDeserializationOptions import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ATN import ATN +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNDeserializationOptions import ( ATNDeserializationOptions, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNState import * -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNType import ( - ATNType, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.LexerAction import * -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.Transition import * -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNState import * +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNType import ATNType +from cf_units._udunits2_parser._antlr4_runtime.atn.LexerAction import * +from cf_units._udunits2_parser._antlr4_runtime.atn.Transition import * +from cf_units._udunits2_parser._antlr4_runtime.Token import Token SERIALIZED_VERSION = 4 diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ATNSimulator.py b/cf_units/_udunits2_parser/_antlr4_runtime/atn/ATNSimulator.py similarity index 87% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ATNSimulator.py rename to cf_units/_udunits2_parser/_antlr4_runtime/atn/ATNSimulator.py index b7895eef..f9037583 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ATNSimulator.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/atn/ATNSimulator.py @@ -3,14 +3,12 @@ # Use of this file is governed by the BSD 3-clause license that # can be found in the LICENSE.txt file in the project root. # / -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATN import ATN -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNConfigSet import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ATN import ATN +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNConfigSet import ( ATNConfigSet, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.dfa.DFAState import ( - DFAState, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.PredictionContext import ( +from cf_units._udunits2_parser._antlr4_runtime.dfa.DFAState import DFAState +from cf_units._udunits2_parser._antlr4_runtime.PredictionContext import ( PredictionContext, PredictionContextCache, getCachedPredictionContext, diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ATNState.py b/cf_units/_udunits2_parser/_antlr4_runtime/atn/ATNState.py similarity index 98% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ATNState.py rename to cf_units/_udunits2_parser/_antlr4_runtime/atn/ATNState.py index f99e3c53..332b14e9 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ATNState.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/atn/ATNState.py @@ -64,9 +64,7 @@ # # -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.Transition import ( - Transition, -) +from cf_units._udunits2_parser._antlr4_runtime.atn.Transition import Transition INITIAL_NUM_TRANSITIONS = 4 diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ATNType.py b/cf_units/_udunits2_parser/_antlr4_runtime/atn/ATNType.py similarity index 100% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ATNType.py rename to cf_units/_udunits2_parser/_antlr4_runtime/atn/ATNType.py diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/LexerATNSimulator.py b/cf_units/_udunits2_parser/_antlr4_runtime/atn/LexerATNSimulator.py similarity index 96% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/LexerATNSimulator.py rename to cf_units/_udunits2_parser/_antlr4_runtime/atn/LexerATNSimulator.py index bc94eb39..a3e53f20 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/LexerATNSimulator.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/atn/LexerATNSimulator.py @@ -20,43 +20,37 @@ # can simply return the predicted token type.

# / -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATN import ATN -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNConfig import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ATN import ATN +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNConfig import ( LexerATNConfig, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNConfigSet import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNConfigSet import ( ATNConfigSet, OrderedATNConfigSet, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNSimulator import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNSimulator import ( ATNSimulator, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNState import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNState import ( ATNState, RuleStopState, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.LexerActionExecutor import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.LexerActionExecutor import ( LexerActionExecutor, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.Transition import ( - Transition, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.dfa.DFAState import ( - DFAState, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.error.Errors import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.Transition import Transition +from cf_units._udunits2_parser._antlr4_runtime.dfa.DFAState import DFAState +from cf_units._udunits2_parser._antlr4_runtime.error.Errors import ( LexerNoViableAltException, UnsupportedOperationException, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.InputStream import ( - InputStream, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.PredictionContext import ( +from cf_units._udunits2_parser._antlr4_runtime.InputStream import InputStream +from cf_units._udunits2_parser._antlr4_runtime.PredictionContext import ( PredictionContext, PredictionContextCache, SingletonPredictionContext, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.Token import Token class SimState: @@ -117,9 +111,7 @@ def __init__( self.line = 1 # The index of the character relative to the beginning of the line 0..n-1#/ self.column = 0 - from cf_units._udunits2_parser.parser._antlr4_runtime.Lexer import ( - Lexer, - ) + from cf_units._udunits2_parser._antlr4_runtime.Lexer import Lexer self.mode = Lexer.DEFAULT_MODE # Cache Lexer properties to avoid further imports diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/LexerAction.py b/cf_units/_udunits2_parser/_antlr4_runtime/atn/LexerAction.py similarity index 100% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/LexerAction.py rename to cf_units/_udunits2_parser/_antlr4_runtime/atn/LexerAction.py diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/LexerActionExecutor.py b/cf_units/_udunits2_parser/_antlr4_runtime/atn/LexerActionExecutor.py similarity index 97% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/LexerActionExecutor.py rename to cf_units/_udunits2_parser/_antlr4_runtime/atn/LexerActionExecutor.py index b0b46dbc..726d59a9 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/LexerActionExecutor.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/atn/LexerActionExecutor.py @@ -12,13 +12,11 @@ # not cause bloating of the {@link DFA} created for the lexer.

-from cf_units._udunits2_parser.parser._antlr4_runtime.atn.LexerAction import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.LexerAction import ( LexerAction, LexerIndexedCustomAction, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.InputStream import ( - InputStream, -) +from cf_units._udunits2_parser._antlr4_runtime.InputStream import InputStream # need a forward declaration Lexer = None diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ParserATNSimulator.py b/cf_units/_udunits2_parser/_antlr4_runtime/atn/ParserATNSimulator.py similarity index 98% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ParserATNSimulator.py rename to cf_units/_udunits2_parser/_antlr4_runtime/atn/ParserATNSimulator.py index 8f020397..dff63378 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/ParserATNSimulator.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/atn/ParserATNSimulator.py @@ -233,31 +233,29 @@ # import sys -from cf_units._udunits2_parser.parser._antlr4_runtime import DFA -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATN import ATN -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNConfig import ( - ATNConfig, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNConfigSet import ( +from cf_units._udunits2_parser._antlr4_runtime import DFA +from cf_units._udunits2_parser._antlr4_runtime.atn.ATN import ATN +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNConfig import ATNConfig +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNConfigSet import ( ATNConfigSet, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNSimulator import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNSimulator import ( ATNSimulator, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNState import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNState import ( ATNState, DecisionState, RuleStopState, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.PredictionMode import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.PredictionMode import ( PredictionMode, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.SemanticContext import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.SemanticContext import ( SemanticContext, andContext, orContext, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.Transition import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.Transition import ( ActionTransition, AtomTransition, NotSetTransition, @@ -267,31 +265,29 @@ SetTransition, Transition, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.BufferedTokenStream import ( +from cf_units._udunits2_parser._antlr4_runtime.BufferedTokenStream import ( TokenStream, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.dfa.DFAState import ( +from cf_units._udunits2_parser._antlr4_runtime.dfa.DFAState import ( DFAState, PredPrediction, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.error.Errors import ( +from cf_units._udunits2_parser._antlr4_runtime.error.Errors import ( NoViableAltException, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.Parser import Parser -from cf_units._udunits2_parser.parser._antlr4_runtime.ParserRuleContext import ( +from cf_units._udunits2_parser._antlr4_runtime.Parser import Parser +from cf_units._udunits2_parser._antlr4_runtime.ParserRuleContext import ( ParserRuleContext, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.PredictionContext import ( +from cf_units._udunits2_parser._antlr4_runtime.PredictionContext import ( PredictionContext, PredictionContextCache, PredictionContextFromRuleContext, SingletonPredictionContext, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.RuleContext import ( - RuleContext, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token -from cf_units._udunits2_parser.parser._antlr4_runtime.Utils import str_list +from cf_units._udunits2_parser._antlr4_runtime.RuleContext import RuleContext +from cf_units._udunits2_parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.Utils import str_list class ParserATNSimulator(ATNSimulator): diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/PredictionMode.py b/cf_units/_udunits2_parser/_antlr4_runtime/atn/PredictionMode.py similarity index 98% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/PredictionMode.py rename to cf_units/_udunits2_parser/_antlr4_runtime/atn/PredictionMode.py index 00141d8c..cc5a2d8b 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/PredictionMode.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/atn/PredictionMode.py @@ -11,17 +11,15 @@ from enum import Enum -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATN import ATN -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNConfig import ( - ATNConfig, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNConfigSet import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ATN import ATN +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNConfig import ATNConfig +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNConfigSet import ( ATNConfigSet, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNState import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNState import ( RuleStopState, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.SemanticContext import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.SemanticContext import ( SemanticContext, ) diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/SemanticContext.py b/cf_units/_udunits2_parser/_antlr4_runtime/atn/SemanticContext.py similarity index 98% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/SemanticContext.py rename to cf_units/_udunits2_parser/_antlr4_runtime/atn/SemanticContext.py index 0d16ea6f..16d1c5cd 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/SemanticContext.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/atn/SemanticContext.py @@ -13,12 +13,8 @@ # from io import StringIO -from cf_units._udunits2_parser.parser._antlr4_runtime.Recognizer import ( - Recognizer, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.RuleContext import ( - RuleContext, -) +from cf_units._udunits2_parser._antlr4_runtime.Recognizer import Recognizer +from cf_units._udunits2_parser._antlr4_runtime.RuleContext import RuleContext class SemanticContext: diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/Transition.py b/cf_units/_udunits2_parser/_antlr4_runtime/atn/Transition.py similarity index 96% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/Transition.py rename to cf_units/_udunits2_parser/_antlr4_runtime/atn/Transition.py index 0d04eadb..271d02cf 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/Transition.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/atn/Transition.py @@ -17,14 +17,12 @@ # ATN transitions.

# # need forward declarations -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.SemanticContext import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.SemanticContext import ( PrecedencePredicate, Predicate, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.IntervalSet import ( - IntervalSet, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.IntervalSet import IntervalSet +from cf_units._udunits2_parser._antlr4_runtime.Token import Token ATNState = None RuleStartState = None @@ -309,4 +307,4 @@ def __str__(self): del ATNState del RuleStartState -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNState import * +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNState import * diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/__init__.py b/cf_units/_udunits2_parser/_antlr4_runtime/atn/__init__.py similarity index 100% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/atn/__init__.py rename to cf_units/_udunits2_parser/_antlr4_runtime/atn/__init__.py diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/dfa/DFA.py b/cf_units/_udunits2_parser/_antlr4_runtime/dfa/DFA.py similarity index 91% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/dfa/DFA.py rename to cf_units/_udunits2_parser/_antlr4_runtime/dfa/DFA.py index 710c0e09..e5c879a6 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/dfa/DFA.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/dfa/DFA.py @@ -2,17 +2,15 @@ # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. # Use of this file is governed by the BSD 3-clause license that # can be found in the LICENSE.txt file in the project root. -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNConfigSet import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNConfigSet import ( ATNConfigSet, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNState import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNState import ( DecisionState, StarLoopEntryState, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.dfa.DFAState import ( - DFAState, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.error.Errors import ( +from cf_units._udunits2_parser._antlr4_runtime.dfa.DFAState import DFAState +from cf_units._udunits2_parser._antlr4_runtime.error.Errors import ( IllegalStateException, ) @@ -132,7 +130,7 @@ def __str__(self): def toString(self, literalNames: list = None, symbolicNames: list = None): if self.s0 is None: return "" - from cf_units._udunits2_parser.parser._antlr4_runtime.dfa.DFASerializer import ( + from cf_units._udunits2_parser._antlr4_runtime.dfa.DFASerializer import ( DFASerializer, ) @@ -142,7 +140,7 @@ def toString(self, literalNames: list = None, symbolicNames: list = None): def toLexerString(self): if self.s0 is None: return "" - from cf_units._udunits2_parser.parser._antlr4_runtime.dfa.DFASerializer import ( + from cf_units._udunits2_parser._antlr4_runtime.dfa.DFASerializer import ( LexerDFASerializer, ) diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/dfa/DFASerializer.py b/cf_units/_udunits2_parser/_antlr4_runtime/dfa/DFASerializer.py similarity index 91% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/dfa/DFASerializer.py rename to cf_units/_udunits2_parser/_antlr4_runtime/dfa/DFASerializer.py index 66758775..c6dbc447 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/dfa/DFASerializer.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/dfa/DFASerializer.py @@ -7,11 +7,9 @@ # A DFA walker that knows how to dump them to serialized strings.#/ from io import StringIO -from cf_units._udunits2_parser.parser._antlr4_runtime import DFA -from cf_units._udunits2_parser.parser._antlr4_runtime.dfa.DFAState import ( - DFAState, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.Utils import str_list +from cf_units._udunits2_parser._antlr4_runtime import DFA +from cf_units._udunits2_parser._antlr4_runtime.dfa.DFAState import DFAState +from cf_units._udunits2_parser._antlr4_runtime.Utils import str_list class DFASerializer: diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/dfa/DFAState.py b/cf_units/_udunits2_parser/_antlr4_runtime/dfa/DFAState.py similarity index 97% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/dfa/DFAState.py rename to cf_units/_udunits2_parser/_antlr4_runtime/dfa/DFAState.py index b58111b9..83587af9 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/dfa/DFAState.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/dfa/DFAState.py @@ -7,10 +7,10 @@ # Map a predicate to a predicted alternative.#/ from io import StringIO -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNConfigSet import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNConfigSet import ( ATNConfigSet, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.SemanticContext import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.SemanticContext import ( SemanticContext, ) diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/dfa/__init__.py b/cf_units/_udunits2_parser/_antlr4_runtime/dfa/__init__.py similarity index 100% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/dfa/__init__.py rename to cf_units/_udunits2_parser/_antlr4_runtime/dfa/__init__.py diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/error/DiagnosticErrorListener.py b/cf_units/_udunits2_parser/_antlr4_runtime/error/DiagnosticErrorListener.py similarity index 95% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/error/DiagnosticErrorListener.py rename to cf_units/_udunits2_parser/_antlr4_runtime/error/DiagnosticErrorListener.py index 679a3205..79637385 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/error/DiagnosticErrorListener.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/error/DiagnosticErrorListener.py @@ -26,11 +26,11 @@ from io import StringIO -from cf_units._udunits2_parser.parser._antlr4_runtime import DFA, Parser -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNConfigSet import ( +from cf_units._udunits2_parser._antlr4_runtime import DFA, Parser +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNConfigSet import ( ATNConfigSet, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.error.ErrorListener import ( +from cf_units._udunits2_parser._antlr4_runtime.error.ErrorListener import ( ErrorListener, ) diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/error/ErrorListener.py b/cf_units/_udunits2_parser/_antlr4_runtime/error/ErrorListener.py similarity index 100% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/error/ErrorListener.py rename to cf_units/_udunits2_parser/_antlr4_runtime/error/ErrorListener.py diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/error/ErrorStrategy.py b/cf_units/_udunits2_parser/_antlr4_runtime/error/ErrorStrategy.py similarity index 98% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/error/ErrorStrategy.py rename to cf_units/_udunits2_parser/_antlr4_runtime/error/ErrorStrategy.py index e79cf8fc..d9b22735 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/error/ErrorStrategy.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/error/ErrorStrategy.py @@ -3,20 +3,16 @@ # Use of this file is governed by the BSD 3-clause license that # can be found in the LICENSE.txt file in the project root. # -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNState import ( - ATNState, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.error.Errors import ( +from cf_units._udunits2_parser._antlr4_runtime.atn.ATNState import ATNState +from cf_units._udunits2_parser._antlr4_runtime.error.Errors import ( FailedPredicateException, InputMismatchException, NoViableAltException, ParseCancellationException, RecognitionException, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.IntervalSet import ( - IntervalSet, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.IntervalSet import IntervalSet +from cf_units._udunits2_parser._antlr4_runtime.Token import Token # need forward declaration Parser = None diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/error/Errors.py b/cf_units/_udunits2_parser/_antlr4_runtime/error/Errors.py similarity index 95% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/error/Errors.py rename to cf_units/_udunits2_parser/_antlr4_runtime/error/Errors.py index 051a231b..ee571b52 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/error/Errors.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/error/Errors.py @@ -35,15 +35,11 @@ def __init__(self, msg: str): # in the input, where it is in the ATN, the rule invocation stack, # and what kind of problem occurred. -from cf_units._udunits2_parser.parser._antlr4_runtime.InputStream import ( - InputStream, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.ParserRuleContext import ( +from cf_units._udunits2_parser._antlr4_runtime.InputStream import InputStream +from cf_units._udunits2_parser._antlr4_runtime.ParserRuleContext import ( ParserRuleContext, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.Recognizer import ( - Recognizer, -) +from cf_units._udunits2_parser._antlr4_runtime.Recognizer import Recognizer class RecognitionException(Exception): @@ -179,7 +175,7 @@ def __init__( ) s = recognizer._interp.atn.states[recognizer.state] trans = s.transitions[0] - from cf_units._udunits2_parser.parser._antlr4_runtime.atn.Transition import ( + from cf_units._udunits2_parser._antlr4_runtime.atn.Transition import ( PredicateTransition, ) diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/error/__init__.py b/cf_units/_udunits2_parser/_antlr4_runtime/error/__init__.py similarity index 100% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/error/__init__.py rename to cf_units/_udunits2_parser/_antlr4_runtime/error/__init__.py diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/Chunk.py b/cf_units/_udunits2_parser/_antlr4_runtime/tree/Chunk.py similarity index 100% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/Chunk.py rename to cf_units/_udunits2_parser/_antlr4_runtime/tree/Chunk.py diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/ParseTreeMatch.py b/cf_units/_udunits2_parser/_antlr4_runtime/tree/ParseTreeMatch.py similarity index 96% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/ParseTreeMatch.py rename to cf_units/_udunits2_parser/_antlr4_runtime/tree/ParseTreeMatch.py index 570effeb..92d9a80d 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/ParseTreeMatch.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/tree/ParseTreeMatch.py @@ -10,12 +10,10 @@ # from io import StringIO -from cf_units._udunits2_parser.parser._antlr4_runtime.tree.ParseTreePattern import ( +from cf_units._udunits2_parser._antlr4_runtime.tree.ParseTreePattern import ( ParseTreePattern, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.tree.Tree import ( - ParseTree, -) +from cf_units._udunits2_parser._antlr4_runtime.tree.Tree import ParseTree class ParseTreeMatch: diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/ParseTreePattern.py b/cf_units/_udunits2_parser/_antlr4_runtime/tree/ParseTreePattern.py similarity index 93% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/ParseTreePattern.py rename to cf_units/_udunits2_parser/_antlr4_runtime/tree/ParseTreePattern.py index 622c8d96..00770c94 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/ParseTreePattern.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/tree/ParseTreePattern.py @@ -8,12 +8,10 @@ # A pattern like {@code = ;} converted to a {@link ParseTree} by # {@link ParseTreePatternMatcher#compile(String, int)}. # -from cf_units._udunits2_parser.parser._antlr4_runtime.tree.ParseTreePatternMatcher import ( +from cf_units._udunits2_parser._antlr4_runtime.tree.ParseTreePatternMatcher import ( ParseTreePatternMatcher, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.tree.Tree import ( - ParseTree, -) +from cf_units._udunits2_parser._antlr4_runtime.tree.Tree import ParseTree class ParseTreePattern: diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/ParseTreePatternMatcher.py b/cf_units/_udunits2_parser/_antlr4_runtime/tree/ParseTreePatternMatcher.py similarity index 93% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/ParseTreePatternMatcher.py rename to cf_units/_udunits2_parser/_antlr4_runtime/tree/ParseTreePatternMatcher.py index bc440c83..18d554d8 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/ParseTreePatternMatcher.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/tree/ParseTreePatternMatcher.py @@ -61,38 +61,36 @@ # {@link #setDelimiters}. You must escape both start and stop strings # {@code \<} and {@code \>}.

# -from cf_units._udunits2_parser.parser._antlr4_runtime.CommonTokenStream import ( +from cf_units._udunits2_parser._antlr4_runtime.CommonTokenStream import ( CommonTokenStream, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.error.Errors import ( +from cf_units._udunits2_parser._antlr4_runtime.error.Errors import ( ParseCancellationException, RecognitionException, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.error.ErrorStrategy import ( +from cf_units._udunits2_parser._antlr4_runtime.error.ErrorStrategy import ( BailErrorStrategy, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.InputStream import ( - InputStream, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.Lexer import Lexer -from cf_units._udunits2_parser.parser._antlr4_runtime.ListTokenSource import ( +from cf_units._udunits2_parser._antlr4_runtime.InputStream import InputStream +from cf_units._udunits2_parser._antlr4_runtime.Lexer import Lexer +from cf_units._udunits2_parser._antlr4_runtime.ListTokenSource import ( ListTokenSource, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.ParserRuleContext import ( +from cf_units._udunits2_parser._antlr4_runtime.ParserRuleContext import ( ParserRuleContext, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token -from cf_units._udunits2_parser.parser._antlr4_runtime.tree.Chunk import ( +from cf_units._udunits2_parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.tree.Chunk import ( TagChunk, TextChunk, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.tree.RuleTagToken import ( +from cf_units._udunits2_parser._antlr4_runtime.tree.RuleTagToken import ( RuleTagToken, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.tree.TokenTagToken import ( +from cf_units._udunits2_parser._antlr4_runtime.tree.TokenTagToken import ( TokenTagToken, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.tree.Tree import ( +from cf_units._udunits2_parser._antlr4_runtime.tree.Tree import ( ParseTree, RuleNode, TerminalNode, @@ -179,7 +177,7 @@ def matchRuleIndex( def matchPattern(self, tree: ParseTree, pattern: ParseTreePattern): labels = dict() mismatchedNode = self.matchImpl(tree, pattern.patternTree, labels) - from cf_units._udunits2_parser.parser._antlr4_runtime.tree.ParseTreeMatch import ( + from cf_units._udunits2_parser._antlr4_runtime.tree.ParseTreeMatch import ( ParseTreeMatch, ) @@ -193,7 +191,7 @@ def compileTreePattern(self, pattern: str, patternRuleIndex: int): tokenList = self.tokenize(pattern) tokenSrc = ListTokenSource(tokenList) tokens = CommonTokenStream(tokenSrc) - from cf_units._udunits2_parser.parser._antlr4_runtime.ParserInterpreter import ( + from cf_units._udunits2_parser._antlr4_runtime.ParserInterpreter import ( ParserInterpreter, ) @@ -219,7 +217,7 @@ def compileTreePattern(self, pattern: str, patternRuleIndex: int): if tokens.LA(1) != Token.EOF: raise StartRuleDoesNotConsumeFullPattern() - from cf_units._udunits2_parser.parser._antlr4_runtime.tree.ParseTreePattern import ( + from cf_units._udunits2_parser._antlr4_runtime.tree.ParseTreePattern import ( ParseTreePattern, ) diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/RuleTagToken.py b/cf_units/_udunits2_parser/_antlr4_runtime/tree/RuleTagToken.py similarity index 96% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/RuleTagToken.py rename to cf_units/_udunits2_parser/_antlr4_runtime/tree/RuleTagToken.py index f914b903..3bb398c1 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/RuleTagToken.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/tree/RuleTagToken.py @@ -9,7 +9,7 @@ # rule; e.g., {@code }. These tokens are created for {@link TagChunk} # chunks where the tag corresponds to a parser rule. # -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.Token import Token class RuleTagToken(Token): diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/TokenTagToken.py b/cf_units/_udunits2_parser/_antlr4_runtime/tree/TokenTagToken.py similarity index 95% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/TokenTagToken.py rename to cf_units/_udunits2_parser/_antlr4_runtime/tree/TokenTagToken.py index 92639a71..7236f177 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/TokenTagToken.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/tree/TokenTagToken.py @@ -9,7 +9,7 @@ # {@code }. These tokens are created for {@link TagChunk} chunks where the # tag corresponds to a lexer rule or token type. # -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import CommonToken +from cf_units._udunits2_parser._antlr4_runtime.Token import CommonToken class TokenTagToken(CommonToken): diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/Tree.py b/cf_units/_udunits2_parser/_antlr4_runtime/tree/Tree.py similarity index 98% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/Tree.py rename to cf_units/_udunits2_parser/_antlr4_runtime/tree/Tree.py index 1d7e6220..77ea746e 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/Tree.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/tree/Tree.py @@ -7,7 +7,7 @@ # The basic notion of a tree has a parent, a payload, and a list of children. # It is the most abstract interface for all the trees used by ANTLR. # / -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.Token import Token INVALID_INTERVAL = (-1, -2) diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/Trees.py b/cf_units/_udunits2_parser/_antlr4_runtime/tree/Trees.py similarity index 92% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/Trees.py rename to cf_units/_udunits2_parser/_antlr4_runtime/tree/Trees.py index 812cfe2c..0005b441 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/Trees.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/tree/Trees.py @@ -8,17 +8,15 @@ # A set of utility routines useful for all kinds of ANTLR trees.# from io import StringIO -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token -from cf_units._udunits2_parser.parser._antlr4_runtime.tree.Tree import ( +from cf_units._udunits2_parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.tree.Tree import ( ErrorNode, ParseTree, RuleNode, TerminalNode, Tree, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.Utils import ( - escapeWhitespace, -) +from cf_units._udunits2_parser._antlr4_runtime.Utils import escapeWhitespace # need forward declaration Parser = None @@ -111,7 +109,7 @@ def findAllNodes(cls, t: ParseTree, index: int, findTokens: bool): def _findAllNodes( cls, t: ParseTree, index: int, findTokens: bool, nodes: list ): - from cf_units._udunits2_parser.parser._antlr4_runtime.ParserRuleContext import ( + from cf_units._udunits2_parser._antlr4_runtime.ParserRuleContext import ( ParserRuleContext, ) diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/__init__.py b/cf_units/_udunits2_parser/_antlr4_runtime/tree/__init__.py similarity index 100% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/tree/__init__.py rename to cf_units/_udunits2_parser/_antlr4_runtime/tree/__init__.py diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/xpath/XPath.py b/cf_units/_udunits2_parser/_antlr4_runtime/xpath/XPath.py similarity index 93% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/xpath/XPath.py rename to cf_units/_udunits2_parser/_antlr4_runtime/xpath/XPath.py index 1151089a..86aa8baf 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/xpath/XPath.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/xpath/XPath.py @@ -47,27 +47,23 @@ #

# Whitespace is not allowed.

# -from cf_units._udunits2_parser.parser._antlr4_runtime import ( +from cf_units._udunits2_parser._antlr4_runtime import ( CommonTokenStream, ParserRuleContext, TerminalNode, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.error.ErrorListener import ( +from cf_units._udunits2_parser._antlr4_runtime.error.ErrorListener import ( ErrorListener, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.error.Errors import ( +from cf_units._udunits2_parser._antlr4_runtime.error.Errors import ( LexerNoViableAltException, ) -from cf_units._udunits2_parser.parser._antlr4_runtime.InputStream import ( - InputStream, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.Parser import Parser -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token -from cf_units._udunits2_parser.parser._antlr4_runtime.tree.Tree import ( - ParseTree, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.tree.Trees import Trees -from cf_units._udunits2_parser.parser._antlr4_runtime.xpath.XPathLexer import ( +from cf_units._udunits2_parser._antlr4_runtime.InputStream import InputStream +from cf_units._udunits2_parser._antlr4_runtime.Parser import Parser +from cf_units._udunits2_parser._antlr4_runtime.Token import Token +from cf_units._udunits2_parser._antlr4_runtime.tree.Tree import ParseTree +from cf_units._udunits2_parser._antlr4_runtime.tree.Trees import Trees +from cf_units._udunits2_parser._antlr4_runtime.xpath.XPathLexer import ( XPathLexer, ) diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/xpath/XPathLexer.py b/cf_units/_udunits2_parser/_antlr4_runtime/xpath/XPathLexer.py similarity index 99% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/xpath/XPathLexer.py rename to cf_units/_udunits2_parser/_antlr4_runtime/xpath/XPathLexer.py index b8e960ff..ca5ae82e 100644 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/xpath/XPathLexer.py +++ b/cf_units/_udunits2_parser/_antlr4_runtime/xpath/XPathLexer.py @@ -1,7 +1,7 @@ # Generated from XPathLexer.g4 by ANTLR 4.13.1 import sys -from cf_units._udunits2_parser.parser._antlr4_runtime import * +from cf_units._udunits2_parser._antlr4_runtime import * if sys.version_info[1] > 5: from typing import TextIO diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/xpath/__init__.py b/cf_units/_udunits2_parser/_antlr4_runtime/xpath/__init__.py similarity index 100% rename from cf_units/_udunits2_parser/parser/_antlr4_runtime/xpath/__init__.py rename to cf_units/_udunits2_parser/_antlr4_runtime/xpath/__init__.py diff --git a/cf_units/_udunits2_parser/compile.py b/cf_units/_udunits2_parser/compile.py index 43d3de8c..be264ac5 100644 --- a/cf_units/_udunits2_parser/compile.py +++ b/cf_units/_udunits2_parser/compile.py @@ -68,8 +68,8 @@ def expand_lexer(source, target): fh.write(new_content) -def vendor_antlr4_runtime(parser_dir: Path): - antlr_dest = parser_dir / "_antlr4_runtime" +def vendor_antlr4_runtime(udunits2_parser_dir: Path): + antlr_dest = udunits2_parser_dir / "_antlr4_runtime" version_file = antlr_dest / "_antlr4_version.txt" existing_version: str | None = None if antlr_dest.exists(): @@ -113,11 +113,11 @@ def vendor_antlr4_runtime(parser_dir: Path): contents = py_file.read_text() contents = contents.replace( "import antlr4", - "import cf_units._udunits2_parser.parser._antlr4_runtime", + "import cf_units._udunits2_parser._antlr4_runtime", ) contents = contents.replace( "from antlr4", - "from cf_units._udunits2_parser.parser._antlr4_runtime", + "from cf_units._udunits2_parser._antlr4_runtime", ) py_file.write_text(contents) @@ -173,7 +173,7 @@ def main(): ) py_file.write_text(contents) - vendor_antlr4_runtime(parser_dir) + vendor_antlr4_runtime(HERE) # Reformat and lint fix the generated code. subprocess.run( diff --git a/cf_units/_udunits2_parser/parser/_antlr4_runtime/__init__.py b/cf_units/_udunits2_parser/parser/_antlr4_runtime/__init__.py deleted file mode 100644 index 8401d64d..00000000 --- a/cf_units/_udunits2_parser/parser/_antlr4_runtime/__init__.py +++ /dev/null @@ -1,59 +0,0 @@ -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATN import ATN -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ATNDeserializer import ( - ATNDeserializer, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.LexerATNSimulator import ( - LexerATNSimulator, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.ParserATNSimulator import ( - ParserATNSimulator, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.atn.PredictionMode import ( - PredictionMode, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.BufferedTokenStream import ( - TokenStream, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.CommonTokenStream import ( - CommonTokenStream, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.dfa.DFA import DFA -from cf_units._udunits2_parser.parser._antlr4_runtime.error.DiagnosticErrorListener import ( - DiagnosticErrorListener, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.error.Errors import ( - IllegalStateException, - NoViableAltException, - RecognitionException, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.error.ErrorStrategy import ( - BailErrorStrategy, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.FileStream import ( - FileStream, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.InputStream import ( - InputStream, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.Lexer import Lexer -from cf_units._udunits2_parser.parser._antlr4_runtime.Parser import Parser -from cf_units._udunits2_parser.parser._antlr4_runtime.ParserRuleContext import ( - ParserRuleContext, - RuleContext, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.PredictionContext import ( - PredictionContextCache, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.StdinStream import ( - StdinStream, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.Token import Token -from cf_units._udunits2_parser.parser._antlr4_runtime.tree.Tree import ( - ErrorNode, - ParseTreeListener, - ParseTreeVisitor, - ParseTreeWalker, - RuleNode, - TerminalNode, -) -from cf_units._udunits2_parser.parser._antlr4_runtime.Utils import str_list diff --git a/cf_units/_udunits2_parser/parser/udunits2Lexer.py b/cf_units/_udunits2_parser/parser/udunits2Lexer.py index a1652ef5..664d3604 100644 --- a/cf_units/_udunits2_parser/parser/udunits2Lexer.py +++ b/cf_units/_udunits2_parser/parser/udunits2Lexer.py @@ -1,7 +1,7 @@ # Generated by ANTLR 4.11.1 import sys -from cf_units._udunits2_parser.parser._antlr4_runtime import * +from cf_units._udunits2_parser._antlr4_runtime import * if sys.version_info[1] > 5: from typing import TextIO diff --git a/cf_units/_udunits2_parser/parser/udunits2Parser.py b/cf_units/_udunits2_parser/parser/udunits2Parser.py index d081860e..a7fc00ce 100644 --- a/cf_units/_udunits2_parser/parser/udunits2Parser.py +++ b/cf_units/_udunits2_parser/parser/udunits2Parser.py @@ -1,7 +1,7 @@ # Generated by ANTLR 4.11.1 import sys -from cf_units._udunits2_parser.parser._antlr4_runtime import * +from cf_units._udunits2_parser._antlr4_runtime import * if sys.version_info[1] > 5: from typing import TextIO @@ -1603,7 +1603,7 @@ def product(self, _p: int = 0): ) self.state = 51 if not self.precpred(self._ctx, 4): - from cf_units._udunits2_parser.parser._antlr4_runtime.error.Errors import ( + from cf_units._udunits2_parser._antlr4_runtime.error.Errors import ( FailedPredicateException, ) @@ -1623,7 +1623,7 @@ def product(self, _p: int = 0): ) self.state = 53 if not self.precpred(self._ctx, 3): - from cf_units._udunits2_parser.parser._antlr4_runtime.error.Errors import ( + from cf_units._udunits2_parser._antlr4_runtime.error.Errors import ( FailedPredicateException, ) @@ -1645,7 +1645,7 @@ def product(self, _p: int = 0): ) self.state = 56 if not self.precpred(self._ctx, 2): - from cf_units._udunits2_parser.parser._antlr4_runtime.error.Errors import ( + from cf_units._udunits2_parser._antlr4_runtime.error.Errors import ( FailedPredicateException, ) @@ -1667,7 +1667,7 @@ def product(self, _p: int = 0): ) self.state = 59 if not self.precpred(self._ctx, 1): - from cf_units._udunits2_parser.parser._antlr4_runtime.error.Errors import ( + from cf_units._udunits2_parser._antlr4_runtime.error.Errors import ( FailedPredicateException, ) diff --git a/cf_units/_udunits2_parser/parser/udunits2ParserVisitor.py b/cf_units/_udunits2_parser/parser/udunits2ParserVisitor.py index 3817e550..193cf2c6 100644 --- a/cf_units/_udunits2_parser/parser/udunits2ParserVisitor.py +++ b/cf_units/_udunits2_parser/parser/udunits2ParserVisitor.py @@ -1,5 +1,5 @@ # Generated by ANTLR 4.11.1 -from cf_units._udunits2_parser.parser._antlr4_runtime import * +from cf_units._udunits2_parser._antlr4_runtime import * if __name__ is not None and "." in __name__: from .udunits2Parser import udunits2Parser diff --git a/pyproject.toml b/pyproject.toml index 932266ee..09480972 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -110,6 +110,7 @@ local_scheme = "dirty-tag" # Ignore generated code. exclude = [ "cf_units/_udunits2_parser/parser", + "cf_units/_udunits2_parser/_antlr4_runtime", ] line-length = 79