diff --git a/.ci/aptPackagesToInstall.txt b/.ci/aptPackagesToInstall.txt new file mode 100644 index 0000000..e69de29 diff --git a/.ci/pythonPackagesToInstallFromGit.txt b/.ci/pythonPackagesToInstallFromGit.txt new file mode 100644 index 0000000..9a7f9dd --- /dev/null +++ b/.ci/pythonPackagesToInstallFromGit.txt @@ -0,0 +1,5 @@ +https://github.com/UniGrammar/UniGrammarRuntimeCore.py +https://github.com/UniGrammar/UniGrammarRuntime.py +https://github.com/igordejanovic/parglare.git +https://github.com/neogeny/TatSu.git +https://github.com/erikrose/parsimonious.git diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..62d9a3f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +charset = utf-8 +indent_style = tab +indent_size = 4 +insert_final_newline = true +end_of_line = lf + +[*.{yml,yaml,yug}] +indent_style = space +indent_size = 2 + +[grammars/*.txt] +insert_final_newline = false diff --git a/.github/.templateMarker b/.github/.templateMarker new file mode 100644 index 0000000..5e3a3e0 --- /dev/null +++ b/.github/.templateMarker @@ -0,0 +1 @@ +KOLANICH/python_project_boilerplate.py diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..89ff339 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + allow: + - dependency-type: "all" diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..805a383 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,15 @@ +name: CI +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - name: typical python workflow + uses: KOLANICH-GHActions/typical-python-workflow@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d957b94 --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +/grammars/apt.interp +/grammars/apt.tokens +/grammars/aptLexer.* +/grammars/*.py +/grammars/*.jar +/grammars/*.java +/grammars/*.class +/grammars/grammar.pgt + +__pycache__ +*.pyc +*.pyo +/*.egg-info +*.srctrlbm +*.srctrldb +build +dist +.eggs +monkeytype.sqlite3 +/.ipynb_checkpoints + +.ninja_log +.ninja_deps +/tests/lan_proto_test diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..2698029 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,55 @@ +image: registry.gitlab.com/kolanich-subgroups/docker-images/fixed_python:latest + +variables: + DOCKER_DRIVER: overlay2 + SAST_ANALYZER_IMAGE_TAG: latest + SAST_DISABLE_DIND: "true" + SAST_CONFIDENCE_LEVEL: 5 + CODECLIMATE_VERSION: latest + +include: + - template: SAST.gitlab-ci.yml + - template: Code-Quality.gitlab-ci.yml + +build: + tags: + - shared + - linux + stage: build + interruptible: true + variables: + GIT_DEPTH: "1" + PYTHONUSERBASE: "${CI_PROJECT_DIR}/python_user_packages" + + before_script: + - export PATH="$PATH:$PYTHONUSERBASE/bin" # don't move into `variables` + #- git clone --depth=1 --filter=sparse:path=src/python https://github.com/waxeye-org/waxeye.git + - git clone --depth=1 https://github.com/waxeye-org/waxeye.git + - cd ./waxeye/src/python + - python3 ./setup.py bdist_wheel + - pip3 install --upgrade ./dist/*.whl + - cd ../../../ + + cache: + paths: + - /usr/local/site-packages + - /usr/local/lib/python*/site-packages + + script: + - python3 setup.py bdist_wheel + - pip3 install --user --upgrade ./dist/*.whl + - cd ./tests + #- coverage run -a --branch --source=AptSourcesList -m pytest --junitxml=./rspec.xml --forked ./test*.py + #- coverage report -m || true + #- coveralls || true + #- codecov || true + #- cd .. + - mkdir wheels + - mv ./dist/*.whl ./wheels/AptSourcesList-0.CI-py3-none-any.whl + + artifacts: + paths: + - wheels + - $PYTHONUSERBASE + reports: + junit: ./rspec.xml diff --git a/AptSourcesList/Record.py b/AptSourcesList/Record.py new file mode 100644 index 0000000..02e5fb7 --- /dev/null +++ b/AptSourcesList/Record.py @@ -0,0 +1,29 @@ +class Record: + """Represents a single line in sources.list mentioning a source.""" + + __slots__ = ("commented", "type", "options", "schemaModifiers", "uri", "distribution", "components") + + def __init__(self): + self.commented = None + self.type = None + self.options = None + self.uri = None + self.distribution = None + self.components = None + self.schemaModifiers = None + + def serializeOptions(self) -> str: + if self.options: + return "[" + ",".join(k + "=" + v for k, v in self.options.items()) + "]" + return "" + + def serializeComponents(self) -> str: + if self.components: + return " ".join(self.components) + return "" + + def __str__(self) -> str: + return " ".join(filter(None, ("#" if self.commented else "", self.type, self.serializeOptions(), "+".join(self.schemaModifiers + [self.uri,]), self.distribution, self.serializeComponents()))) + + def __repr__(self) -> str: + return self.__class__.__name__ + "(" + repr(str(self)) + ")" diff --git a/AptSourcesList/RecordParser.py b/AptSourcesList/RecordParser.py new file mode 100644 index 0000000..c0a5d9c --- /dev/null +++ b/AptSourcesList/RecordParser.py @@ -0,0 +1,81 @@ +import typing +from abc import ABC, abstractmethod +from .Record import Record + + +class RecordParser(ABC): + """A class commanding the parsing. Calls the generated parser and postporcesses its output""" + + __slots__ = () + + EX_CLASS = Exception + + @abstractmethod + def iterateList(self, lst): + raise NotImplementedError() + + @abstractmethod + def isList(self, lst): + raise NotImplementedError() + + @abstractmethod + def parseURI(self, rec, uri): + raise NotImplementedError() + + def mergeShit(self, lst: typing.Any) -> str: + res = [] + stack = [] + if self.isList(lst): + for t in self.iterateList(lst): + res.append(self.mergeShit(t)) + else: + res.append(self.getTextFromToken(lst)) + return "".join(res) + + def descendIntoURISchema(self, schema: typing.Any) -> typing.Iterator[str]: + restWords = schema + yield self.getTextFromToken(schema.word) + if schema.restWords: + for w in self.iterateList(schema.restWords): + res = self.getTextFromToken(w.word) + yield res + + def __call__(self, s: str) -> Record: + rec = Record() + parsed = self.parse(s) + + try: + commented = bool(self.getTextFromToken(parsed.commented)) + except: + commented = False + + rec.commented = commented + rec.type = self.getTextFromToken(parsed.rType) + rec.options = parsed.options + rec.uri = parsed.uri + rec.distribution = self.mergeShit(parsed.distribution) + rec.components = parsed.components + rec.schemaModifiers = None + + if rec.uri: + rec.uri = self.parseURI(rec, rec.uri) + + if rec.options: + if rec.options.pairs: + pairs = rec.options.pairs + res = [pairs.firstOption] + + try: + restOptions = pairs.restOptions + except: + restOptions = [] + + for p in self.iterateList(restOptions): + res.append(p.option) + + rec.options = res + rec.options = {self.getTextFromToken(p.key): self.mergeShit(p.value) for p in rec.options} + + if rec.components: + rec.components = [self.mergeShit(c.cId) for c in self.iterateList(rec.components)] + return rec diff --git a/AptSourcesList/__init__.py b/AptSourcesList/__init__.py new file mode 100644 index 0000000..f0afd26 --- /dev/null +++ b/AptSourcesList/__init__.py @@ -0,0 +1,62 @@ +__all__ = ("parseLine", "parseSourceList") + +import typing +from pathlib import Path +import _io + +from UniGrammarRuntime.ParserBundle import ParserBundle + + +thisFile = Path(__file__).absolute() +thisDir = thisFile.parent +bundleDir = thisDir / "parserBundle" + +bundle = ParserBundle(bundleDir) + +grammar = bundle.grammars["apt_source"] +wrapper = grammar.getWrapper("parglare") + + +parseLine = wrapper + + +defaultSourceList = None + + +def getDefaultSourceList(): + global defaultSourceList + + if defaultSourceList is not None: + return defaultSourceList + + try: + from fuckapt import sourcesListFile + + defaultSourceList = sourcesListFile + except ImportError: + defaultSourceList = Path("/etc/apt/sources.list") + + return defaultSourceList + + +def parseSourceList(lst: typing.Union[str, Path, _io._TextIOBase] = None): + """Parses whole `sources.list`""" + if lst is None: + lst = getDefaultSourceList() + + if isinstance(lst, str): + lines = lst.splitlines() + elif isinstance(lst, Path): + lines = lst.open("rt", encoding="utf-8") + elif isinstance(lst, _io._TextIOBase): + lines = lst + else: + raise ValueError("`lst` has wrong type") + + for l in lines: + l = l.strip() + if l: + parsed = parseLine(l) + yield parsed + else: + yield "" diff --git a/AptSourcesList/__main__.py b/AptSourcesList/__main__.py new file mode 100644 index 0000000..b8ad677 --- /dev/null +++ b/AptSourcesList/__main__.py @@ -0,0 +1,5 @@ +if __name__ == "__main__": + from . import parseSourceList + from pprint import pprint + + pprint(list(parseSourceList())) diff --git a/AptSourcesList/parserBundle/__init__.py b/AptSourcesList/parserBundle/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/AptSourcesList/parserBundle/compiled/TatSu/__init__.py b/AptSourcesList/parserBundle/compiled/TatSu/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/AptSourcesList/parserBundle/compiled/TatSu/apt_source.py b/AptSourcesList/parserBundle/compiled/TatSu/apt_source.py new file mode 100644 index 0000000..f6bf823 --- /dev/null +++ b/AptSourcesList/parserBundle/compiled/TatSu/apt_source.py @@ -0,0 +1,708 @@ +#!/usr/bin/env python + +# CAVEAT UTILITOR +# +# This file was automatically generated by TatSu. +# +# https://pypi.python.org/pypi/tatsu/ +# +# Any changes you make to it will be overwritten the next time +# the file is generated. + +from __future__ import annotations + +import sys + +from tatsu.buffering import Buffer +from tatsu.parsing import Parser +from tatsu.parsing import tatsumasu +from tatsu.parsing import leftrec, nomemo, isname # noqa +from tatsu.infos import ParserConfig +from tatsu.util import re, generic_main # noqa + + +KEYWORDS = {} # type: ignore + + +class apt_sourceBuffer(Buffer): + def __init__(self, text, /, config: ParserConfig = None, **settings): + config = ParserConfig.new( + config, + owner=self, + whitespace=None, + nameguard=None, + comments_re=None, + eol_comments_re=None, + ignorecase=False, + namechars='', + parseinfo=False, + ) + config = config.replace(**settings) + super().__init__(text, config=config) + + +class apt_sourceParser(Parser): + def __init__(self, /, config: ParserConfig = None, **settings): + config = ParserConfig.new( + config, + owner=self, + whitespace=None, + nameguard=None, + comments_re=None, + eol_comments_re=None, + ignorecase=False, + namechars='', + parseinfo=False, + keywords=KEYWORDS, + ) + config = config.replace(**settings) + super().__init__(config=config) + + @tatsumasu() + def _record_(self): # noqa + self._commenterR_opt_our_() + self.name_last_node('commented') + self._TypeR_() + self.name_last_node('rType') + self._WSS_() + self._optionsR_opt_our_() + self.name_last_node('options') + self._uriR_() + self.name_last_node('uri') + self._WSS_() + self._wordWithDash_() + self.name_last_node('distribution') + self._componentsR_() + self.name_last_node('components') + with self._optional(): + self._WSS_() + self._define( + ['commented', 'components', 'distribution', 'options', 'rType', 'uri'], + [] + ) + + @tatsumasu() + def _commenterR_opt_our_(self): # noqa + with self._optional(): + self._commenterR_() + + @tatsumasu() + def _optionsR_opt_our_(self): # noqa + with self._optional(): + self._optionsR_() + + @tatsumasu() + def _component_(self): # noqa + self._WSS_() + self._wordWithDash_() + self.name_last_node('cId') + self._define( + ['cId'], + [] + ) + + @tatsumasu() + def _componentsR_(self): # noqa + + def block0(): + self._component_() + self._positive_closure(block0) + + @tatsumasu() + def _optionsR_(self): # noqa + self._OptionsStart_() + self._optionsList_() + self.name_last_node('pairs') + self._OptionsEnd_() + self._WSS_() + self._define( + ['pairs'], + [] + ) + + @tatsumasu() + def _optionsList_(self): # noqa + self._optionR_() + self.name_last_node('firstOption') + self._additionalOptions_() + self.name_last_node('restOptions') + self._define( + ['firstOption', 'restOptions'], + [] + ) + + @tatsumasu() + def _additionalOptions_(self): # noqa + + def block0(): + self._additionalOption_() + self._closure(block0) + + @tatsumasu() + def _additionalOption_(self): # noqa + self._OptionsSeparator_() + self.name_last_node('separator') + self._optionR_() + self.name_last_node('option') + self._define( + ['option', 'separator'], + [] + ) + + @tatsumasu() + def _optionR_(self): # noqa + self._OptionName_() + self.name_last_node('key') + self._OptionNameValueSeparator_() + self._optionValue_() + self.name_last_node('value') + self._define( + ['key', 'value'], + [] + ) + + @tatsumasu() + def _wordWithDashSegment_(self): # noqa + with self._choice(): + with self._option(): + self._Word_() + with self._option(): + self._Dash_() + self._error( + 'expecting one of: ' + "'-' " + '[0-9A-Z_a-z]' + ) + + @tatsumasu() + def _wordWithDash_(self): # noqa + + def block0(): + self._wordWithDashSegment_() + self._positive_closure(block0) + + @tatsumasu() + def _optionValueSegment_(self): # noqa + with self._choice(): + with self._option(): + self._Word_() + with self._option(): + self._PunctuationAllowedInOptionValue_() + with self._option(): + self._Dash_() + with self._option(): + self._OptionName_() + with self._option(): + self._CdromSchema_() + with self._option(): + self._TypeR_() + with self._option(): + self._Plus_() + with self._option(): + self._Colon_() + self._error( + 'expecting one of: ' + "'+' '-' ':' 'allow-downgrade-to-" + "insecure' 'allow-insecure' 'allow-weak'" + "'arch' 'by-hash' 'cdrom:' 'check-date'" + "'check-valid-until' 'date-max-future'" + "'deb' 'deb-src' 'inrelease-path' 'lang'" + "'pdiffs' 'signed-by' 'target' 'trusted'" + "'valid-until-max' 'valid-until-min'" + ' ' + ' ' + '' + ' [0-9A-Z_a-z]' + '[\\/\\.]' + ) + + @tatsumasu() + def _nonSquareBracketStringSegment_(self): # noqa + with self._choice(): + with self._option(): + self._NonWhitespaceNonOptionValueNonSquareRightBracketNonEq_() + with self._option(): + self._optionValueSegment_() + with self._option(): + self._OptionNameValueSeparator_() + self._error( + 'expecting one of: ' + "'+' '-' ':' '=' 'allow-downgrade-to-" + "insecure' 'allow-insecure' 'allow-weak'" + "'arch' 'by-hash' 'cdrom:' 'check-date'" + "'check-valid-until' 'date-max-future'" + "'deb' 'deb-src' 'inrelease-path' 'lang'" + "'pdiffs' 'signed-by' 'target' 'trusted'" + "'valid-until-max' 'valid-until-min'" + ' ' + ' ' + '' + ' ' + ' [0-9A-Z_a-z] [\\/\\.]' + '[^\\t-\\r\\ "\\#\'\\+-:=A-\\]_a-z]' + ) + + @tatsumasu() + def _nonSpaceStringSegment_(self): # noqa + with self._choice(): + with self._option(): + self._nonSquareBracketStringSegment_() + with self._option(): + self._OptionsEnd_() + self._error( + 'expecting one of: ' + "'+' '-' ':' '=' ']' 'allow-downgrade-to-" + "insecure' 'allow-insecure' 'allow-weak'" + "'arch' 'by-hash' 'cdrom:' 'check-date'" + "'check-valid-until' 'date-max-future'" + "'deb' 'deb-src' 'inrelease-path' 'lang'" + "'pdiffs' 'signed-by' 'target' 'trusted'" + "'valid-until-max' 'valid-until-min'" + ' ' + ' ' + ' ' + ' ' + '' + ' [0-9A-Z_a-z] [\\/\\.]' + '[^\\t-\\r\\ "\\#\'\\+-:=A-\\]_a-z]' + ) + + @tatsumasu() + def _optionValue_(self): # noqa + + def block0(): + self._optionValueSegment_() + self._positive_closure(block0) + + @tatsumasu() + def _nonSquareBracketString_(self): # noqa + + def block0(): + self._nonSquareBracketStringSegment_() + self._positive_closure(block0) + + @tatsumasu() + def _nonSpaceString_(self): # noqa + + def block0(): + self._nonSpaceStringSegment_() + self._positive_closure(block0) + + @tatsumasu() + def _singleTickEnclosedString_(self): # noqa + self._SingleTick_() + self._nonSquareBracketString_() + self._SingleTick_() + + @tatsumasu() + def _doubleTickEnclosedString_(self): # noqa + self._DoubleTick_() + self._nonSquareBracketString_() + self._DoubleTick_() + + @tatsumasu() + def _tickEnclosedString_(self): # noqa + with self._choice(): + with self._option(): + self._singleTickEnclosedString_() + with self._option(): + self._doubleTickEnclosedString_() + self._error( + 'expecting one of: ' + '"\'" \'"\' ' + '' + '' + ) + + @tatsumasu() + def _enclosedString_(self): # noqa + self._OptionsStart_() + self._tickEnclosedString_() + self._OptionsEnd_() + + @tatsumasu() + def _cdromURI_(self): # noqa + self._CdromSchema_() + self._Colon_() + self._enclosedString_() + self._nonSpaceString_() + + @tatsumasu() + def _uriSchema_(self): # noqa + self._Word_() + self.name_last_node('word') + self._restSchemaWords_() + self.name_last_node('restWords') + self._define( + ['restWords', 'word'], + [] + ) + + @tatsumasu() + def _commenterR_(self): # noqa + self._CommentMarker_() + self._WSS_() + + @tatsumasu() + def _wordWithPlus_(self): # noqa + self._Plus_() + self._Word_() + self.name_last_node('word') + self._define( + ['word'], + [] + ) + + @tatsumasu() + def _restSchemaWords_(self): # noqa + + def block0(): + self._wordWithPlus_() + self._closure(block0) + + @tatsumasu() + def _genericURI_(self): # noqa + self._uriSchema_() + self.name_last_node('schema') + self._Colon_() + self._nonSpaceString_() + self.name_last_node('restOfURI') + self._define( + ['restOfURI', 'schema'], + [] + ) + + @tatsumasu() + def _uriR_(self): # noqa + with self._choice(): + with self._option(): + self._cdromURI_() + self.name_last_node('cdrom') + self._define( + ['cdrom'], + [] + ) + with self._option(): + self._genericURI_() + self.name_last_node('generic') + self._define( + ['generic'], + [] + ) + self._error( + 'expecting one of: ' + "'cdrom:' " + ' ' + '[0-9A-Z_a-z]' + ) + self._define( + ['cdrom', 'generic'], + [] + ) + + @tatsumasu() + def _TypeR_(self): # noqa + with self._choice(): + with self._option(): + self._token('deb') + with self._option(): + self._token('deb-src') + self._error( + 'expecting one of: ' + "'deb' 'deb-src'" + ) + + @tatsumasu() + def _OptionName_(self): # noqa + with self._choice(): + with self._option(): + self._token('arch') + with self._option(): + self._token('lang') + with self._option(): + self._token('target') + with self._option(): + self._token('pdiffs') + with self._option(): + self._token('by-hash') + with self._option(): + self._token('valid-until-max') + with self._option(): + self._token('allow-downgrade-to-insecure') + with self._option(): + self._token('allow-weak') + with self._option(): + self._token('allow-insecure') + with self._option(): + self._token('trusted') + with self._option(): + self._token('signed-by') + with self._option(): + self._token('check-valid-until') + with self._option(): + self._token('valid-until-min') + with self._option(): + self._token('check-date') + with self._option(): + self._token('inrelease-path') + with self._option(): + self._token('date-max-future') + self._error( + 'expecting one of: ' + "'allow-downgrade-to-insecure' 'allow-" + "insecure' 'allow-weak' 'arch' 'by-hash'" + "'check-date' 'check-valid-until' 'date-" + "max-future' 'inrelease-path' 'lang'" + "'pdiffs' 'signed-by' 'target' 'trusted'" + "'valid-until-max' 'valid-until-min'" + ) + + @tatsumasu() + def _CdromSchema_(self): # noqa + self._token('cdrom:') + + @tatsumasu() + def _WS_(self): # noqa + self._pattern('[\\t-\\r\\ ]') + + @tatsumasu() + def _PunctuationAllowedInOptionValue_(self): # noqa + self._pattern('[\\/\\.]') + + @tatsumasu() + def _OptionsStart_(self): # noqa + self._token('[') + + @tatsumasu() + def _OptionsEnd_(self): # noqa + self._token(']') + + @tatsumasu() + def _OptionNameValueSeparator_(self): # noqa + self._token('=') + + @tatsumasu() + def _CommentMarker_(self): # noqa + self._token('#') + + @tatsumasu() + def _Plus_(self): # noqa + self._token('+') + + @tatsumasu() + def _Colon_(self): # noqa + self._token(':') + + @tatsumasu() + def _OptionsSeparator_(self): # noqa + self._token(',') + + @tatsumasu() + def _Dash_(self): # noqa + self._token('-') + + @tatsumasu() + def _SingleTick_(self): # noqa + self._token("'") + + @tatsumasu() + def _DoubleTick_(self): # noqa + self._token('"') + + @tatsumasu() + def _WordChar_(self): # noqa + self._pattern('[0-9A-Z_a-z]') + + @tatsumasu() + def _NonWhitespaceNonOptionValueNonSquareRightBracketNonEq_(self): # noqa + self._pattern('[^\\t-\\r\\ "\\#\'\\+-:=A-\\]_a-z]') + + @tatsumasu() + def _Word_(self): # noqa + + def block0(): + self._WordChar_() + self._positive_closure(block0) + + @tatsumasu() + def _WSS_(self): # noqa + + def block0(): + self._WS_() + self._positive_closure(block0) + + +class apt_sourceSemantics: + def record(self, ast): # noqa + return ast + + def commenterR_opt_our(self, ast): # noqa + return ast + + def optionsR_opt_our(self, ast): # noqa + return ast + + def component(self, ast): # noqa + return ast + + def componentsR(self, ast): # noqa + return ast + + def optionsR(self, ast): # noqa + return ast + + def optionsList(self, ast): # noqa + return ast + + def additionalOptions(self, ast): # noqa + return ast + + def additionalOption(self, ast): # noqa + return ast + + def optionR(self, ast): # noqa + return ast + + def wordWithDashSegment(self, ast): # noqa + return ast + + def wordWithDash(self, ast): # noqa + return ast + + def optionValueSegment(self, ast): # noqa + return ast + + def nonSquareBracketStringSegment(self, ast): # noqa + return ast + + def nonSpaceStringSegment(self, ast): # noqa + return ast + + def optionValue(self, ast): # noqa + return ast + + def nonSquareBracketString(self, ast): # noqa + return ast + + def nonSpaceString(self, ast): # noqa + return ast + + def singleTickEnclosedString(self, ast): # noqa + return ast + + def doubleTickEnclosedString(self, ast): # noqa + return ast + + def tickEnclosedString(self, ast): # noqa + return ast + + def enclosedString(self, ast): # noqa + return ast + + def cdromURI(self, ast): # noqa + return ast + + def uriSchema(self, ast): # noqa + return ast + + def commenterR(self, ast): # noqa + return ast + + def wordWithPlus(self, ast): # noqa + return ast + + def restSchemaWords(self, ast): # noqa + return ast + + def genericURI(self, ast): # noqa + return ast + + def uriR(self, ast): # noqa + return ast + + def TypeR(self, ast): # noqa + return ast + + def OptionName(self, ast): # noqa + return ast + + def CdromSchema(self, ast): # noqa + return ast + + def WS(self, ast): # noqa + return ast + + def PunctuationAllowedInOptionValue(self, ast): # noqa + return ast + + def OptionsStart(self, ast): # noqa + return ast + + def OptionsEnd(self, ast): # noqa + return ast + + def OptionNameValueSeparator(self, ast): # noqa + return ast + + def CommentMarker(self, ast): # noqa + return ast + + def Plus(self, ast): # noqa + return ast + + def Colon(self, ast): # noqa + return ast + + def OptionsSeparator(self, ast): # noqa + return ast + + def Dash(self, ast): # noqa + return ast + + def SingleTick(self, ast): # noqa + return ast + + def DoubleTick(self, ast): # noqa + return ast + + def WordChar(self, ast): # noqa + return ast + + def NonWhitespaceNonOptionValueNonSquareRightBracketNonEq(self, ast): # noqa + return ast + + def Word(self, ast): # noqa + return ast + + def WSS(self, ast): # noqa + return ast + + +def main(filename, start=None, **kwargs): + if start is None: + start = 'record' + if not filename or filename == '-': + text = sys.stdin.read() + else: + with open(filename) as f: + text = f.read() + parser = apt_sourceParser() + return parser.parse( + text, + rule_name=start, + filename=filename, + **kwargs + ) + + +if __name__ == '__main__': + import json + from tatsu.util import asjson + + ast = generic_main(main, apt_sourceParser, name='apt_source') + data = asjson(ast) + print(json.dumps(data, indent=2)) diff --git a/AptSourcesList/parserBundle/compiled/__init__.py b/AptSourcesList/parserBundle/compiled/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/AptSourcesList/parserBundle/compiled/antlr4/__init__.py b/AptSourcesList/parserBundle/compiled/antlr4/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/AptSourcesList/parserBundle/compiled/antlr4/apt_sourceLexer.interp b/AptSourcesList/parserBundle/compiled/antlr4/apt_sourceLexer.interp new file mode 100644 index 0000000..14bb532 --- /dev/null +++ b/AptSourcesList/parserBundle/compiled/antlr4/apt_sourceLexer.interp @@ -0,0 +1,74 @@ +token literal names: +null +null +null +'cdrom:' +null +null +null +null +'[' +']' +'=' +'#' +'+' +':' +',' +'-' +'\'' +'"' +null +null + +token symbolic names: +null +TypeR +OptionName +CdromSchema +Word +WSS +WS +PunctuationAllowedInOptionValue +OptionsStart +OptionsEnd +OptionNameValueSeparator +CommentMarker +Plus +Colon +OptionsSeparator +Dash +SingleTick +DoubleTick +WordChar +NonWhitespaceNonOptionValueNonSquareRightBracketNonEq + +rule names: +TypeR +OptionName +CdromSchema +Word +WSS +WS +PunctuationAllowedInOptionValue +OptionsStart +OptionsEnd +OptionNameValueSeparator +CommentMarker +Plus +Colon +OptionsSeparator +Dash +SingleTick +DoubleTick +WordChar +NonWhitespaceNonOptionValueNonSquareRightBracketNonEq + +channel names: +DEFAULT_TOKEN_CHANNEL +HIDDEN + +mode names: +DEFAULT_MODE + +atn: +[4, 0, 19, 278, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 3, 0, 50, 8, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 232, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 4, 3, 242, 8, 3, 11, 3, 12, 3, 243, 1, 4, 4, 4, 247, 8, 4, 11, 4, 12, 4, 248, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 0, 0, 19, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 1, 0, 4, 2, 0, 9, 13, 32, 32, 1, 0, 46, 47, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 10, 0, 0, 8, 14, 31, 33, 33, 36, 38, 40, 42, 59, 60, 62, 64, 94, 94, 96, 96, 123, 255, 295, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 1, 49, 1, 0, 0, 0, 3, 231, 1, 0, 0, 0, 5, 233, 1, 0, 0, 0, 7, 241, 1, 0, 0, 0, 9, 246, 1, 0, 0, 0, 11, 250, 1, 0, 0, 0, 13, 252, 1, 0, 0, 0, 15, 254, 1, 0, 0, 0, 17, 256, 1, 0, 0, 0, 19, 258, 1, 0, 0, 0, 21, 260, 1, 0, 0, 0, 23, 262, 1, 0, 0, 0, 25, 264, 1, 0, 0, 0, 27, 266, 1, 0, 0, 0, 29, 268, 1, 0, 0, 0, 31, 270, 1, 0, 0, 0, 33, 272, 1, 0, 0, 0, 35, 274, 1, 0, 0, 0, 37, 276, 1, 0, 0, 0, 39, 40, 5, 100, 0, 0, 40, 41, 5, 101, 0, 0, 41, 50, 5, 98, 0, 0, 42, 43, 5, 100, 0, 0, 43, 44, 5, 101, 0, 0, 44, 45, 5, 98, 0, 0, 45, 46, 5, 45, 0, 0, 46, 47, 5, 115, 0, 0, 47, 48, 5, 114, 0, 0, 48, 50, 5, 99, 0, 0, 49, 39, 1, 0, 0, 0, 49, 42, 1, 0, 0, 0, 50, 2, 1, 0, 0, 0, 51, 52, 5, 97, 0, 0, 52, 53, 5, 114, 0, 0, 53, 54, 5, 99, 0, 0, 54, 232, 5, 104, 0, 0, 55, 56, 5, 108, 0, 0, 56, 57, 5, 97, 0, 0, 57, 58, 5, 110, 0, 0, 58, 232, 5, 103, 0, 0, 59, 60, 5, 116, 0, 0, 60, 61, 5, 97, 0, 0, 61, 62, 5, 114, 0, 0, 62, 63, 5, 103, 0, 0, 63, 64, 5, 101, 0, 0, 64, 232, 5, 116, 0, 0, 65, 66, 5, 112, 0, 0, 66, 67, 5, 100, 0, 0, 67, 68, 5, 105, 0, 0, 68, 69, 5, 102, 0, 0, 69, 70, 5, 102, 0, 0, 70, 232, 5, 115, 0, 0, 71, 72, 5, 98, 0, 0, 72, 73, 5, 121, 0, 0, 73, 74, 5, 45, 0, 0, 74, 75, 5, 104, 0, 0, 75, 76, 5, 97, 0, 0, 76, 77, 5, 115, 0, 0, 77, 232, 5, 104, 0, 0, 78, 79, 5, 118, 0, 0, 79, 80, 5, 97, 0, 0, 80, 81, 5, 108, 0, 0, 81, 82, 5, 105, 0, 0, 82, 83, 5, 100, 0, 0, 83, 84, 5, 45, 0, 0, 84, 85, 5, 117, 0, 0, 85, 86, 5, 110, 0, 0, 86, 87, 5, 116, 0, 0, 87, 88, 5, 105, 0, 0, 88, 89, 5, 108, 0, 0, 89, 90, 5, 45, 0, 0, 90, 91, 5, 109, 0, 0, 91, 92, 5, 97, 0, 0, 92, 232, 5, 120, 0, 0, 93, 94, 5, 97, 0, 0, 94, 95, 5, 108, 0, 0, 95, 96, 5, 108, 0, 0, 96, 97, 5, 111, 0, 0, 97, 98, 5, 119, 0, 0, 98, 99, 5, 45, 0, 0, 99, 100, 5, 100, 0, 0, 100, 101, 5, 111, 0, 0, 101, 102, 5, 119, 0, 0, 102, 103, 5, 110, 0, 0, 103, 104, 5, 103, 0, 0, 104, 105, 5, 114, 0, 0, 105, 106, 5, 97, 0, 0, 106, 107, 5, 100, 0, 0, 107, 108, 5, 101, 0, 0, 108, 109, 5, 45, 0, 0, 109, 110, 5, 116, 0, 0, 110, 111, 5, 111, 0, 0, 111, 112, 5, 45, 0, 0, 112, 113, 5, 105, 0, 0, 113, 114, 5, 110, 0, 0, 114, 115, 5, 115, 0, 0, 115, 116, 5, 101, 0, 0, 116, 117, 5, 99, 0, 0, 117, 118, 5, 117, 0, 0, 118, 119, 5, 114, 0, 0, 119, 232, 5, 101, 0, 0, 120, 121, 5, 97, 0, 0, 121, 122, 5, 108, 0, 0, 122, 123, 5, 108, 0, 0, 123, 124, 5, 111, 0, 0, 124, 125, 5, 119, 0, 0, 125, 126, 5, 45, 0, 0, 126, 127, 5, 119, 0, 0, 127, 128, 5, 101, 0, 0, 128, 129, 5, 97, 0, 0, 129, 232, 5, 107, 0, 0, 130, 131, 5, 97, 0, 0, 131, 132, 5, 108, 0, 0, 132, 133, 5, 108, 0, 0, 133, 134, 5, 111, 0, 0, 134, 135, 5, 119, 0, 0, 135, 136, 5, 45, 0, 0, 136, 137, 5, 105, 0, 0, 137, 138, 5, 110, 0, 0, 138, 139, 5, 115, 0, 0, 139, 140, 5, 101, 0, 0, 140, 141, 5, 99, 0, 0, 141, 142, 5, 117, 0, 0, 142, 143, 5, 114, 0, 0, 143, 232, 5, 101, 0, 0, 144, 145, 5, 116, 0, 0, 145, 146, 5, 114, 0, 0, 146, 147, 5, 117, 0, 0, 147, 148, 5, 115, 0, 0, 148, 149, 5, 116, 0, 0, 149, 150, 5, 101, 0, 0, 150, 232, 5, 100, 0, 0, 151, 152, 5, 115, 0, 0, 152, 153, 5, 105, 0, 0, 153, 154, 5, 103, 0, 0, 154, 155, 5, 110, 0, 0, 155, 156, 5, 101, 0, 0, 156, 157, 5, 100, 0, 0, 157, 158, 5, 45, 0, 0, 158, 159, 5, 98, 0, 0, 159, 232, 5, 121, 0, 0, 160, 161, 5, 99, 0, 0, 161, 162, 5, 104, 0, 0, 162, 163, 5, 101, 0, 0, 163, 164, 5, 99, 0, 0, 164, 165, 5, 107, 0, 0, 165, 166, 5, 45, 0, 0, 166, 167, 5, 118, 0, 0, 167, 168, 5, 97, 0, 0, 168, 169, 5, 108, 0, 0, 169, 170, 5, 105, 0, 0, 170, 171, 5, 100, 0, 0, 171, 172, 5, 45, 0, 0, 172, 173, 5, 117, 0, 0, 173, 174, 5, 110, 0, 0, 174, 175, 5, 116, 0, 0, 175, 176, 5, 105, 0, 0, 176, 232, 5, 108, 0, 0, 177, 178, 5, 118, 0, 0, 178, 179, 5, 97, 0, 0, 179, 180, 5, 108, 0, 0, 180, 181, 5, 105, 0, 0, 181, 182, 5, 100, 0, 0, 182, 183, 5, 45, 0, 0, 183, 184, 5, 117, 0, 0, 184, 185, 5, 110, 0, 0, 185, 186, 5, 116, 0, 0, 186, 187, 5, 105, 0, 0, 187, 188, 5, 108, 0, 0, 188, 189, 5, 45, 0, 0, 189, 190, 5, 109, 0, 0, 190, 191, 5, 105, 0, 0, 191, 232, 5, 110, 0, 0, 192, 193, 5, 99, 0, 0, 193, 194, 5, 104, 0, 0, 194, 195, 5, 101, 0, 0, 195, 196, 5, 99, 0, 0, 196, 197, 5, 107, 0, 0, 197, 198, 5, 45, 0, 0, 198, 199, 5, 100, 0, 0, 199, 200, 5, 97, 0, 0, 200, 201, 5, 116, 0, 0, 201, 232, 5, 101, 0, 0, 202, 203, 5, 105, 0, 0, 203, 204, 5, 110, 0, 0, 204, 205, 5, 114, 0, 0, 205, 206, 5, 101, 0, 0, 206, 207, 5, 108, 0, 0, 207, 208, 5, 101, 0, 0, 208, 209, 5, 97, 0, 0, 209, 210, 5, 115, 0, 0, 210, 211, 5, 101, 0, 0, 211, 212, 5, 45, 0, 0, 212, 213, 5, 112, 0, 0, 213, 214, 5, 97, 0, 0, 214, 215, 5, 116, 0, 0, 215, 232, 5, 104, 0, 0, 216, 217, 5, 100, 0, 0, 217, 218, 5, 97, 0, 0, 218, 219, 5, 116, 0, 0, 219, 220, 5, 101, 0, 0, 220, 221, 5, 45, 0, 0, 221, 222, 5, 109, 0, 0, 222, 223, 5, 97, 0, 0, 223, 224, 5, 120, 0, 0, 224, 225, 5, 45, 0, 0, 225, 226, 5, 102, 0, 0, 226, 227, 5, 117, 0, 0, 227, 228, 5, 116, 0, 0, 228, 229, 5, 117, 0, 0, 229, 230, 5, 114, 0, 0, 230, 232, 5, 101, 0, 0, 231, 51, 1, 0, 0, 0, 231, 55, 1, 0, 0, 0, 231, 59, 1, 0, 0, 0, 231, 65, 1, 0, 0, 0, 231, 71, 1, 0, 0, 0, 231, 78, 1, 0, 0, 0, 231, 93, 1, 0, 0, 0, 231, 120, 1, 0, 0, 0, 231, 130, 1, 0, 0, 0, 231, 144, 1, 0, 0, 0, 231, 151, 1, 0, 0, 0, 231, 160, 1, 0, 0, 0, 231, 177, 1, 0, 0, 0, 231, 192, 1, 0, 0, 0, 231, 202, 1, 0, 0, 0, 231, 216, 1, 0, 0, 0, 232, 4, 1, 0, 0, 0, 233, 234, 5, 99, 0, 0, 234, 235, 5, 100, 0, 0, 235, 236, 5, 114, 0, 0, 236, 237, 5, 111, 0, 0, 237, 238, 5, 109, 0, 0, 238, 239, 5, 58, 0, 0, 239, 6, 1, 0, 0, 0, 240, 242, 3, 35, 17, 0, 241, 240, 1, 0, 0, 0, 242, 243, 1, 0, 0, 0, 243, 241, 1, 0, 0, 0, 243, 244, 1, 0, 0, 0, 244, 8, 1, 0, 0, 0, 245, 247, 3, 11, 5, 0, 246, 245, 1, 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 246, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 10, 1, 0, 0, 0, 250, 251, 7, 0, 0, 0, 251, 12, 1, 0, 0, 0, 252, 253, 7, 1, 0, 0, 253, 14, 1, 0, 0, 0, 254, 255, 5, 91, 0, 0, 255, 16, 1, 0, 0, 0, 256, 257, 5, 93, 0, 0, 257, 18, 1, 0, 0, 0, 258, 259, 5, 61, 0, 0, 259, 20, 1, 0, 0, 0, 260, 261, 5, 35, 0, 0, 261, 22, 1, 0, 0, 0, 262, 263, 5, 43, 0, 0, 263, 24, 1, 0, 0, 0, 264, 265, 5, 58, 0, 0, 265, 26, 1, 0, 0, 0, 266, 267, 5, 44, 0, 0, 267, 28, 1, 0, 0, 0, 268, 269, 5, 45, 0, 0, 269, 30, 1, 0, 0, 0, 270, 271, 5, 39, 0, 0, 271, 32, 1, 0, 0, 0, 272, 273, 5, 34, 0, 0, 273, 34, 1, 0, 0, 0, 274, 275, 7, 2, 0, 0, 275, 36, 1, 0, 0, 0, 276, 277, 7, 3, 0, 0, 277, 38, 1, 0, 0, 0, 5, 0, 49, 231, 243, 248, 0] \ No newline at end of file diff --git a/AptSourcesList/parserBundle/compiled/antlr4/apt_sourceLexer.py b/AptSourcesList/parserBundle/compiled/antlr4/apt_sourceLexer.py new file mode 100644 index 0000000..f8108a9 --- /dev/null +++ b/AptSourcesList/parserBundle/compiled/antlr4/apt_sourceLexer.py @@ -0,0 +1,168 @@ +# Generated from grammar.g4 by ANTLR 4.11.2-SNAPSHOT +from antlr4 import * +from io import StringIO +import sys +if sys.version_info[1] > 5: + from typing import TextIO +else: + from typing.io import TextIO + + +def serializedATN(): + return [ + 4,0,19,278,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5, + 2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2, + 13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,1,0,1, + 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,3,0,50,8,0,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1, + 232,8,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,3,4,3,242,8,3,11,3,12,3,243, + 1,4,4,4,247,8,4,11,4,12,4,248,1,5,1,5,1,6,1,6,1,7,1,7,1,8,1,8,1, + 9,1,9,1,10,1,10,1,11,1,11,1,12,1,12,1,13,1,13,1,14,1,14,1,15,1,15, + 1,16,1,16,1,17,1,17,1,18,1,18,0,0,19,1,1,3,2,5,3,7,4,9,5,11,6,13, + 7,15,8,17,9,19,10,21,11,23,12,25,13,27,14,29,15,31,16,33,17,35,18, + 37,19,1,0,4,2,0,9,13,32,32,1,0,46,47,4,0,48,57,65,90,95,95,97,122, + 10,0,0,8,14,31,33,33,36,38,40,42,59,60,62,64,94,94,96,96,123,255, + 295,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0, + 0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0, + 0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0, + 0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,0,0,0,0,37,1,0,0,0,1,49,1,0,0,0, + 3,231,1,0,0,0,5,233,1,0,0,0,7,241,1,0,0,0,9,246,1,0,0,0,11,250,1, + 0,0,0,13,252,1,0,0,0,15,254,1,0,0,0,17,256,1,0,0,0,19,258,1,0,0, + 0,21,260,1,0,0,0,23,262,1,0,0,0,25,264,1,0,0,0,27,266,1,0,0,0,29, + 268,1,0,0,0,31,270,1,0,0,0,33,272,1,0,0,0,35,274,1,0,0,0,37,276, + 1,0,0,0,39,40,5,100,0,0,40,41,5,101,0,0,41,50,5,98,0,0,42,43,5,100, + 0,0,43,44,5,101,0,0,44,45,5,98,0,0,45,46,5,45,0,0,46,47,5,115,0, + 0,47,48,5,114,0,0,48,50,5,99,0,0,49,39,1,0,0,0,49,42,1,0,0,0,50, + 2,1,0,0,0,51,52,5,97,0,0,52,53,5,114,0,0,53,54,5,99,0,0,54,232,5, + 104,0,0,55,56,5,108,0,0,56,57,5,97,0,0,57,58,5,110,0,0,58,232,5, + 103,0,0,59,60,5,116,0,0,60,61,5,97,0,0,61,62,5,114,0,0,62,63,5,103, + 0,0,63,64,5,101,0,0,64,232,5,116,0,0,65,66,5,112,0,0,66,67,5,100, + 0,0,67,68,5,105,0,0,68,69,5,102,0,0,69,70,5,102,0,0,70,232,5,115, + 0,0,71,72,5,98,0,0,72,73,5,121,0,0,73,74,5,45,0,0,74,75,5,104,0, + 0,75,76,5,97,0,0,76,77,5,115,0,0,77,232,5,104,0,0,78,79,5,118,0, + 0,79,80,5,97,0,0,80,81,5,108,0,0,81,82,5,105,0,0,82,83,5,100,0,0, + 83,84,5,45,0,0,84,85,5,117,0,0,85,86,5,110,0,0,86,87,5,116,0,0,87, + 88,5,105,0,0,88,89,5,108,0,0,89,90,5,45,0,0,90,91,5,109,0,0,91,92, + 5,97,0,0,92,232,5,120,0,0,93,94,5,97,0,0,94,95,5,108,0,0,95,96,5, + 108,0,0,96,97,5,111,0,0,97,98,5,119,0,0,98,99,5,45,0,0,99,100,5, + 100,0,0,100,101,5,111,0,0,101,102,5,119,0,0,102,103,5,110,0,0,103, + 104,5,103,0,0,104,105,5,114,0,0,105,106,5,97,0,0,106,107,5,100,0, + 0,107,108,5,101,0,0,108,109,5,45,0,0,109,110,5,116,0,0,110,111,5, + 111,0,0,111,112,5,45,0,0,112,113,5,105,0,0,113,114,5,110,0,0,114, + 115,5,115,0,0,115,116,5,101,0,0,116,117,5,99,0,0,117,118,5,117,0, + 0,118,119,5,114,0,0,119,232,5,101,0,0,120,121,5,97,0,0,121,122,5, + 108,0,0,122,123,5,108,0,0,123,124,5,111,0,0,124,125,5,119,0,0,125, + 126,5,45,0,0,126,127,5,119,0,0,127,128,5,101,0,0,128,129,5,97,0, + 0,129,232,5,107,0,0,130,131,5,97,0,0,131,132,5,108,0,0,132,133,5, + 108,0,0,133,134,5,111,0,0,134,135,5,119,0,0,135,136,5,45,0,0,136, + 137,5,105,0,0,137,138,5,110,0,0,138,139,5,115,0,0,139,140,5,101, + 0,0,140,141,5,99,0,0,141,142,5,117,0,0,142,143,5,114,0,0,143,232, + 5,101,0,0,144,145,5,116,0,0,145,146,5,114,0,0,146,147,5,117,0,0, + 147,148,5,115,0,0,148,149,5,116,0,0,149,150,5,101,0,0,150,232,5, + 100,0,0,151,152,5,115,0,0,152,153,5,105,0,0,153,154,5,103,0,0,154, + 155,5,110,0,0,155,156,5,101,0,0,156,157,5,100,0,0,157,158,5,45,0, + 0,158,159,5,98,0,0,159,232,5,121,0,0,160,161,5,99,0,0,161,162,5, + 104,0,0,162,163,5,101,0,0,163,164,5,99,0,0,164,165,5,107,0,0,165, + 166,5,45,0,0,166,167,5,118,0,0,167,168,5,97,0,0,168,169,5,108,0, + 0,169,170,5,105,0,0,170,171,5,100,0,0,171,172,5,45,0,0,172,173,5, + 117,0,0,173,174,5,110,0,0,174,175,5,116,0,0,175,176,5,105,0,0,176, + 232,5,108,0,0,177,178,5,118,0,0,178,179,5,97,0,0,179,180,5,108,0, + 0,180,181,5,105,0,0,181,182,5,100,0,0,182,183,5,45,0,0,183,184,5, + 117,0,0,184,185,5,110,0,0,185,186,5,116,0,0,186,187,5,105,0,0,187, + 188,5,108,0,0,188,189,5,45,0,0,189,190,5,109,0,0,190,191,5,105,0, + 0,191,232,5,110,0,0,192,193,5,99,0,0,193,194,5,104,0,0,194,195,5, + 101,0,0,195,196,5,99,0,0,196,197,5,107,0,0,197,198,5,45,0,0,198, + 199,5,100,0,0,199,200,5,97,0,0,200,201,5,116,0,0,201,232,5,101,0, + 0,202,203,5,105,0,0,203,204,5,110,0,0,204,205,5,114,0,0,205,206, + 5,101,0,0,206,207,5,108,0,0,207,208,5,101,0,0,208,209,5,97,0,0,209, + 210,5,115,0,0,210,211,5,101,0,0,211,212,5,45,0,0,212,213,5,112,0, + 0,213,214,5,97,0,0,214,215,5,116,0,0,215,232,5,104,0,0,216,217,5, + 100,0,0,217,218,5,97,0,0,218,219,5,116,0,0,219,220,5,101,0,0,220, + 221,5,45,0,0,221,222,5,109,0,0,222,223,5,97,0,0,223,224,5,120,0, + 0,224,225,5,45,0,0,225,226,5,102,0,0,226,227,5,117,0,0,227,228,5, + 116,0,0,228,229,5,117,0,0,229,230,5,114,0,0,230,232,5,101,0,0,231, + 51,1,0,0,0,231,55,1,0,0,0,231,59,1,0,0,0,231,65,1,0,0,0,231,71,1, + 0,0,0,231,78,1,0,0,0,231,93,1,0,0,0,231,120,1,0,0,0,231,130,1,0, + 0,0,231,144,1,0,0,0,231,151,1,0,0,0,231,160,1,0,0,0,231,177,1,0, + 0,0,231,192,1,0,0,0,231,202,1,0,0,0,231,216,1,0,0,0,232,4,1,0,0, + 0,233,234,5,99,0,0,234,235,5,100,0,0,235,236,5,114,0,0,236,237,5, + 111,0,0,237,238,5,109,0,0,238,239,5,58,0,0,239,6,1,0,0,0,240,242, + 3,35,17,0,241,240,1,0,0,0,242,243,1,0,0,0,243,241,1,0,0,0,243,244, + 1,0,0,0,244,8,1,0,0,0,245,247,3,11,5,0,246,245,1,0,0,0,247,248,1, + 0,0,0,248,246,1,0,0,0,248,249,1,0,0,0,249,10,1,0,0,0,250,251,7,0, + 0,0,251,12,1,0,0,0,252,253,7,1,0,0,253,14,1,0,0,0,254,255,5,91,0, + 0,255,16,1,0,0,0,256,257,5,93,0,0,257,18,1,0,0,0,258,259,5,61,0, + 0,259,20,1,0,0,0,260,261,5,35,0,0,261,22,1,0,0,0,262,263,5,43,0, + 0,263,24,1,0,0,0,264,265,5,58,0,0,265,26,1,0,0,0,266,267,5,44,0, + 0,267,28,1,0,0,0,268,269,5,45,0,0,269,30,1,0,0,0,270,271,5,39,0, + 0,271,32,1,0,0,0,272,273,5,34,0,0,273,34,1,0,0,0,274,275,7,2,0,0, + 275,36,1,0,0,0,276,277,7,3,0,0,277,38,1,0,0,0,5,0,49,231,243,248, + 0 + ] + +class apt_sourceLexer(Lexer): + + atn = ATNDeserializer().deserialize(serializedATN()) + + decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ] + + TypeR = 1 + OptionName = 2 + CdromSchema = 3 + Word = 4 + WSS = 5 + WS = 6 + PunctuationAllowedInOptionValue = 7 + OptionsStart = 8 + OptionsEnd = 9 + OptionNameValueSeparator = 10 + CommentMarker = 11 + Plus = 12 + Colon = 13 + OptionsSeparator = 14 + Dash = 15 + SingleTick = 16 + DoubleTick = 17 + WordChar = 18 + NonWhitespaceNonOptionValueNonSquareRightBracketNonEq = 19 + + channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ] + + modeNames = [ "DEFAULT_MODE" ] + + literalNames = [ "", + "'cdrom:'", "'['", "']'", "'='", "'#'", "'+'", "':'", "','", + "'-'", "'''", "'\"'" ] + + symbolicNames = [ "", + "TypeR", "OptionName", "CdromSchema", "Word", "WSS", "WS", "PunctuationAllowedInOptionValue", + "OptionsStart", "OptionsEnd", "OptionNameValueSeparator", "CommentMarker", + "Plus", "Colon", "OptionsSeparator", "Dash", "SingleTick", "DoubleTick", + "WordChar", "NonWhitespaceNonOptionValueNonSquareRightBracketNonEq" ] + + ruleNames = [ "TypeR", "OptionName", "CdromSchema", "Word", "WSS", "WS", + "PunctuationAllowedInOptionValue", "OptionsStart", "OptionsEnd", + "OptionNameValueSeparator", "CommentMarker", "Plus", "Colon", + "OptionsSeparator", "Dash", "SingleTick", "DoubleTick", + "WordChar", "NonWhitespaceNonOptionValueNonSquareRightBracketNonEq" ] + + grammarFileName = "grammar.g4" + + def __init__(self, input=None, output:TextIO = sys.stdout): + super().__init__(input, output) + self.checkVersion("4.11.2-SNAPSHOT") + self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache()) + self._actions = None + self._predicates = None + + diff --git a/AptSourcesList/parserBundle/compiled/antlr4/apt_sourceLexer.tokens b/AptSourcesList/parserBundle/compiled/antlr4/apt_sourceLexer.tokens new file mode 100644 index 0000000..9ed8d54 --- /dev/null +++ b/AptSourcesList/parserBundle/compiled/antlr4/apt_sourceLexer.tokens @@ -0,0 +1,30 @@ +TypeR=1 +OptionName=2 +CdromSchema=3 +Word=4 +WSS=5 +WS=6 +PunctuationAllowedInOptionValue=7 +OptionsStart=8 +OptionsEnd=9 +OptionNameValueSeparator=10 +CommentMarker=11 +Plus=12 +Colon=13 +OptionsSeparator=14 +Dash=15 +SingleTick=16 +DoubleTick=17 +WordChar=18 +NonWhitespaceNonOptionValueNonSquareRightBracketNonEq=19 +'cdrom:'=3 +'['=8 +']'=9 +'='=10 +'#'=11 +'+'=12 +':'=13 +','=14 +'-'=15 +'\''=16 +'"'=17 diff --git a/AptSourcesList/parserBundle/compiled/antlr4/apt_sourceListener.py b/AptSourcesList/parserBundle/compiled/antlr4/apt_sourceListener.py new file mode 100644 index 0000000..a04f83e --- /dev/null +++ b/AptSourcesList/parserBundle/compiled/antlr4/apt_sourceListener.py @@ -0,0 +1,273 @@ +# Generated from grammar.g4 by ANTLR 4.11.2-SNAPSHOT +from antlr4 import * +if __name__ is not None and "." in __name__: + from .apt_sourceParser import apt_sourceParser +else: + from apt_sourceParser import apt_sourceParser + +# This class defines a complete listener for a parse tree produced by apt_sourceParser. +class apt_sourceListener(ParseTreeListener): + + # Enter a parse tree produced by apt_sourceParser#record. + def enterRecord(self, ctx:apt_sourceParser.RecordContext): + pass + + # Exit a parse tree produced by apt_sourceParser#record. + def exitRecord(self, ctx:apt_sourceParser.RecordContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#commenterR_opt_our. + def enterCommenterR_opt_our(self, ctx:apt_sourceParser.CommenterR_opt_ourContext): + pass + + # Exit a parse tree produced by apt_sourceParser#commenterR_opt_our. + def exitCommenterR_opt_our(self, ctx:apt_sourceParser.CommenterR_opt_ourContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#optionsR_opt_our. + def enterOptionsR_opt_our(self, ctx:apt_sourceParser.OptionsR_opt_ourContext): + pass + + # Exit a parse tree produced by apt_sourceParser#optionsR_opt_our. + def exitOptionsR_opt_our(self, ctx:apt_sourceParser.OptionsR_opt_ourContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#component. + def enterComponent(self, ctx:apt_sourceParser.ComponentContext): + pass + + # Exit a parse tree produced by apt_sourceParser#component. + def exitComponent(self, ctx:apt_sourceParser.ComponentContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#componentsR. + def enterComponentsR(self, ctx:apt_sourceParser.ComponentsRContext): + pass + + # Exit a parse tree produced by apt_sourceParser#componentsR. + def exitComponentsR(self, ctx:apt_sourceParser.ComponentsRContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#optionsR. + def enterOptionsR(self, ctx:apt_sourceParser.OptionsRContext): + pass + + # Exit a parse tree produced by apt_sourceParser#optionsR. + def exitOptionsR(self, ctx:apt_sourceParser.OptionsRContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#optionsList. + def enterOptionsList(self, ctx:apt_sourceParser.OptionsListContext): + pass + + # Exit a parse tree produced by apt_sourceParser#optionsList. + def exitOptionsList(self, ctx:apt_sourceParser.OptionsListContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#additionalOptions. + def enterAdditionalOptions(self, ctx:apt_sourceParser.AdditionalOptionsContext): + pass + + # Exit a parse tree produced by apt_sourceParser#additionalOptions. + def exitAdditionalOptions(self, ctx:apt_sourceParser.AdditionalOptionsContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#additionalOption. + def enterAdditionalOption(self, ctx:apt_sourceParser.AdditionalOptionContext): + pass + + # Exit a parse tree produced by apt_sourceParser#additionalOption. + def exitAdditionalOption(self, ctx:apt_sourceParser.AdditionalOptionContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#optionR. + def enterOptionR(self, ctx:apt_sourceParser.OptionRContext): + pass + + # Exit a parse tree produced by apt_sourceParser#optionR. + def exitOptionR(self, ctx:apt_sourceParser.OptionRContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#wordWithDashSegment. + def enterWordWithDashSegment(self, ctx:apt_sourceParser.WordWithDashSegmentContext): + pass + + # Exit a parse tree produced by apt_sourceParser#wordWithDashSegment. + def exitWordWithDashSegment(self, ctx:apt_sourceParser.WordWithDashSegmentContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#wordWithDash. + def enterWordWithDash(self, ctx:apt_sourceParser.WordWithDashContext): + pass + + # Exit a parse tree produced by apt_sourceParser#wordWithDash. + def exitWordWithDash(self, ctx:apt_sourceParser.WordWithDashContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#optionValueSegment. + def enterOptionValueSegment(self, ctx:apt_sourceParser.OptionValueSegmentContext): + pass + + # Exit a parse tree produced by apt_sourceParser#optionValueSegment. + def exitOptionValueSegment(self, ctx:apt_sourceParser.OptionValueSegmentContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#nonSquareBracketStringSegment. + def enterNonSquareBracketStringSegment(self, ctx:apt_sourceParser.NonSquareBracketStringSegmentContext): + pass + + # Exit a parse tree produced by apt_sourceParser#nonSquareBracketStringSegment. + def exitNonSquareBracketStringSegment(self, ctx:apt_sourceParser.NonSquareBracketStringSegmentContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#nonSpaceStringSegment. + def enterNonSpaceStringSegment(self, ctx:apt_sourceParser.NonSpaceStringSegmentContext): + pass + + # Exit a parse tree produced by apt_sourceParser#nonSpaceStringSegment. + def exitNonSpaceStringSegment(self, ctx:apt_sourceParser.NonSpaceStringSegmentContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#optionValue. + def enterOptionValue(self, ctx:apt_sourceParser.OptionValueContext): + pass + + # Exit a parse tree produced by apt_sourceParser#optionValue. + def exitOptionValue(self, ctx:apt_sourceParser.OptionValueContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#nonSquareBracketString. + def enterNonSquareBracketString(self, ctx:apt_sourceParser.NonSquareBracketStringContext): + pass + + # Exit a parse tree produced by apt_sourceParser#nonSquareBracketString. + def exitNonSquareBracketString(self, ctx:apt_sourceParser.NonSquareBracketStringContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#nonSpaceString. + def enterNonSpaceString(self, ctx:apt_sourceParser.NonSpaceStringContext): + pass + + # Exit a parse tree produced by apt_sourceParser#nonSpaceString. + def exitNonSpaceString(self, ctx:apt_sourceParser.NonSpaceStringContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#singleTickEnclosedString. + def enterSingleTickEnclosedString(self, ctx:apt_sourceParser.SingleTickEnclosedStringContext): + pass + + # Exit a parse tree produced by apt_sourceParser#singleTickEnclosedString. + def exitSingleTickEnclosedString(self, ctx:apt_sourceParser.SingleTickEnclosedStringContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#doubleTickEnclosedString. + def enterDoubleTickEnclosedString(self, ctx:apt_sourceParser.DoubleTickEnclosedStringContext): + pass + + # Exit a parse tree produced by apt_sourceParser#doubleTickEnclosedString. + def exitDoubleTickEnclosedString(self, ctx:apt_sourceParser.DoubleTickEnclosedStringContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#tickEnclosedString. + def enterTickEnclosedString(self, ctx:apt_sourceParser.TickEnclosedStringContext): + pass + + # Exit a parse tree produced by apt_sourceParser#tickEnclosedString. + def exitTickEnclosedString(self, ctx:apt_sourceParser.TickEnclosedStringContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#enclosedString. + def enterEnclosedString(self, ctx:apt_sourceParser.EnclosedStringContext): + pass + + # Exit a parse tree produced by apt_sourceParser#enclosedString. + def exitEnclosedString(self, ctx:apt_sourceParser.EnclosedStringContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#cdromURI. + def enterCdromURI(self, ctx:apt_sourceParser.CdromURIContext): + pass + + # Exit a parse tree produced by apt_sourceParser#cdromURI. + def exitCdromURI(self, ctx:apt_sourceParser.CdromURIContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#uriSchema. + def enterUriSchema(self, ctx:apt_sourceParser.UriSchemaContext): + pass + + # Exit a parse tree produced by apt_sourceParser#uriSchema. + def exitUriSchema(self, ctx:apt_sourceParser.UriSchemaContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#commenterR. + def enterCommenterR(self, ctx:apt_sourceParser.CommenterRContext): + pass + + # Exit a parse tree produced by apt_sourceParser#commenterR. + def exitCommenterR(self, ctx:apt_sourceParser.CommenterRContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#wordWithPlus. + def enterWordWithPlus(self, ctx:apt_sourceParser.WordWithPlusContext): + pass + + # Exit a parse tree produced by apt_sourceParser#wordWithPlus. + def exitWordWithPlus(self, ctx:apt_sourceParser.WordWithPlusContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#restSchemaWords. + def enterRestSchemaWords(self, ctx:apt_sourceParser.RestSchemaWordsContext): + pass + + # Exit a parse tree produced by apt_sourceParser#restSchemaWords. + def exitRestSchemaWords(self, ctx:apt_sourceParser.RestSchemaWordsContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#genericURI. + def enterGenericURI(self, ctx:apt_sourceParser.GenericURIContext): + pass + + # Exit a parse tree produced by apt_sourceParser#genericURI. + def exitGenericURI(self, ctx:apt_sourceParser.GenericURIContext): + pass + + + # Enter a parse tree produced by apt_sourceParser#uriR. + def enterUriR(self, ctx:apt_sourceParser.UriRContext): + pass + + # Exit a parse tree produced by apt_sourceParser#uriR. + def exitUriR(self, ctx:apt_sourceParser.UriRContext): + pass + + + +del apt_sourceParser \ No newline at end of file diff --git a/AptSourcesList/parserBundle/compiled/antlr4/apt_sourceParser.py b/AptSourcesList/parserBundle/compiled/antlr4/apt_sourceParser.py new file mode 100644 index 0000000..5661f87 --- /dev/null +++ b/AptSourcesList/parserBundle/compiled/antlr4/apt_sourceParser.py @@ -0,0 +1,1781 @@ +# Generated from grammar.g4 by ANTLR 4.11.2-SNAPSHOT +# encoding: utf-8 +from antlr4 import * +from io import StringIO +import sys +if sys.version_info[1] > 5: + from typing import TextIO +else: + from typing.io import TextIO + +def serializedATN(): + return [ + 4,1,19,182,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, + 6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13, + 2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20, + 7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26, + 2,27,7,27,2,28,7,28,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,3,0,68,8, + 0,1,1,3,1,71,8,1,1,2,3,2,74,8,2,1,3,1,3,1,3,1,4,4,4,80,8,4,11,4, + 12,4,81,1,5,1,5,1,5,1,5,1,5,1,6,1,6,1,6,1,7,5,7,93,8,7,10,7,12,7, + 96,9,7,1,8,1,8,1,8,1,9,1,9,1,9,1,9,1,10,1,10,1,11,4,11,108,8,11, + 11,11,12,11,109,1,12,1,12,1,13,1,13,1,13,3,13,117,8,13,1,14,1,14, + 3,14,121,8,14,1,15,4,15,124,8,15,11,15,12,15,125,1,16,4,16,129,8, + 16,11,16,12,16,130,1,17,4,17,134,8,17,11,17,12,17,135,1,18,1,18, + 1,18,1,18,1,19,1,19,1,19,1,19,1,20,1,20,3,20,148,8,20,1,21,1,21, + 1,21,1,21,1,22,1,22,1,22,1,22,1,22,1,23,1,23,1,23,1,24,1,24,1,24, + 1,25,1,25,1,25,1,26,5,26,169,8,26,10,26,12,26,172,9,26,1,27,1,27, + 1,27,1,27,1,28,1,28,3,28,180,8,28,1,28,0,0,29,0,2,4,6,8,10,12,14, + 16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,0, + 2,2,0,4,4,15,15,4,0,1,4,7,7,12,13,15,15,167,0,58,1,0,0,0,2,70,1, + 0,0,0,4,73,1,0,0,0,6,75,1,0,0,0,8,79,1,0,0,0,10,83,1,0,0,0,12,88, + 1,0,0,0,14,94,1,0,0,0,16,97,1,0,0,0,18,100,1,0,0,0,20,104,1,0,0, + 0,22,107,1,0,0,0,24,111,1,0,0,0,26,116,1,0,0,0,28,120,1,0,0,0,30, + 123,1,0,0,0,32,128,1,0,0,0,34,133,1,0,0,0,36,137,1,0,0,0,38,141, + 1,0,0,0,40,147,1,0,0,0,42,149,1,0,0,0,44,153,1,0,0,0,46,158,1,0, + 0,0,48,161,1,0,0,0,50,164,1,0,0,0,52,170,1,0,0,0,54,173,1,0,0,0, + 56,179,1,0,0,0,58,59,3,2,1,0,59,60,5,1,0,0,60,61,5,5,0,0,61,62,3, + 4,2,0,62,63,3,56,28,0,63,64,5,5,0,0,64,65,3,22,11,0,65,67,3,8,4, + 0,66,68,5,5,0,0,67,66,1,0,0,0,67,68,1,0,0,0,68,1,1,0,0,0,69,71,3, + 48,24,0,70,69,1,0,0,0,70,71,1,0,0,0,71,3,1,0,0,0,72,74,3,10,5,0, + 73,72,1,0,0,0,73,74,1,0,0,0,74,5,1,0,0,0,75,76,5,5,0,0,76,77,3,22, + 11,0,77,7,1,0,0,0,78,80,3,6,3,0,79,78,1,0,0,0,80,81,1,0,0,0,81,79, + 1,0,0,0,81,82,1,0,0,0,82,9,1,0,0,0,83,84,5,8,0,0,84,85,3,12,6,0, + 85,86,5,9,0,0,86,87,5,5,0,0,87,11,1,0,0,0,88,89,3,18,9,0,89,90,3, + 14,7,0,90,13,1,0,0,0,91,93,3,16,8,0,92,91,1,0,0,0,93,96,1,0,0,0, + 94,92,1,0,0,0,94,95,1,0,0,0,95,15,1,0,0,0,96,94,1,0,0,0,97,98,5, + 14,0,0,98,99,3,18,9,0,99,17,1,0,0,0,100,101,5,2,0,0,101,102,5,10, + 0,0,102,103,3,30,15,0,103,19,1,0,0,0,104,105,7,0,0,0,105,21,1,0, + 0,0,106,108,3,20,10,0,107,106,1,0,0,0,108,109,1,0,0,0,109,107,1, + 0,0,0,109,110,1,0,0,0,110,23,1,0,0,0,111,112,7,1,0,0,112,25,1,0, + 0,0,113,117,5,19,0,0,114,117,3,24,12,0,115,117,5,10,0,0,116,113, + 1,0,0,0,116,114,1,0,0,0,116,115,1,0,0,0,117,27,1,0,0,0,118,121,3, + 26,13,0,119,121,5,9,0,0,120,118,1,0,0,0,120,119,1,0,0,0,121,29,1, + 0,0,0,122,124,3,24,12,0,123,122,1,0,0,0,124,125,1,0,0,0,125,123, + 1,0,0,0,125,126,1,0,0,0,126,31,1,0,0,0,127,129,3,26,13,0,128,127, + 1,0,0,0,129,130,1,0,0,0,130,128,1,0,0,0,130,131,1,0,0,0,131,33,1, + 0,0,0,132,134,3,28,14,0,133,132,1,0,0,0,134,135,1,0,0,0,135,133, + 1,0,0,0,135,136,1,0,0,0,136,35,1,0,0,0,137,138,5,16,0,0,138,139, + 3,32,16,0,139,140,5,16,0,0,140,37,1,0,0,0,141,142,5,17,0,0,142,143, + 3,32,16,0,143,144,5,17,0,0,144,39,1,0,0,0,145,148,3,36,18,0,146, + 148,3,38,19,0,147,145,1,0,0,0,147,146,1,0,0,0,148,41,1,0,0,0,149, + 150,5,8,0,0,150,151,3,40,20,0,151,152,5,9,0,0,152,43,1,0,0,0,153, + 154,5,3,0,0,154,155,5,13,0,0,155,156,3,42,21,0,156,157,3,34,17,0, + 157,45,1,0,0,0,158,159,5,4,0,0,159,160,3,52,26,0,160,47,1,0,0,0, + 161,162,5,11,0,0,162,163,5,5,0,0,163,49,1,0,0,0,164,165,5,12,0,0, + 165,166,5,4,0,0,166,51,1,0,0,0,167,169,3,50,25,0,168,167,1,0,0,0, + 169,172,1,0,0,0,170,168,1,0,0,0,170,171,1,0,0,0,171,53,1,0,0,0,172, + 170,1,0,0,0,173,174,3,46,23,0,174,175,5,13,0,0,175,176,3,34,17,0, + 176,55,1,0,0,0,177,180,3,44,22,0,178,180,3,54,27,0,179,177,1,0,0, + 0,179,178,1,0,0,0,180,57,1,0,0,0,14,67,70,73,81,94,109,116,120,125, + 130,135,147,170,179 + ] + +class apt_sourceParser ( Parser ): + + grammarFileName = "grammar.g4" + + atn = ATNDeserializer().deserialize(serializedATN()) + + decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ] + + sharedContextCache = PredictionContextCache() + + literalNames = [ "", "", "", "'cdrom:'", + "", "", "", "", + "'['", "']'", "'='", "'#'", "'+'", "':'", "','", "'-'", + "'''", "'\"'" ] + + symbolicNames = [ "", "TypeR", "OptionName", "CdromSchema", + "Word", "WSS", "WS", "PunctuationAllowedInOptionValue", + "OptionsStart", "OptionsEnd", "OptionNameValueSeparator", + "CommentMarker", "Plus", "Colon", "OptionsSeparator", + "Dash", "SingleTick", "DoubleTick", "WordChar", "NonWhitespaceNonOptionValueNonSquareRightBracketNonEq" ] + + RULE_record = 0 + RULE_commenterR_opt_our = 1 + RULE_optionsR_opt_our = 2 + RULE_component = 3 + RULE_componentsR = 4 + RULE_optionsR = 5 + RULE_optionsList = 6 + RULE_additionalOptions = 7 + RULE_additionalOption = 8 + RULE_optionR = 9 + RULE_wordWithDashSegment = 10 + RULE_wordWithDash = 11 + RULE_optionValueSegment = 12 + RULE_nonSquareBracketStringSegment = 13 + RULE_nonSpaceStringSegment = 14 + RULE_optionValue = 15 + RULE_nonSquareBracketString = 16 + RULE_nonSpaceString = 17 + RULE_singleTickEnclosedString = 18 + RULE_doubleTickEnclosedString = 19 + RULE_tickEnclosedString = 20 + RULE_enclosedString = 21 + RULE_cdromURI = 22 + RULE_uriSchema = 23 + RULE_commenterR = 24 + RULE_wordWithPlus = 25 + RULE_restSchemaWords = 26 + RULE_genericURI = 27 + RULE_uriR = 28 + + ruleNames = [ "record", "commenterR_opt_our", "optionsR_opt_our", "component", + "componentsR", "optionsR", "optionsList", "additionalOptions", + "additionalOption", "optionR", "wordWithDashSegment", + "wordWithDash", "optionValueSegment", "nonSquareBracketStringSegment", + "nonSpaceStringSegment", "optionValue", "nonSquareBracketString", + "nonSpaceString", "singleTickEnclosedString", "doubleTickEnclosedString", + "tickEnclosedString", "enclosedString", "cdromURI", "uriSchema", + "commenterR", "wordWithPlus", "restSchemaWords", "genericURI", + "uriR" ] + + EOF = Token.EOF + TypeR=1 + OptionName=2 + CdromSchema=3 + Word=4 + WSS=5 + WS=6 + PunctuationAllowedInOptionValue=7 + OptionsStart=8 + OptionsEnd=9 + OptionNameValueSeparator=10 + CommentMarker=11 + Plus=12 + Colon=13 + OptionsSeparator=14 + Dash=15 + SingleTick=16 + DoubleTick=17 + WordChar=18 + NonWhitespaceNonOptionValueNonSquareRightBracketNonEq=19 + + def __init__(self, input:TokenStream, output:TextIO = sys.stdout): + super().__init__(input, output) + self.checkVersion("4.11.2-SNAPSHOT") + self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache) + self._predicates = None + + + + + class RecordContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.commented = None # CommenterR_opt_ourContext + self.rType = None # Token + self.options = None # OptionsR_opt_ourContext + self.uri = None # UriRContext + self.distribution = None # WordWithDashContext + self.components = None # ComponentsRContext + + def WSS(self, i:int=None): + if i is None: + return self.getTokens(apt_sourceParser.WSS) + else: + return self.getToken(apt_sourceParser.WSS, i) + + def commenterR_opt_our(self): + return self.getTypedRuleContext(apt_sourceParser.CommenterR_opt_ourContext,0) + + + def TypeR(self): + return self.getToken(apt_sourceParser.TypeR, 0) + + def optionsR_opt_our(self): + return self.getTypedRuleContext(apt_sourceParser.OptionsR_opt_ourContext,0) + + + def uriR(self): + return self.getTypedRuleContext(apt_sourceParser.UriRContext,0) + + + def wordWithDash(self): + return self.getTypedRuleContext(apt_sourceParser.WordWithDashContext,0) + + + def componentsR(self): + return self.getTypedRuleContext(apt_sourceParser.ComponentsRContext,0) + + + def getRuleIndex(self): + return apt_sourceParser.RULE_record + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterRecord" ): + listener.enterRecord(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitRecord" ): + listener.exitRecord(self) + + + + + def record(self): + + localctx = apt_sourceParser.RecordContext(self, self._ctx, self.state) + self.enterRule(localctx, 0, self.RULE_record) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 58 + localctx.commented = self.commenterR_opt_our() + self.state = 59 + localctx.rType = self.match(apt_sourceParser.TypeR) + self.state = 60 + self.match(apt_sourceParser.WSS) + self.state = 61 + localctx.options = self.optionsR_opt_our() + self.state = 62 + localctx.uri = self.uriR() + self.state = 63 + self.match(apt_sourceParser.WSS) + self.state = 64 + localctx.distribution = self.wordWithDash() + self.state = 65 + localctx.components = self.componentsR() + self.state = 67 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==5: + self.state = 66 + self.match(apt_sourceParser.WSS) + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class CommenterR_opt_ourContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def commenterR(self): + return self.getTypedRuleContext(apt_sourceParser.CommenterRContext,0) + + + def getRuleIndex(self): + return apt_sourceParser.RULE_commenterR_opt_our + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterCommenterR_opt_our" ): + listener.enterCommenterR_opt_our(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitCommenterR_opt_our" ): + listener.exitCommenterR_opt_our(self) + + + + + def commenterR_opt_our(self): + + localctx = apt_sourceParser.CommenterR_opt_ourContext(self, self._ctx, self.state) + self.enterRule(localctx, 2, self.RULE_commenterR_opt_our) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 70 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==11: + self.state = 69 + self.commenterR() + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class OptionsR_opt_ourContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def optionsR(self): + return self.getTypedRuleContext(apt_sourceParser.OptionsRContext,0) + + + def getRuleIndex(self): + return apt_sourceParser.RULE_optionsR_opt_our + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterOptionsR_opt_our" ): + listener.enterOptionsR_opt_our(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitOptionsR_opt_our" ): + listener.exitOptionsR_opt_our(self) + + + + + def optionsR_opt_our(self): + + localctx = apt_sourceParser.OptionsR_opt_ourContext(self, self._ctx, self.state) + self.enterRule(localctx, 4, self.RULE_optionsR_opt_our) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 73 + self._errHandler.sync(self) + _la = self._input.LA(1) + if _la==8: + self.state = 72 + self.optionsR() + + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class ComponentContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.cId = None # WordWithDashContext + + def WSS(self): + return self.getToken(apt_sourceParser.WSS, 0) + + def wordWithDash(self): + return self.getTypedRuleContext(apt_sourceParser.WordWithDashContext,0) + + + def getRuleIndex(self): + return apt_sourceParser.RULE_component + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterComponent" ): + listener.enterComponent(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitComponent" ): + listener.exitComponent(self) + + + + + def component(self): + + localctx = apt_sourceParser.ComponentContext(self, self._ctx, self.state) + self.enterRule(localctx, 6, self.RULE_component) + try: + self.enterOuterAlt(localctx, 1) + self.state = 75 + self.match(apt_sourceParser.WSS) + self.state = 76 + localctx.cId = self.wordWithDash() + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class ComponentsRContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def component(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(apt_sourceParser.ComponentContext) + else: + return self.getTypedRuleContext(apt_sourceParser.ComponentContext,i) + + + def getRuleIndex(self): + return apt_sourceParser.RULE_componentsR + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterComponentsR" ): + listener.enterComponentsR(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitComponentsR" ): + listener.exitComponentsR(self) + + + + + def componentsR(self): + + localctx = apt_sourceParser.ComponentsRContext(self, self._ctx, self.state) + self.enterRule(localctx, 8, self.RULE_componentsR) + try: + self.enterOuterAlt(localctx, 1) + self.state = 79 + self._errHandler.sync(self) + _alt = 1 + while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER: + if _alt == 1: + self.state = 78 + self.component() + + else: + raise NoViableAltException(self) + self.state = 81 + self._errHandler.sync(self) + _alt = self._interp.adaptivePredict(self._input,3,self._ctx) + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class OptionsRContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.pairs = None # OptionsListContext + + def OptionsStart(self): + return self.getToken(apt_sourceParser.OptionsStart, 0) + + def OptionsEnd(self): + return self.getToken(apt_sourceParser.OptionsEnd, 0) + + def WSS(self): + return self.getToken(apt_sourceParser.WSS, 0) + + def optionsList(self): + return self.getTypedRuleContext(apt_sourceParser.OptionsListContext,0) + + + def getRuleIndex(self): + return apt_sourceParser.RULE_optionsR + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterOptionsR" ): + listener.enterOptionsR(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitOptionsR" ): + listener.exitOptionsR(self) + + + + + def optionsR(self): + + localctx = apt_sourceParser.OptionsRContext(self, self._ctx, self.state) + self.enterRule(localctx, 10, self.RULE_optionsR) + try: + self.enterOuterAlt(localctx, 1) + self.state = 83 + self.match(apt_sourceParser.OptionsStart) + self.state = 84 + localctx.pairs = self.optionsList() + self.state = 85 + self.match(apt_sourceParser.OptionsEnd) + self.state = 86 + self.match(apt_sourceParser.WSS) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class OptionsListContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.firstOption = None # OptionRContext + self.restOptions = None # AdditionalOptionsContext + + def optionR(self): + return self.getTypedRuleContext(apt_sourceParser.OptionRContext,0) + + + def additionalOptions(self): + return self.getTypedRuleContext(apt_sourceParser.AdditionalOptionsContext,0) + + + def getRuleIndex(self): + return apt_sourceParser.RULE_optionsList + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterOptionsList" ): + listener.enterOptionsList(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitOptionsList" ): + listener.exitOptionsList(self) + + + + + def optionsList(self): + + localctx = apt_sourceParser.OptionsListContext(self, self._ctx, self.state) + self.enterRule(localctx, 12, self.RULE_optionsList) + try: + self.enterOuterAlt(localctx, 1) + self.state = 88 + localctx.firstOption = self.optionR() + self.state = 89 + localctx.restOptions = self.additionalOptions() + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class AdditionalOptionsContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def additionalOption(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(apt_sourceParser.AdditionalOptionContext) + else: + return self.getTypedRuleContext(apt_sourceParser.AdditionalOptionContext,i) + + + def getRuleIndex(self): + return apt_sourceParser.RULE_additionalOptions + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterAdditionalOptions" ): + listener.enterAdditionalOptions(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitAdditionalOptions" ): + listener.exitAdditionalOptions(self) + + + + + def additionalOptions(self): + + localctx = apt_sourceParser.AdditionalOptionsContext(self, self._ctx, self.state) + self.enterRule(localctx, 14, self.RULE_additionalOptions) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 94 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==14: + self.state = 91 + self.additionalOption() + self.state = 96 + self._errHandler.sync(self) + _la = self._input.LA(1) + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class AdditionalOptionContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.separator = None # Token + self.option = None # OptionRContext + + def OptionsSeparator(self): + return self.getToken(apt_sourceParser.OptionsSeparator, 0) + + def optionR(self): + return self.getTypedRuleContext(apt_sourceParser.OptionRContext,0) + + + def getRuleIndex(self): + return apt_sourceParser.RULE_additionalOption + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterAdditionalOption" ): + listener.enterAdditionalOption(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitAdditionalOption" ): + listener.exitAdditionalOption(self) + + + + + def additionalOption(self): + + localctx = apt_sourceParser.AdditionalOptionContext(self, self._ctx, self.state) + self.enterRule(localctx, 16, self.RULE_additionalOption) + try: + self.enterOuterAlt(localctx, 1) + self.state = 97 + localctx.separator = self.match(apt_sourceParser.OptionsSeparator) + self.state = 98 + localctx.option = self.optionR() + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class OptionRContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.key = None # Token + self.value = None # OptionValueContext + + def OptionNameValueSeparator(self): + return self.getToken(apt_sourceParser.OptionNameValueSeparator, 0) + + def OptionName(self): + return self.getToken(apt_sourceParser.OptionName, 0) + + def optionValue(self): + return self.getTypedRuleContext(apt_sourceParser.OptionValueContext,0) + + + def getRuleIndex(self): + return apt_sourceParser.RULE_optionR + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterOptionR" ): + listener.enterOptionR(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitOptionR" ): + listener.exitOptionR(self) + + + + + def optionR(self): + + localctx = apt_sourceParser.OptionRContext(self, self._ctx, self.state) + self.enterRule(localctx, 18, self.RULE_optionR) + try: + self.enterOuterAlt(localctx, 1) + self.state = 100 + localctx.key = self.match(apt_sourceParser.OptionName) + self.state = 101 + self.match(apt_sourceParser.OptionNameValueSeparator) + self.state = 102 + localctx.value = self.optionValue() + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class WordWithDashSegmentContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def Word(self): + return self.getToken(apt_sourceParser.Word, 0) + + def Dash(self): + return self.getToken(apt_sourceParser.Dash, 0) + + def getRuleIndex(self): + return apt_sourceParser.RULE_wordWithDashSegment + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterWordWithDashSegment" ): + listener.enterWordWithDashSegment(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitWordWithDashSegment" ): + listener.exitWordWithDashSegment(self) + + + + + def wordWithDashSegment(self): + + localctx = apt_sourceParser.WordWithDashSegmentContext(self, self._ctx, self.state) + self.enterRule(localctx, 20, self.RULE_wordWithDashSegment) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 104 + _la = self._input.LA(1) + if not(_la==4 or _la==15): + self._errHandler.recoverInline(self) + else: + self._errHandler.reportMatch(self) + self.consume() + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class WordWithDashContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def wordWithDashSegment(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(apt_sourceParser.WordWithDashSegmentContext) + else: + return self.getTypedRuleContext(apt_sourceParser.WordWithDashSegmentContext,i) + + + def getRuleIndex(self): + return apt_sourceParser.RULE_wordWithDash + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterWordWithDash" ): + listener.enterWordWithDash(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitWordWithDash" ): + listener.exitWordWithDash(self) + + + + + def wordWithDash(self): + + localctx = apt_sourceParser.WordWithDashContext(self, self._ctx, self.state) + self.enterRule(localctx, 22, self.RULE_wordWithDash) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 107 + self._errHandler.sync(self) + _la = self._input.LA(1) + while True: + self.state = 106 + self.wordWithDashSegment() + self.state = 109 + self._errHandler.sync(self) + _la = self._input.LA(1) + if not (_la==4 or _la==15): + break + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class OptionValueSegmentContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def Word(self): + return self.getToken(apt_sourceParser.Word, 0) + + def PunctuationAllowedInOptionValue(self): + return self.getToken(apt_sourceParser.PunctuationAllowedInOptionValue, 0) + + def Dash(self): + return self.getToken(apt_sourceParser.Dash, 0) + + def OptionName(self): + return self.getToken(apt_sourceParser.OptionName, 0) + + def CdromSchema(self): + return self.getToken(apt_sourceParser.CdromSchema, 0) + + def TypeR(self): + return self.getToken(apt_sourceParser.TypeR, 0) + + def Plus(self): + return self.getToken(apt_sourceParser.Plus, 0) + + def Colon(self): + return self.getToken(apt_sourceParser.Colon, 0) + + def getRuleIndex(self): + return apt_sourceParser.RULE_optionValueSegment + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterOptionValueSegment" ): + listener.enterOptionValueSegment(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitOptionValueSegment" ): + listener.exitOptionValueSegment(self) + + + + + def optionValueSegment(self): + + localctx = apt_sourceParser.OptionValueSegmentContext(self, self._ctx, self.state) + self.enterRule(localctx, 24, self.RULE_optionValueSegment) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 111 + _la = self._input.LA(1) + if not(((_la) & ~0x3f) == 0 and ((1 << _la) & 45214) != 0): + self._errHandler.recoverInline(self) + else: + self._errHandler.reportMatch(self) + self.consume() + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class NonSquareBracketStringSegmentContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def NonWhitespaceNonOptionValueNonSquareRightBracketNonEq(self): + return self.getToken(apt_sourceParser.NonWhitespaceNonOptionValueNonSquareRightBracketNonEq, 0) + + def optionValueSegment(self): + return self.getTypedRuleContext(apt_sourceParser.OptionValueSegmentContext,0) + + + def OptionNameValueSeparator(self): + return self.getToken(apt_sourceParser.OptionNameValueSeparator, 0) + + def getRuleIndex(self): + return apt_sourceParser.RULE_nonSquareBracketStringSegment + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterNonSquareBracketStringSegment" ): + listener.enterNonSquareBracketStringSegment(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitNonSquareBracketStringSegment" ): + listener.exitNonSquareBracketStringSegment(self) + + + + + def nonSquareBracketStringSegment(self): + + localctx = apt_sourceParser.NonSquareBracketStringSegmentContext(self, self._ctx, self.state) + self.enterRule(localctx, 26, self.RULE_nonSquareBracketStringSegment) + try: + self.state = 116 + self._errHandler.sync(self) + token = self._input.LA(1) + if token in [19]: + self.enterOuterAlt(localctx, 1) + self.state = 113 + self.match(apt_sourceParser.NonWhitespaceNonOptionValueNonSquareRightBracketNonEq) + pass + elif token in [1, 2, 3, 4, 7, 12, 13, 15]: + self.enterOuterAlt(localctx, 2) + self.state = 114 + self.optionValueSegment() + pass + elif token in [10]: + self.enterOuterAlt(localctx, 3) + self.state = 115 + self.match(apt_sourceParser.OptionNameValueSeparator) + pass + else: + raise NoViableAltException(self) + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class NonSpaceStringSegmentContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def nonSquareBracketStringSegment(self): + return self.getTypedRuleContext(apt_sourceParser.NonSquareBracketStringSegmentContext,0) + + + def OptionsEnd(self): + return self.getToken(apt_sourceParser.OptionsEnd, 0) + + def getRuleIndex(self): + return apt_sourceParser.RULE_nonSpaceStringSegment + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterNonSpaceStringSegment" ): + listener.enterNonSpaceStringSegment(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitNonSpaceStringSegment" ): + listener.exitNonSpaceStringSegment(self) + + + + + def nonSpaceStringSegment(self): + + localctx = apt_sourceParser.NonSpaceStringSegmentContext(self, self._ctx, self.state) + self.enterRule(localctx, 28, self.RULE_nonSpaceStringSegment) + try: + self.state = 120 + self._errHandler.sync(self) + token = self._input.LA(1) + if token in [1, 2, 3, 4, 7, 10, 12, 13, 15, 19]: + self.enterOuterAlt(localctx, 1) + self.state = 118 + self.nonSquareBracketStringSegment() + pass + elif token in [9]: + self.enterOuterAlt(localctx, 2) + self.state = 119 + self.match(apt_sourceParser.OptionsEnd) + pass + else: + raise NoViableAltException(self) + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class OptionValueContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def optionValueSegment(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(apt_sourceParser.OptionValueSegmentContext) + else: + return self.getTypedRuleContext(apt_sourceParser.OptionValueSegmentContext,i) + + + def getRuleIndex(self): + return apt_sourceParser.RULE_optionValue + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterOptionValue" ): + listener.enterOptionValue(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitOptionValue" ): + listener.exitOptionValue(self) + + + + + def optionValue(self): + + localctx = apt_sourceParser.OptionValueContext(self, self._ctx, self.state) + self.enterRule(localctx, 30, self.RULE_optionValue) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 123 + self._errHandler.sync(self) + _la = self._input.LA(1) + while True: + self.state = 122 + self.optionValueSegment() + self.state = 125 + self._errHandler.sync(self) + _la = self._input.LA(1) + if not (((_la) & ~0x3f) == 0 and ((1 << _la) & 45214) != 0): + break + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class NonSquareBracketStringContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def nonSquareBracketStringSegment(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(apt_sourceParser.NonSquareBracketStringSegmentContext) + else: + return self.getTypedRuleContext(apt_sourceParser.NonSquareBracketStringSegmentContext,i) + + + def getRuleIndex(self): + return apt_sourceParser.RULE_nonSquareBracketString + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterNonSquareBracketString" ): + listener.enterNonSquareBracketString(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitNonSquareBracketString" ): + listener.exitNonSquareBracketString(self) + + + + + def nonSquareBracketString(self): + + localctx = apt_sourceParser.NonSquareBracketStringContext(self, self._ctx, self.state) + self.enterRule(localctx, 32, self.RULE_nonSquareBracketString) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 128 + self._errHandler.sync(self) + _la = self._input.LA(1) + while True: + self.state = 127 + self.nonSquareBracketStringSegment() + self.state = 130 + self._errHandler.sync(self) + _la = self._input.LA(1) + if not (((_la) & ~0x3f) == 0 and ((1 << _la) & 570526) != 0): + break + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class NonSpaceStringContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def nonSpaceStringSegment(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(apt_sourceParser.NonSpaceStringSegmentContext) + else: + return self.getTypedRuleContext(apt_sourceParser.NonSpaceStringSegmentContext,i) + + + def getRuleIndex(self): + return apt_sourceParser.RULE_nonSpaceString + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterNonSpaceString" ): + listener.enterNonSpaceString(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitNonSpaceString" ): + listener.exitNonSpaceString(self) + + + + + def nonSpaceString(self): + + localctx = apt_sourceParser.NonSpaceStringContext(self, self._ctx, self.state) + self.enterRule(localctx, 34, self.RULE_nonSpaceString) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 133 + self._errHandler.sync(self) + _la = self._input.LA(1) + while True: + self.state = 132 + self.nonSpaceStringSegment() + self.state = 135 + self._errHandler.sync(self) + _la = self._input.LA(1) + if not (((_la) & ~0x3f) == 0 and ((1 << _la) & 571038) != 0): + break + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class SingleTickEnclosedStringContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def SingleTick(self, i:int=None): + if i is None: + return self.getTokens(apt_sourceParser.SingleTick) + else: + return self.getToken(apt_sourceParser.SingleTick, i) + + def nonSquareBracketString(self): + return self.getTypedRuleContext(apt_sourceParser.NonSquareBracketStringContext,0) + + + def getRuleIndex(self): + return apt_sourceParser.RULE_singleTickEnclosedString + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterSingleTickEnclosedString" ): + listener.enterSingleTickEnclosedString(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitSingleTickEnclosedString" ): + listener.exitSingleTickEnclosedString(self) + + + + + def singleTickEnclosedString(self): + + localctx = apt_sourceParser.SingleTickEnclosedStringContext(self, self._ctx, self.state) + self.enterRule(localctx, 36, self.RULE_singleTickEnclosedString) + try: + self.enterOuterAlt(localctx, 1) + self.state = 137 + self.match(apt_sourceParser.SingleTick) + self.state = 138 + self.nonSquareBracketString() + self.state = 139 + self.match(apt_sourceParser.SingleTick) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class DoubleTickEnclosedStringContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def DoubleTick(self, i:int=None): + if i is None: + return self.getTokens(apt_sourceParser.DoubleTick) + else: + return self.getToken(apt_sourceParser.DoubleTick, i) + + def nonSquareBracketString(self): + return self.getTypedRuleContext(apt_sourceParser.NonSquareBracketStringContext,0) + + + def getRuleIndex(self): + return apt_sourceParser.RULE_doubleTickEnclosedString + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterDoubleTickEnclosedString" ): + listener.enterDoubleTickEnclosedString(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitDoubleTickEnclosedString" ): + listener.exitDoubleTickEnclosedString(self) + + + + + def doubleTickEnclosedString(self): + + localctx = apt_sourceParser.DoubleTickEnclosedStringContext(self, self._ctx, self.state) + self.enterRule(localctx, 38, self.RULE_doubleTickEnclosedString) + try: + self.enterOuterAlt(localctx, 1) + self.state = 141 + self.match(apt_sourceParser.DoubleTick) + self.state = 142 + self.nonSquareBracketString() + self.state = 143 + self.match(apt_sourceParser.DoubleTick) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class TickEnclosedStringContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def singleTickEnclosedString(self): + return self.getTypedRuleContext(apt_sourceParser.SingleTickEnclosedStringContext,0) + + + def doubleTickEnclosedString(self): + return self.getTypedRuleContext(apt_sourceParser.DoubleTickEnclosedStringContext,0) + + + def getRuleIndex(self): + return apt_sourceParser.RULE_tickEnclosedString + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterTickEnclosedString" ): + listener.enterTickEnclosedString(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitTickEnclosedString" ): + listener.exitTickEnclosedString(self) + + + + + def tickEnclosedString(self): + + localctx = apt_sourceParser.TickEnclosedStringContext(self, self._ctx, self.state) + self.enterRule(localctx, 40, self.RULE_tickEnclosedString) + try: + self.state = 147 + self._errHandler.sync(self) + token = self._input.LA(1) + if token in [16]: + self.enterOuterAlt(localctx, 1) + self.state = 145 + self.singleTickEnclosedString() + pass + elif token in [17]: + self.enterOuterAlt(localctx, 2) + self.state = 146 + self.doubleTickEnclosedString() + pass + else: + raise NoViableAltException(self) + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class EnclosedStringContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def OptionsStart(self): + return self.getToken(apt_sourceParser.OptionsStart, 0) + + def tickEnclosedString(self): + return self.getTypedRuleContext(apt_sourceParser.TickEnclosedStringContext,0) + + + def OptionsEnd(self): + return self.getToken(apt_sourceParser.OptionsEnd, 0) + + def getRuleIndex(self): + return apt_sourceParser.RULE_enclosedString + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterEnclosedString" ): + listener.enterEnclosedString(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitEnclosedString" ): + listener.exitEnclosedString(self) + + + + + def enclosedString(self): + + localctx = apt_sourceParser.EnclosedStringContext(self, self._ctx, self.state) + self.enterRule(localctx, 42, self.RULE_enclosedString) + try: + self.enterOuterAlt(localctx, 1) + self.state = 149 + self.match(apt_sourceParser.OptionsStart) + self.state = 150 + self.tickEnclosedString() + self.state = 151 + self.match(apt_sourceParser.OptionsEnd) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class CdromURIContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def CdromSchema(self): + return self.getToken(apt_sourceParser.CdromSchema, 0) + + def Colon(self): + return self.getToken(apt_sourceParser.Colon, 0) + + def enclosedString(self): + return self.getTypedRuleContext(apt_sourceParser.EnclosedStringContext,0) + + + def nonSpaceString(self): + return self.getTypedRuleContext(apt_sourceParser.NonSpaceStringContext,0) + + + def getRuleIndex(self): + return apt_sourceParser.RULE_cdromURI + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterCdromURI" ): + listener.enterCdromURI(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitCdromURI" ): + listener.exitCdromURI(self) + + + + + def cdromURI(self): + + localctx = apt_sourceParser.CdromURIContext(self, self._ctx, self.state) + self.enterRule(localctx, 44, self.RULE_cdromURI) + try: + self.enterOuterAlt(localctx, 1) + self.state = 153 + self.match(apt_sourceParser.CdromSchema) + self.state = 154 + self.match(apt_sourceParser.Colon) + self.state = 155 + self.enclosedString() + self.state = 156 + self.nonSpaceString() + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class UriSchemaContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.word = None # Token + self.restWords = None # RestSchemaWordsContext + + def Word(self): + return self.getToken(apt_sourceParser.Word, 0) + + def restSchemaWords(self): + return self.getTypedRuleContext(apt_sourceParser.RestSchemaWordsContext,0) + + + def getRuleIndex(self): + return apt_sourceParser.RULE_uriSchema + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterUriSchema" ): + listener.enterUriSchema(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitUriSchema" ): + listener.exitUriSchema(self) + + + + + def uriSchema(self): + + localctx = apt_sourceParser.UriSchemaContext(self, self._ctx, self.state) + self.enterRule(localctx, 46, self.RULE_uriSchema) + try: + self.enterOuterAlt(localctx, 1) + self.state = 158 + localctx.word = self.match(apt_sourceParser.Word) + self.state = 159 + localctx.restWords = self.restSchemaWords() + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class CommenterRContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def CommentMarker(self): + return self.getToken(apt_sourceParser.CommentMarker, 0) + + def WSS(self): + return self.getToken(apt_sourceParser.WSS, 0) + + def getRuleIndex(self): + return apt_sourceParser.RULE_commenterR + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterCommenterR" ): + listener.enterCommenterR(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitCommenterR" ): + listener.exitCommenterR(self) + + + + + def commenterR(self): + + localctx = apt_sourceParser.CommenterRContext(self, self._ctx, self.state) + self.enterRule(localctx, 48, self.RULE_commenterR) + try: + self.enterOuterAlt(localctx, 1) + self.state = 161 + self.match(apt_sourceParser.CommentMarker) + self.state = 162 + self.match(apt_sourceParser.WSS) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class WordWithPlusContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.word = None # Token + + def Plus(self): + return self.getToken(apt_sourceParser.Plus, 0) + + def Word(self): + return self.getToken(apt_sourceParser.Word, 0) + + def getRuleIndex(self): + return apt_sourceParser.RULE_wordWithPlus + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterWordWithPlus" ): + listener.enterWordWithPlus(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitWordWithPlus" ): + listener.exitWordWithPlus(self) + + + + + def wordWithPlus(self): + + localctx = apt_sourceParser.WordWithPlusContext(self, self._ctx, self.state) + self.enterRule(localctx, 50, self.RULE_wordWithPlus) + try: + self.enterOuterAlt(localctx, 1) + self.state = 164 + self.match(apt_sourceParser.Plus) + self.state = 165 + localctx.word = self.match(apt_sourceParser.Word) + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class RestSchemaWordsContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + + def wordWithPlus(self, i:int=None): + if i is None: + return self.getTypedRuleContexts(apt_sourceParser.WordWithPlusContext) + else: + return self.getTypedRuleContext(apt_sourceParser.WordWithPlusContext,i) + + + def getRuleIndex(self): + return apt_sourceParser.RULE_restSchemaWords + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterRestSchemaWords" ): + listener.enterRestSchemaWords(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitRestSchemaWords" ): + listener.exitRestSchemaWords(self) + + + + + def restSchemaWords(self): + + localctx = apt_sourceParser.RestSchemaWordsContext(self, self._ctx, self.state) + self.enterRule(localctx, 52, self.RULE_restSchemaWords) + self._la = 0 # Token type + try: + self.enterOuterAlt(localctx, 1) + self.state = 170 + self._errHandler.sync(self) + _la = self._input.LA(1) + while _la==12: + self.state = 167 + self.wordWithPlus() + self.state = 172 + self._errHandler.sync(self) + _la = self._input.LA(1) + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class GenericURIContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.schema = None # UriSchemaContext + self.restOfURI = None # NonSpaceStringContext + + def Colon(self): + return self.getToken(apt_sourceParser.Colon, 0) + + def uriSchema(self): + return self.getTypedRuleContext(apt_sourceParser.UriSchemaContext,0) + + + def nonSpaceString(self): + return self.getTypedRuleContext(apt_sourceParser.NonSpaceStringContext,0) + + + def getRuleIndex(self): + return apt_sourceParser.RULE_genericURI + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterGenericURI" ): + listener.enterGenericURI(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitGenericURI" ): + listener.exitGenericURI(self) + + + + + def genericURI(self): + + localctx = apt_sourceParser.GenericURIContext(self, self._ctx, self.state) + self.enterRule(localctx, 54, self.RULE_genericURI) + try: + self.enterOuterAlt(localctx, 1) + self.state = 173 + localctx.schema = self.uriSchema() + self.state = 174 + self.match(apt_sourceParser.Colon) + self.state = 175 + localctx.restOfURI = self.nonSpaceString() + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + class UriRContext(ParserRuleContext): + __slots__ = 'parser' + + def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1): + super().__init__(parent, invokingState) + self.parser = parser + self.cdrom = None # CdromURIContext + self.generic = None # GenericURIContext + + def cdromURI(self): + return self.getTypedRuleContext(apt_sourceParser.CdromURIContext,0) + + + def genericURI(self): + return self.getTypedRuleContext(apt_sourceParser.GenericURIContext,0) + + + def getRuleIndex(self): + return apt_sourceParser.RULE_uriR + + def enterRule(self, listener:ParseTreeListener): + if hasattr( listener, "enterUriR" ): + listener.enterUriR(self) + + def exitRule(self, listener:ParseTreeListener): + if hasattr( listener, "exitUriR" ): + listener.exitUriR(self) + + + + + def uriR(self): + + localctx = apt_sourceParser.UriRContext(self, self._ctx, self.state) + self.enterRule(localctx, 56, self.RULE_uriR) + try: + self.state = 179 + self._errHandler.sync(self) + token = self._input.LA(1) + if token in [3]: + self.enterOuterAlt(localctx, 1) + self.state = 177 + localctx.cdrom = self.cdromURI() + pass + elif token in [4]: + self.enterOuterAlt(localctx, 2) + self.state = 178 + localctx.generic = self.genericURI() + pass + else: + raise NoViableAltException(self) + + except RecognitionException as re: + localctx.exception = re + self._errHandler.reportError(self, re) + self._errHandler.recover(self, re) + finally: + self.exitRule() + return localctx + + + + + diff --git a/AptSourcesList/parserBundle/compiled/parglare/__init__.py b/AptSourcesList/parserBundle/compiled/parglare/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/AptSourcesList/parserBundle/compiled/parglare/apt_source.pg b/AptSourcesList/parserBundle/compiled/parglare/apt_source.pg new file mode 100644 index 0000000..174c9b0 --- /dev/null +++ b/AptSourcesList/parserBundle/compiled/parglare/apt_source.pg @@ -0,0 +1,71 @@ +//Generated by UniGrammar (https://github.com/UniGrammar/UniGrammar.py) +//for parglare (https://github.com/igordejanovic/parglare) DSL + +//A grammar for parsing `apt` config files. + + + +//productions +record: commented=commenterR_opt_our rType=TypeR WSS options=optionsR_opt_our uri=uriR WSS distribution=wordWithDash components=componentsR WSS?; +commenterR_opt_our: commenterR?; +optionsR_opt_our: optionsR?; +component: WSS cId=wordWithDash; +componentsR: component+ {shift}; +optionsR: OptionsStart pairs=optionsList OptionsEnd WSS; +optionsList: firstOption=optionR restOptions=additionalOptions; +additionalOptions: additionalOption*; +additionalOption: separator=OptionsSeparator option=optionR; +optionR: key=OptionName OptionNameValueSeparator value=optionValue; + + +//fragmented +wordWithDashSegment: Word | Dash; +wordWithDash: wordWithDashSegment+; +optionValueSegment: Word | PunctuationAllowedInOptionValue | Dash | OptionName | CdromSchema | TypeR | Plus | Colon; +nonSquareBracketStringSegment: NonWhitespaceNonOptionValueNonSquareRightBracketNonEq | optionValueSegment | OptionNameValueSeparator; +nonSpaceStringSegment: nonSquareBracketStringSegment | OptionsEnd; +optionValue: optionValueSegment+; +nonSquareBracketString: nonSquareBracketStringSegment+; +nonSpaceString: nonSpaceStringSegment+; +singleTickEnclosedString: SingleTick nonSquareBracketString SingleTick; +doubleTickEnclosedString: DoubleTick nonSquareBracketString DoubleTick; +tickEnclosedString: singleTickEnclosedString | doubleTickEnclosedString; +enclosedString: OptionsStart tickEnclosedString OptionsEnd; +cdromURI: CdromSchema Colon enclosedString nonSpaceString; +uriSchema: word=Word restWords=restSchemaWords; +commenterR: CommentMarker WSS; +wordWithPlus: Plus word=Word; +restSchemaWords: wordWithPlus*; +genericURI: schema=uriSchema Colon restOfURI=nonSpaceString; +uriR: cdrom=cdromURI | generic=genericURI; + + +LAYOUT: EMPTY; +//keywords +TypeR: 'deb' | 'deb-src'; +OptionName: 'arch' | 'lang' | 'target' | 'pdiffs' | 'by-hash' | 'valid-until-max' | 'allow-downgrade-to-insecure' | 'allow-weak' | 'allow-insecure' | 'trusted' | 'signed-by' | 'check-valid-until' | 'valid-until-min' | 'check-date' | 'inrelease-path' | 'date-max-future'; +CdromSchema: 'cdrom:'; + + +//tokens +Word: WordChar+ {shift}; +WSS: WS+; + + +terminals +//characters +WS: /[\t-\r\ ]/; +PunctuationAllowedInOptionValue: /[\/\.]/; +OptionsStart: '['; +OptionsEnd: ']'; +OptionNameValueSeparator: '='; +CommentMarker: '#'; +Plus: '+'; +Colon: ':'; +OptionsSeparator: ','; +Dash: '-'; +SingleTick: "'"; +DoubleTick: '"'; +WordChar: /[0-9A-Z_a-z]/; +NonWhitespaceNonOptionValueNonSquareRightBracketNonEq: /[^\t-\r\ "\#'\+-:=A-\]_a-z]/; + diff --git a/AptSourcesList/parserBundle/compiled/parsimonious/__init__.py b/AptSourcesList/parserBundle/compiled/parsimonious/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/AptSourcesList/parserBundle/compiled/parsimonious/apt_source.ppeg b/AptSourcesList/parserBundle/compiled/parsimonious/apt_source.ppeg new file mode 100644 index 0000000..820a676 --- /dev/null +++ b/AptSourcesList/parserBundle/compiled/parsimonious/apt_source.ppeg @@ -0,0 +1,69 @@ +#Generated by UniGrammar (https://github.com/UniGrammar/UniGrammar.py) +#for parsimonious (https://github.com/erikrose/parsimonious) DSL + +#A grammar for parsing `apt` config files. + + + +#productions +record = commenterR_opt_our TypeR WSS optionsR_opt_our uriR WSS wordWithDash componentsR WSS? +commenterR_opt_our = commenterR? +optionsR_opt_our = optionsR? +component = WSS wordWithDash +componentsR = component+ +optionsR = OptionsStart optionsList OptionsEnd WSS +optionsList = optionR additionalOptions +additionalOptions = additionalOption* +additionalOption = OptionsSeparator optionR +optionR = OptionName OptionNameValueSeparator optionValue + + +#fragmented +wordWithDashSegment = Word / Dash +wordWithDash = wordWithDashSegment+ +optionValueSegment = Word / PunctuationAllowedInOptionValue / Dash / OptionName / CdromSchema / TypeR / Plus / Colon +nonSquareBracketStringSegment = NonWhitespaceNonOptionValueNonSquareRightBracketNonEq / optionValueSegment / OptionNameValueSeparator +nonSpaceStringSegment = nonSquareBracketStringSegment / OptionsEnd +optionValue = optionValueSegment+ +nonSquareBracketString = nonSquareBracketStringSegment+ +nonSpaceString = nonSpaceStringSegment+ +singleTickEnclosedString = SingleTick nonSquareBracketString SingleTick +doubleTickEnclosedString = DoubleTick nonSquareBracketString DoubleTick +tickEnclosedString = singleTickEnclosedString / doubleTickEnclosedString +enclosedString = OptionsStart tickEnclosedString OptionsEnd +cdromURI = CdromSchema Colon enclosedString nonSpaceString +uriSchema = Word restSchemaWords +commenterR = CommentMarker WSS +wordWithPlus = Plus Word +restSchemaWords = wordWithPlus* +genericURI = uriSchema Colon nonSpaceString +uriR = cdromURI / genericURI + + +#keywords +TypeR = 'deb' / 'deb-src' +OptionName = 'arch' / 'lang' / 'target' / 'pdiffs' / 'by-hash' / 'valid-until-max' / 'allow-downgrade-to-insecure' / 'allow-weak' / 'allow-insecure' / 'trusted' / 'signed-by' / 'check-valid-until' / 'valid-until-min' / 'check-date' / 'inrelease-path' / 'date-max-future' +CdromSchema = 'cdrom:' + + +#characters +WS = ~r"[\t-\r\ ]" +PunctuationAllowedInOptionValue = ~r"[/\.]" +OptionsStart = '[' +OptionsEnd = ']' +OptionNameValueSeparator = '=' +CommentMarker = '#' +Plus = '+' +Colon = ':' +OptionsSeparator = ',' +Dash = '-' +SingleTick = "'" +DoubleTick = '"' +WordChar = ~r"[0-9A-Z_a-z]" +NonWhitespaceNonOptionValueNonSquareRightBracketNonEq = ~r"[^\t-\r\ \"\#'\+-:=A-\]_a-z]" + + +#tokens +Word = WordChar+ +WSS = WS+ + diff --git a/AptSourcesList/parserBundle/compiled/waxeye/__init__.py b/AptSourcesList/parserBundle/compiled/waxeye/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/AptSourcesList/parserBundle/compiled/waxeye/apt_source_parser.py b/AptSourcesList/parserBundle/compiled/waxeye/apt_source_parser.py new file mode 100644 index 0000000..69d6ac2 --- /dev/null +++ b/AptSourcesList/parserBundle/compiled/waxeye/apt_source_parser.py @@ -0,0 +1,329 @@ +# Generated by the Waxeye Parser Generator - version 0.8.1 +# www.waxeye.org + +from waxeye import Edge, State, FA, WaxeyeParser + +class Apt_sourceParser (WaxeyeParser): + start = 0 + eof_check = True + automata = [FA("record", [State([Edge(1, 1, False)], False), + State([Edge(29, 2, False)], False), + State([Edge(47, 3, False)], False), + State([Edge(2, 4, False)], False), + State([Edge(28, 5, False)], False), + State([Edge(47, 6, False)], False), + State([Edge(11, 7, False)], False), + State([Edge(4, 8, False)], False), + State([Edge(47, 9, False)], True), + State([], True)], FA.LEFT), + FA("commenterR_opt_our", [State([Edge(24, 1, False)], True), + State([], True)], FA.LEFT), + FA("optionsR_opt_our", [State([Edge(5, 1, False)], True), + State([], True)], FA.LEFT), + FA("component", [State([Edge(47, 1, False)], False), + State([Edge(11, 2, False)], False), + State([], True)], FA.LEFT), + FA("componentsR", [State([Edge(3, 1, False)], False), + State([Edge(3, 1, False)], True)], FA.LEFT), + FA("optionsR", [State([Edge(34, 1, False)], False), + State([Edge(6, 2, False)], False), + State([Edge(35, 3, False)], False), + State([Edge(47, 4, False)], False), + State([], True)], FA.LEFT), + FA("optionsList", [State([Edge(9, 1, False)], False), + State([Edge(7, 2, False)], False), + State([], True)], FA.LEFT), + FA("additionalOptions", [State([Edge(8, 0, False)], True)], FA.LEFT), + FA("additionalOption", [State([Edge(40, 1, False)], False), + State([Edge(9, 2, False)], False), + State([], True)], FA.LEFT), + FA("optionR", [State([Edge(30, 1, False)], False), + State([Edge(36, 2, False)], False), + State([Edge(15, 3, False)], False), + State([], True)], FA.LEFT), + FA("wordWithDashSegment", [State([Edge(46, 1, False), + Edge(41, 1, False)], False), + State([], True)], FA.LEFT), + FA("wordWithDash", [State([Edge(10, 1, False)], False), + State([Edge(10, 1, False)], True)], FA.LEFT), + FA("optionValueSegment", [State([Edge(46, 1, False), + Edge(33, 1, False), + Edge(41, 1, False), + Edge(30, 1, False), + Edge(31, 1, False), + Edge(29, 1, False), + Edge(38, 1, False), + Edge(39, 1, False)], False), + State([], True)], FA.LEFT), + FA("nonSquareBracketStringSegment", [State([Edge(45, 1, False), + Edge(12, 1, False), + Edge(36, 1, False)], False), + State([], True)], FA.LEFT), + FA("nonSpaceStringSegment", [State([Edge(13, 1, False), + Edge(35, 1, False)], False), + State([], True)], FA.LEFT), + FA("optionValue", [State([Edge(12, 1, False)], False), + State([Edge(12, 1, False)], True)], FA.LEFT), + FA("nonSquareBracketString", [State([Edge(13, 1, False)], False), + State([Edge(13, 1, False)], True)], FA.LEFT), + FA("nonSpaceString", [State([Edge(14, 1, False)], False), + State([Edge(14, 1, False)], True)], FA.LEFT), + FA("singleTickEnclosedString", [State([Edge(42, 1, False)], False), + State([Edge(16, 2, False)], False), + State([Edge(42, 3, False)], False), + State([], True)], FA.LEFT), + FA("doubleTickEnclosedString", [State([Edge(43, 1, False)], False), + State([Edge(16, 2, False)], False), + State([Edge(43, 3, False)], False), + State([], True)], FA.LEFT), + FA("tickEnclosedString", [State([Edge(18, 1, False), + Edge(19, 1, False)], False), + State([], True)], FA.LEFT), + FA("enclosedString", [State([Edge(34, 1, False)], False), + State([Edge(20, 2, False)], False), + State([Edge(35, 3, False)], False), + State([], True)], FA.LEFT), + FA("cdromURI", [State([Edge(31, 1, False)], False), + State([Edge(39, 2, False)], False), + State([Edge(21, 3, False)], False), + State([Edge(17, 4, False)], False), + State([], True)], FA.LEFT), + FA("uriSchema", [State([Edge(46, 1, False)], False), + State([Edge(26, 2, False)], False), + State([], True)], FA.LEFT), + FA("commenterR", [State([Edge(37, 1, False)], False), + State([Edge(47, 2, False)], False), + State([], True)], FA.LEFT), + FA("wordWithPlus", [State([Edge(38, 1, False)], False), + State([Edge(46, 2, False)], False), + State([], True)], FA.LEFT), + FA("restSchemaWords", [State([Edge(25, 0, False)], True)], FA.LEFT), + FA("genericURI", [State([Edge(23, 1, False)], False), + State([Edge(39, 2, False)], False), + State([Edge(17, 3, False)], False), + State([], True)], FA.LEFT), + FA("uriR", [State([Edge(22, 1, False), + Edge(27, 1, False)], False), + State([], True)], FA.LEFT), + FA("typeR", [State([Edge(["D", "d"], 1, False)], False), + State([Edge(["E", "e"], 2, False)], False), + State([Edge(["B", "b"], 3, False)], False), + State([Edge(["-"], 4, False)], True), + State([Edge(["S", "s"], 5, False)], False), + State([Edge(["R", "r"], 6, False)], False), + State([Edge(["C", "c"], 7, False)], False), + State([], True)], FA.LEFT), + FA("optionName", [State([Edge(["A", "a"], 1, False), + Edge(["L", "l"], 5, False), + Edge(["T", "t"], 8, False), + Edge(["P", "p"], 13, False), + Edge(["B", "b"], 18, False), + Edge(["V", "v"], 24, False), + Edge(["A", "a"], 38, False), + Edge(["T", "t"], 74, False), + Edge(["S", "s"], 80, False), + Edge(["C", "c"], 88, False), + Edge(["V", "v"], 104, False), + Edge(["C", "c"], 118, False), + Edge(["I", "i"], 127, False), + Edge(["D", "d"], 140, False)], False), + State([Edge(["R", "r"], 2, False)], False), + State([Edge(["C", "c"], 3, False)], False), + State([Edge(["H", "h"], 4, False)], False), + State([], True), + State([Edge(["A", "a"], 6, False)], False), + State([Edge(["N", "n"], 7, False)], False), + State([Edge(["G", "g"], 4, False)], False), + State([Edge(["A", "a"], 9, False)], False), + State([Edge(["R", "r"], 10, False)], False), + State([Edge(["G", "g"], 11, False)], False), + State([Edge(["E", "e"], 12, False)], False), + State([Edge(["T", "t"], 4, False)], False), + State([Edge(["D", "d"], 14, False)], False), + State([Edge(["I", "i"], 15, False)], False), + State([Edge(["F", "f"], 16, False)], False), + State([Edge(["F", "f"], 17, False)], False), + State([Edge(["S", "s"], 4, False)], False), + State([Edge(["Y", "y"], 19, False)], False), + State([Edge(["-"], 20, False)], False), + State([Edge(["H", "h"], 21, False)], False), + State([Edge(["A", "a"], 22, False)], False), + State([Edge(["S", "s"], 23, False)], False), + State([Edge(["H", "h"], 4, False)], False), + State([Edge(["A", "a"], 25, False)], False), + State([Edge(["L", "l"], 26, False)], False), + State([Edge(["I", "i"], 27, False)], False), + State([Edge(["D", "d"], 28, False)], False), + State([Edge(["-"], 29, False)], False), + State([Edge(["U", "u"], 30, False)], False), + State([Edge(["N", "n"], 31, False)], False), + State([Edge(["T", "t"], 32, False)], False), + State([Edge(["I", "i"], 33, False)], False), + State([Edge(["L", "l"], 34, False)], False), + State([Edge(["-"], 35, False)], False), + State([Edge(["M", "m"], 36, False)], False), + State([Edge(["A", "a"], 37, False)], False), + State([Edge(["X", "x"], 4, False)], False), + State([Edge(["L", "l"], 39, False)], False), + State([Edge(["L", "l"], 40, False)], False), + State([Edge(["O", "o"], 41, False)], False), + State([Edge(["W", "w"], 42, False)], False), + State([Edge(["-"], 43, False)], False), + State([Edge(["D", "d"], 44, False), + Edge(["W", "w"], 64, False), + Edge(["I", "i"], 67, False)], False), + State([Edge(["O", "o"], 45, False)], False), + State([Edge(["W", "w"], 46, False)], False), + State([Edge(["N", "n"], 47, False)], False), + State([Edge(["G", "g"], 48, False)], False), + State([Edge(["R", "r"], 49, False)], False), + State([Edge(["A", "a"], 50, False)], False), + State([Edge(["D", "d"], 51, False)], False), + State([Edge(["E", "e"], 52, False)], False), + State([Edge(["-"], 53, False)], False), + State([Edge(["T", "t"], 54, False)], False), + State([Edge(["O", "o"], 55, False)], False), + State([Edge(["-"], 56, False)], False), + State([Edge(["I", "i"], 57, False)], False), + State([Edge(["N", "n"], 58, False)], False), + State([Edge(["S", "s"], 59, False)], False), + State([Edge(["E", "e"], 60, False)], False), + State([Edge(["C", "c"], 61, False)], False), + State([Edge(["U", "u"], 62, False)], False), + State([Edge(["R", "r"], 63, False)], False), + State([Edge(["E", "e"], 4, False)], False), + State([Edge(["E", "e"], 65, False)], False), + State([Edge(["A", "a"], 66, False)], False), + State([Edge(["K", "k"], 4, False)], False), + State([Edge(["N", "n"], 68, False)], False), + State([Edge(["S", "s"], 69, False)], False), + State([Edge(["E", "e"], 70, False)], False), + State([Edge(["C", "c"], 71, False)], False), + State([Edge(["U", "u"], 72, False)], False), + State([Edge(["R", "r"], 73, False)], False), + State([Edge(["E", "e"], 4, False)], False), + State([Edge(["R", "r"], 75, False)], False), + State([Edge(["U", "u"], 76, False)], False), + State([Edge(["S", "s"], 77, False)], False), + State([Edge(["T", "t"], 78, False)], False), + State([Edge(["E", "e"], 79, False)], False), + State([Edge(["D", "d"], 4, False)], False), + State([Edge(["I", "i"], 81, False)], False), + State([Edge(["G", "g"], 82, False)], False), + State([Edge(["N", "n"], 83, False)], False), + State([Edge(["E", "e"], 84, False)], False), + State([Edge(["D", "d"], 85, False)], False), + State([Edge(["-"], 86, False)], False), + State([Edge(["B", "b"], 87, False)], False), + State([Edge(["Y", "y"], 4, False)], False), + State([Edge(["H", "h"], 89, False)], False), + State([Edge(["E", "e"], 90, False)], False), + State([Edge(["C", "c"], 91, False)], False), + State([Edge(["K", "k"], 92, False)], False), + State([Edge(["-"], 93, False)], False), + State([Edge(["V", "v"], 94, False)], False), + State([Edge(["A", "a"], 95, False)], False), + State([Edge(["L", "l"], 96, False)], False), + State([Edge(["I", "i"], 97, False)], False), + State([Edge(["D", "d"], 98, False)], False), + State([Edge(["-"], 99, False)], False), + State([Edge(["U", "u"], 100, False)], False), + State([Edge(["N", "n"], 101, False)], False), + State([Edge(["T", "t"], 102, False)], False), + State([Edge(["I", "i"], 103, False)], False), + State([Edge(["L", "l"], 4, False)], False), + State([Edge(["A", "a"], 105, False)], False), + State([Edge(["L", "l"], 106, False)], False), + State([Edge(["I", "i"], 107, False)], False), + State([Edge(["D", "d"], 108, False)], False), + State([Edge(["-"], 109, False)], False), + State([Edge(["U", "u"], 110, False)], False), + State([Edge(["N", "n"], 111, False)], False), + State([Edge(["T", "t"], 112, False)], False), + State([Edge(["I", "i"], 113, False)], False), + State([Edge(["L", "l"], 114, False)], False), + State([Edge(["-"], 115, False)], False), + State([Edge(["M", "m"], 116, False)], False), + State([Edge(["I", "i"], 117, False)], False), + State([Edge(["N", "n"], 4, False)], False), + State([Edge(["H", "h"], 119, False)], False), + State([Edge(["E", "e"], 120, False)], False), + State([Edge(["C", "c"], 121, False)], False), + State([Edge(["K", "k"], 122, False)], False), + State([Edge(["-"], 123, False)], False), + State([Edge(["D", "d"], 124, False)], False), + State([Edge(["A", "a"], 125, False)], False), + State([Edge(["T", "t"], 126, False)], False), + State([Edge(["E", "e"], 4, False)], False), + State([Edge(["N", "n"], 128, False)], False), + State([Edge(["R", "r"], 129, False)], False), + State([Edge(["E", "e"], 130, False)], False), + State([Edge(["L", "l"], 131, False)], False), + State([Edge(["E", "e"], 132, False)], False), + State([Edge(["A", "a"], 133, False)], False), + State([Edge(["S", "s"], 134, False)], False), + State([Edge(["E", "e"], 135, False)], False), + State([Edge(["-"], 136, False)], False), + State([Edge(["P", "p"], 137, False)], False), + State([Edge(["A", "a"], 138, False)], False), + State([Edge(["T", "t"], 139, False)], False), + State([Edge(["H", "h"], 4, False)], False), + State([Edge(["A", "a"], 141, False)], False), + State([Edge(["T", "t"], 142, False)], False), + State([Edge(["E", "e"], 143, False)], False), + State([Edge(["-"], 144, False)], False), + State([Edge(["M", "m"], 145, False)], False), + State([Edge(["A", "a"], 146, False)], False), + State([Edge(["X", "x"], 147, False)], False), + State([Edge(["-"], 148, False)], False), + State([Edge(["F", "f"], 149, False)], False), + State([Edge(["U", "u"], 150, False)], False), + State([Edge(["T", "t"], 151, False)], False), + State([Edge(["U", "u"], 152, False)], False), + State([Edge(["R", "r"], 153, False)], False), + State([Edge(["E", "e"], 4, False)], False)], FA.LEFT), + FA("cdromSchema", [State([Edge(["C", "c"], 1, False)], False), + State([Edge(["D", "d"], 2, False)], False), + State([Edge(["R", "r"], 3, False)], False), + State([Edge(["O", "o"], 4, False)], False), + State([Edge(["M", "m"], 5, False)], False), + State([Edge([":"], 6, False)], False), + State([], True)], FA.LEFT), + FA("wS", [State([Edge([(9, 13), " "], 1, False)], False), + State([], True)], FA.LEFT), + FA("punctuationAllowedInOptionValue", [State([Edge([(46, 47)], 1, False)], False), + State([], True)], FA.LEFT), + FA("optionsStart", [State([Edge("[", 1, False)], False), + State([], True)], FA.LEFT), + FA("optionsEnd", [State([Edge("]", 1, False)], False), + State([], True)], FA.LEFT), + FA("optionNameValueSeparator", [State([Edge("=", 1, False)], False), + State([], True)], FA.LEFT), + FA("commentMarker", [State([Edge("#", 1, False)], False), + State([], True)], FA.LEFT), + FA("plus", [State([Edge("+", 1, False)], False), + State([], True)], FA.LEFT), + FA("colon", [State([Edge(":", 1, False)], False), + State([], True)], FA.LEFT), + FA("optionsSeparator", [State([Edge(",", 1, False)], False), + State([], True)], FA.LEFT), + FA("dash", [State([Edge("-", 1, False)], False), + State([], True)], FA.LEFT), + FA("singleTick", [State([Edge("\'", 1, False)], False), + State([], True)], FA.LEFT), + FA("doubleTick", [State([Edge("\"", 1, False)], False), + State([], True)], FA.LEFT), + FA("wordChar", [State([Edge([(48, 57), (65, 90), "_", (97, 122)], 1, False)], False), + State([], True)], FA.LEFT), + FA("nonWhitespaceNonOptionValueNonSquareRightBracketNonEq", [State([Edge(48, 1, False)], False), + State([], True)], FA.LEFT), + FA("word", [State([Edge(44, 1, False)], False), + State([Edge(44, 1, False)], True)], FA.LEFT), + FA("wSS", [State([Edge(32, 1, False)], False), + State([Edge(32, 1, False)], True)], FA.LEFT), + FA("", [State([Edge([(9, 13), " ", (34, 35), "\'", (43, 58), "=", (65, 93), "_", (97, 122)], 1, False)], False), + State([], True)], FA.NEG)] + + def __init__(self): + WaxeyeParser.__init__(self, Apt_sourceParser.start, Apt_sourceParser.eof_check, Apt_sourceParser.automata) + diff --git a/AptSourcesList/parserBundle/schemas/__init__.py b/AptSourcesList/parserBundle/schemas/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/AptSourcesList/parserBundle/schemas/capless/__init__.py b/AptSourcesList/parserBundle/schemas/capless/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/AptSourcesList/parserBundle/schemas/capless/apt_source.json b/AptSourcesList/parserBundle/schemas/capless/apt_source.json new file mode 100644 index 0000000..b829690 --- /dev/null +++ b/AptSourcesList/parserBundle/schemas/capless/apt_source.json @@ -0,0 +1,28 @@ +{ + "record": { + "commenterR_opt_our": "commented", + "TypeR": "rType", + "optionsR_opt_our": "options", + "uriR": "uri", + "wordWithDash": "distribution", + "componentsR": "components" + }, + "component": { + "wordWithDash": "cId" + }, + "optionsR": { + "optionsList": "pairs" + }, + "optionsList": { + "optionR": "firstOption", + "additionalOptions": "restOptions" + }, + "additionalOption": { + "OptionsSeparator": "separator", + "optionR": "option" + }, + "optionR": { + "OptionName": "key", + "optionValue": "value" + } +} \ No newline at end of file diff --git a/AptSourcesList/parserBundle/schemas/iterless/__init__.py b/AptSourcesList/parserBundle/schemas/iterless/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/AptSourcesList/parserBundle/schemas/iterless/apt_source.json b/AptSourcesList/parserBundle/schemas/iterless/apt_source.json new file mode 100644 index 0000000..20e1033 --- /dev/null +++ b/AptSourcesList/parserBundle/schemas/iterless/apt_source.json @@ -0,0 +1,4 @@ +[ + "additionalOptions", + "componentsR" +] \ No newline at end of file diff --git a/AptSourcesList/parserBundle/wrappers/__init__.py b/AptSourcesList/parserBundle/wrappers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/AptSourcesList/parserBundle/wrappers/apt_source.py b/AptSourcesList/parserBundle/wrappers/apt_source.py new file mode 100644 index 0000000..b1875b4 --- /dev/null +++ b/AptSourcesList/parserBundle/wrappers/apt_source.py @@ -0,0 +1,119 @@ +import typing +from UniGrammarRuntime.IWrapper import IWrapper, IParseResult + + +class record(IParseResult): + __slots__ = ("commented", "rType", "options", "uri", "distribution", "components") + + def __init__(self): + self.commented = None + self.rType = None + self.options = None + self.uri = None + self.distribution = None + self.components = None + + +class component(IParseResult): + __slots__ = ("cId",) + + def __init__(self): + self.cId = None + + +class optionsR(IParseResult): + __slots__ = ("pairs",) + + def __init__(self): + self.pairs = None + + +class optionsList(IParseResult): + __slots__ = "firstOption", "restOptions" + + def __init__(self): + self.firstOption = None + self.restOptions = None + + +class additionalOption(IParseResult): + __slots__ = "separator", "option" + + def __init__(self): + self.separator = None + self.option = None + + +class optionR(IParseResult): + __slots__ = "key", "value" + + def __init__(self): + self.key = None + self.value = None + + +class recordParser(IWrapper): + __slots__ = () + + def process_record(self, parsed) -> record: + rec = record() + rec.commented = self.process_commenterR_opt_our(getattr(parsed, "commented", None)) + rec.rType = self.backend.terminalNodeToStr(parsed.rType) + rec.options = self.process_optionsR_opt_our(getattr(parsed, "options", None)) + rec.uri = self.backend.getSubTreeText(parsed.uri) + rec.distribution = self.backend.getSubTreeText(parsed.distribution) + rec.components = self.process_componentsR(parsed.components) + return rec + + def process_commenterR_opt_our(self, parsed) -> typing.Optional[str]: + return self.backend.enterOptional(parsed, self.backend.getSubTreeText) + + def process_optionsR_opt_our(self, parsed) -> typing.Optional[optionsR]: + return self.backend.enterOptional(parsed, self.process_optionsR) + + def process_component(self, parsed) -> component: + rec = component() + rec.cId = self.backend.getSubTreeText(parsed.cId) + return rec + + def process_componentsR_(self, parsed) -> typing.Iterable[component]: + for f in self.backend.wstr.iterateCollection(parsed): + yield f + + def process_componentsR(self, parsed) -> typing.Iterable[component]: + return [self.process_component(f) for f in self.process_componentsR_(parsed)] + + def process_optionsR(self, parsed) -> optionsR: + rec = optionsR() + rec.pairs = self.process_optionsList(parsed.pairs) + return rec + + def process_optionsList(self, parsed) -> optionsList: + rec = optionsList() + rec.firstOption = self.process_optionR(parsed.firstOption) + rec.restOptions = self.process_additionalOptions(parsed.restOptions) + return rec + + def process_additionalOptions_(self, parsed) -> typing.Iterable[additionalOption]: + for f in self.backend.wstr.iterateCollection(parsed): + yield f + + def process_additionalOptions(self, parsed) -> typing.Iterable[additionalOption]: + return [self.process_additionalOption(f) for f in self.process_additionalOptions_(parsed)] + + def process_additionalOption(self, parsed) -> additionalOption: + rec = additionalOption() + rec.separator = self.backend.terminalNodeToStr(parsed.separator) + rec.option = self.process_optionR(parsed.option) + return rec + + def process_optionR(self, parsed) -> optionR: + rec = optionR() + rec.key = self.backend.terminalNodeToStr(parsed.key) + rec.value = self.backend.getSubTreeText(parsed.value) + return rec + + __MAIN_PRODUCTION__ = process_record + + +__MAIN_PARSER__ = recordParser diff --git a/AptSourcesList/py.typed b/AptSourcesList/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..602af25 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,6 @@ +include UNLICENSE +include *.md +include tests +global-include .editorconfig +global-include *.pgt +global-include *.pglr diff --git a/ReadMe.md b/ReadMe.md new file mode 100644 index 0000000..86e2749 --- /dev/null +++ b/ReadMe.md @@ -0,0 +1,16 @@ +AptSourcesList.py [![Unlicensed work](https://raw.githubusercontent.com/unlicense/unlicense.org/master/static/favicon.png)](https://unlicense.org/) +=============== +~~![GitLab Build Status](https://gitlab.com/KOLANICH/AptSourcesList.py/badges/master/pipeline.svg)~~ +~~[wheel (GHA via `nightly.link`)](https://nightly.link/KOLANICH-libs/AptSourcesList.py/workflows/CI/master/AptSourcesList-0.CI-py3-none-any.whl)~~ +~~[![GitHub Actions](https://github.com/KOLANICH-libs/AptSourcesList.py/workflows/CI/badge.svg)](https://github.com/KOLANICH-libs/AptSourcesList.py/actions/)~~ +~~![GitLab Coverage](https://gitlab.com/KOLANICH/AptSourcesList.py/badges/master/coverage.svg)~~ +[![Libraries.io Status](https://img.shields.io/librariesio/github/KOLANICH-libs/AptSourcesList.py.svg)](https://libraries.io/github/KOLANICH-libs/AptSourcesList.py) +[![Code style: antiflash](https://img.shields.io/badge/code%20style-antiflash-FFF.svg)](https://codeberg.org/KOLANICH-tools/antiflash.py) + +This is the library to parse APT `sources.list` and serialize the modified version back. + +Requirements +------------ +* [`UniGrammarRuntime`](https://codeberg.org/UniGrammar/UniGrammarRuntime.py) +* Any of the parser libs: + * [`parglare`](https://github.com/igordejanovic/parglare) ![Licence](https://img.shields.io/github/license/igordejanovic/parglare.svg) [![PyPi Status](https://img.shields.io/pypi/v/parglare.svg)](https://pypi.python.org/pypi/parglare) [![Libraries.io Status](https://img.shields.io/librariesio/github/igordejanovic/parglare.svg)](https://libraries.io/github/igordejanovic/parglare) diff --git a/UNLICENSE b/UNLICENSE new file mode 100644 index 0000000..efb9808 --- /dev/null +++ b/UNLICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to diff --git a/grammar.yug b/grammar.yug new file mode 100644 index 0000000..1a29e7e --- /dev/null +++ b/grammar.yug @@ -0,0 +1,275 @@ +meta: + id: apt_source + title: Config file used by `apt` tool + license: Unlicense + class: LL +doc: A grammar for parsing `apt` config files. + + +chars: + - id: WS + wellknown: whitespace + - id: PunctuationAllowedInOptionValue + alt: /. + - id: OptionsStart + lit: '[' + - id: OptionsEnd + lit: ']' + - id: OptionNameValueSeparator + lit: '=' + - id: CommentMarker + lit: '#' + - id: Plus + lit: + + - id: Colon + lit: ':' + - id: OptionsSeparator + lit: ',' + - id: Dash + lit: '-' + - id: SingleTick + lit: "'" + - id: DoubleTick + lit: '"' + - id: WordChar + alt: + - wellknown: ascii_lowercase + - wellknown: ascii_uppercase + - wellknown: digits + - lit: _ + - id: NonWhitespaceNonOptionValueNonSquareRightBracketNonEq + alt: + - ref: WS + - ref: WordChar + - ref: PunctuationAllowedInOptionValue + - lit: \ + - ref: OptionsStart + - ref: OptionsEnd + - ref: CommentMarker + - ref: Plus + - ref: Colon + - ref: OptionNameValueSeparator + - ref: OptionsSeparator + - ref: Dash + - ref: SingleTick + - ref: DoubleTick + negative: true +keywords: + - id: TypeR + alt: + - lit: deb + - lit: deb-src + - id: OptionName + alt: + - lit: arch + - lit: lang + - lit: target + - lit: pdiffs + - lit: by-hash + - lit: valid-until-max + - lit: allow-downgrade-to-insecure + - lit: allow-weak + - lit: allow-insecure + - lit: trusted + - lit: signed-by + - lit: check-valid-until + - lit: valid-until-min + - lit: check-date + - lit: inrelease-path + - lit: date-max-future + - id: CdromSchema + lit: 'cdrom:' +tokens: + - id: Word + ref: WordChar + min: 1 + prefer: shift + - id: WSS + ref: WS + min: 1 +fragmented: + - id: wordWithDashSegment + alt: + - ref: Word + - ref: Dash + + - id: wordWithDash + ref: wordWithDashSegment + min: 1 + + - id: optionValueSegment + alt: + - ref: Word + - ref: PunctuationAllowedInOptionValue + - ref: Dash + - ref: OptionName + - ref: CdromSchema + - ref: TypeR + - ref: Plus + - ref: Colon + + - id: nonSquareBracketStringSegment + alt: + - ref: NonWhitespaceNonOptionValueNonSquareRightBracketNonEq + - ref: optionValueSegment + - ref: OptionNameValueSeparator + + - id: nonSpaceStringSegment + alt: + - ref: nonSquareBracketStringSegment + - ref: OptionsEnd + + + - id: optionValue + ref: optionValueSegment + min: 1 + + - id: nonSquareBracketString + ref: nonSquareBracketStringSegment + min: 1 + + - id: nonSpaceString + ref: nonSpaceStringSegment + min: 1 + + - spacer: 1 + - id: singleTickEnclosedString + seq: + - ref: SingleTick + - ref: nonSquareBracketString + - ref: SingleTick + + - id: doubleTickEnclosedString + seq: + - ref: DoubleTick + - ref: nonSquareBracketString + - ref: DoubleTick + - id: tickEnclosedString + alt: + - ref: singleTickEnclosedString + - ref: doubleTickEnclosedString + - id: enclosedString + seq: + - ref: OptionsStart + - ref: tickEnclosedString + - ref: OptionsEnd + - id: cdromURI + seq: + - ref: CdromSchema + - ref: Colon + - ref: enclosedString + - ref: nonSpaceString + + - id: uriSchema + seq: + - ref: Word + cap: word + - ref: restSchemaWords + cap: restWords + + - id: commenterR + seq: + - ref: CommentMarker + - ref: WSS + + - id: wordWithPlus + seq: + - ref: Plus + - ref: Word + cap: word + + - id: restSchemaWords + ref: wordWithPlus + min: 0 + - id: genericURI + seq: + - ref: uriSchema + cap: schema + - ref: Colon + - ref: nonSpaceString + cap: restOfURI + + - id: uriR + alt: + - cap: cdrom + ref: cdromURI + - cap: generic + ref: genericURI + +prods: + - id: record + seq: + - ref: commenterR_opt_our + cap: commented + - cap: rType + ref: TypeR + - uncap: + ref: WSS + - ref: optionsR_opt_our + cap: options + - ref: uriR + cap: uri + - uncap: + ref: WSS + - ref: wordWithDash + cap: distribution + - ref: componentsR + cap: components + - uncap: + opt: + ref: WSS + + - id: commenterR_opt_our + opt: + ref: commenterR + + - id: optionsR_opt_our + opt: + ref: optionsR + + + + - id: component + seq: + - ref: WSS + - ref: wordWithDash + cap: cId + + - id: componentsR + ref: component + min: 1 + prefer: shift + - spacer: 1 + - id: optionsR + seq: + - uncap: + ref: OptionsStart + - ref: optionsList + cap: pairs + - uncap: + ref: OptionsEnd + - ref: WSS + + - id: optionsList + seq: + - ref: optionR + cap: firstOption + - ref: additionalOptions + cap: restOptions + - id: additionalOptions + ref: additionalOption + min: 0 + - id: additionalOption + seq: + - ref: OptionsSeparator + cap: separator + - ref: optionR + cap: option + + - id: optionR + seq: + - ref: OptionName + cap: key + - ref: OptionNameValueSeparator + - ref: optionValue + cap: value diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..4ae8c3a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,51 @@ +[build-system] +requires = ["setuptools>=62.2", "setuptools_scm[toml]>=3.4.3"] +build-backend = "setuptools.build_meta" + +[project] +name = "AptSourcesList" +# version = 0.1 +authors = [{name = "KOLANICH"}] +description = "A package to parse and serizlize APT source.list files" +readme = "ReadMe.md" +keywords = ["APT", "debian", "ubuntu"] +license = {text = "Unlicense"} +classifiers = [ + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Development Status :: 4 - Beta", + "Environment :: Other Environment", + "Intended Audience :: Developers", + "License :: Public Domain", + "Operating System :: OS Independent", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Security", +] +requires-python = ">=3.4" +dynamic = ["version"] +dependencies = [ + "UniGrammarRuntime", # @ git+https://codeberg.org/UniGrammar/UniGrammarRuntime.py.git +] + +[project.urls] +Homepage = "https://codeberg.org/KOLANICH-libs/AptSourcesList.py" + +[project.optional-dependencies] +waxeye = [ + "waxeye", # @ git+https://github.com/waxeye-org/waxeye.git#subdirectory=src/python +] +parglare = [ + "parglare" # @ git+https://github.com/igordejanovic/parglare.git" +] +antlr = [ + "antlr4-python3-runtime", # @ git+https://github.com/antlr/antlr4.git#subdirectory=runtime/Python3" +] + +[tool.setuptools] +zip-safe = true +include-package-data = true + +[tool.setuptools.packages] +find = {namespaces = false} + +[tool.setuptools_scm] diff --git a/tests/sources.list b/tests/sources.list new file mode 100644 index 0000000..f79ab99 --- /dev/null +++ b/tests/sources.list @@ -0,0 +1,26 @@ +deb [signed-by=/etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg] tor+https://mirrors.kernel.org/ubuntu/ focal main restricted +# deb-src [signed-by=/etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg] tor+https://mirrors.kernel.org/ubuntu/ focal main restricted +deb [signed-by=/etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg] tor+https://mirrors.kernel.org/ubuntu/ focal-updates main restricted +# deb-src [signed-by=/etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg] tor+https://mirrors.kernel.org/ubuntu/ focal-updates main restricted +deb [signed-by=/etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg] tor+https://mirrors.kernel.org/ubuntu/ focal universe +deb-src [signed-by=/etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg] tor+https://mirrors.kernel.org/ubuntu/ focal universe +deb [signed-by=/etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg] tor+https://mirrors.kernel.org/ubuntu/ focal-updates universe +deb-src [signed-by=/etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg] tor+https://mirrors.kernel.org/ubuntu/ focal-updates universe +deb [signed-by=/etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg] tor+https://mirrors.kernel.org/ubuntu/ focal multiverse +# deb-src http://ru.archive.ubuntu.com/ubuntu/ focal multiverse +deb [signed-by=/etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg] tor+https://mirrors.kernel.org/ubuntu/ focal-updates multiverse +# deb-src http://ru.archive.ubuntu.com/ubuntu/ focal-updates multiverse +deb [signed-by=/etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg] tor+https://mirrors.kernel.org/ubuntu/ focal-backports main restricted universe multiverse +#deb-src http://ru.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse +deb [signed-by=D43F640145369C51D786DDEA76F1A20FF987672F] tor+https://dl.winehq.org/wine-builds/ubuntu/ focal main +# deb-src [signed-by=D43F640145369C51D786DDEA76F1A20FF987672F] tor+https://dl.winehq.org/wine-builds/ubuntu/ focal main +deb [signed-by=/etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg] tor+https://mirrors.kernel.org/ubuntu/ focal-security main restricted +# deb-src http://security.ubuntu.com/ubuntu/ focal-security main restricted +deb [signed-by=/etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg] tor+https://mirrors.kernel.org/ubuntu/ focal-security universe +# deb-src http://security.ubuntu.com/ubuntu/ focal-security universe +deb [signed-by=/etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg] tor+https://mirrors.kernel.org/ubuntu/ focal-security multiverse +# deb-src http://security.ubuntu.com/ubuntu/ focal-security multiverse +# deb http://archive.canonical.com/ubuntu/ focal partner +# deb-src http://archive.canonical.com/ubuntu/ focal partner +deb [signed-by=/etc/apt/trusted.gpg.d/llvm-official.gpg] tor+https://apt.llvm.org/eoan/ llvm-toolchain-eoan main +deb [signed-by=3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF] tor+https://download.mono-project.com/repo/ubuntu stable-bionic main