├── HISTORY.md ├── decaf2many ├── lang │ ├── __init__.py │ ├── Makefile │ ├── JavadocLexer.tokens │ ├── JavadocParser.tokens │ ├── JavadocLexer.g4 │ ├── JavaLexer.tokens │ ├── JavaParser.tokens │ ├── JavadocParser.g4 │ ├── JavadocLexer.interp │ ├── JavadocParserVisitor.py │ ├── JavadocLexer.py │ ├── JavaLexer.g4 │ ├── JavadocParserListener.py │ ├── JavadocParser.interp │ ├── JavaParser.g4 │ ├── JavaParserVisitor.py │ ├── JavaLexer.interp │ └── JavaParserListener.py ├── __init__.py ├── cli.py └── decaf2many.py ├── tests ├── __init__.py ├── expected │ ├── Expression.py │ └── HelloWorld.py ├── cases │ ├── Expression.java │ └── HelloWorld.java └── test_cli.py ├── requirements_dev.txt ├── MANIFEST.in ├── .github ├── workflows │ ├── auto-cancellation.yml │ └── main.yml └── ISSUE_TEMPLATE.md ├── tox.ini ├── .editorconfig ├── setup.cfg ├── .travis.yml ├── LICENSE ├── setup.py ├── .gitignore ├── README.md ├── Makefile └── CONTRIBUTING.md /HISTORY.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /decaf2many/lang/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | """Unit test package for decaf2many.""" 2 | -------------------------------------------------------------------------------- /tests/expected/Expression.py: -------------------------------------------------------------------------------- 1 | class Expression: 2 | def add(a: i32, b: i32): 3 | c = 10 4 | d = c + a + b 5 | return d 6 | -------------------------------------------------------------------------------- /decaf2many/__init__.py: -------------------------------------------------------------------------------- 1 | """Top-level package for decaf2many.""" 2 | 3 | __author__ = """Arun Sharma""" 4 | __email__ = "arun@sharma-home.net" 5 | __version__ = "0.1.0" 6 | -------------------------------------------------------------------------------- /tests/cases/Expression.java: -------------------------------------------------------------------------------- 1 | class Expression { 2 | 3 | public int add(int a, int b) { 4 | int c = 10; 5 | int d = c + a + b; 6 | return d; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /requirements_dev.txt: -------------------------------------------------------------------------------- 1 | pip==19.2.3 2 | bump2version==0.5.11 3 | wheel==0.33.6 4 | watchdog==0.9.0 5 | flake8==3.7.8 6 | tox==3.14.0 7 | coverage==4.5.4 8 | Sphinx==1.8.5 9 | twine==1.14.0 10 | 11 | 12 | -------------------------------------------------------------------------------- /decaf2many/lang/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | antlr4 -Dlanguage=Python3 -visitor JavaLexer.g4 3 | antlr4 -Dlanguage=Python3 -visitor JavaParser.g4 4 | antlr4 -Dlanguage=Python3 -visitor JavadocLexer.g4 5 | antlr4 -Dlanguage=Python3 -visitor JavadocParser.g4 6 | -------------------------------------------------------------------------------- /tests/expected/HelloWorld.py: -------------------------------------------------------------------------------- 1 | # This is the HelloWorld class with a single method. 2 | 3 | 4 | class HelloWorld: 5 | @staticmethod 6 | def main(args: List[str]): 7 | print("Hello, world.") 8 | 9 | def add(a: i32, b: i32): 10 | return a + b 11 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include CONTRIBUTING.md 2 | include HISTORY.md 3 | include LICENSE 4 | include README.md 5 | 6 | recursive-include tests * 7 | recursive-exclude * __pycache__ 8 | recursive-exclude * *.py[co] 9 | 10 | recursive-include docs *.md conf.py Makefile make.bat *.jpg *.png *.gif 11 | -------------------------------------------------------------------------------- /decaf2many/lang/JavadocLexer.tokens: -------------------------------------------------------------------------------- 1 | NAME=1 2 | NEWLINE=2 3 | SPACE=3 4 | TEXT_CONTENT=4 5 | AT=5 6 | STAR=6 7 | SLASH=7 8 | JAVADOC_START=8 9 | JAVADOC_END=9 10 | INLINE_TAG_START=10 11 | BRACE_OPEN=11 12 | BRACE_CLOSE=12 13 | '@'=5 14 | '*'=6 15 | '/'=7 16 | '{@'=10 17 | '{'=11 18 | '}'=12 19 | -------------------------------------------------------------------------------- /decaf2many/lang/JavadocParser.tokens: -------------------------------------------------------------------------------- 1 | NAME=1 2 | NEWLINE=2 3 | SPACE=3 4 | TEXT_CONTENT=4 5 | AT=5 6 | STAR=6 7 | SLASH=7 8 | JAVADOC_START=8 9 | JAVADOC_END=9 10 | INLINE_TAG_START=10 11 | BRACE_OPEN=11 12 | BRACE_CLOSE=12 13 | '@'=5 14 | '*'=6 15 | '/'=7 16 | '{@'=10 17 | '{'=11 18 | '}'=12 19 | -------------------------------------------------------------------------------- /tests/cases/HelloWorld.java: -------------------------------------------------------------------------------- 1 | // This is the HelloWorld class with a single method. 2 | class HelloWorld { 3 | public static void main(String[] args) { 4 | System.out.println("Hello, world."); 5 | } 6 | 7 | public int add(int a, int b) { 8 | return a + b; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.github/workflows/auto-cancellation.yml: -------------------------------------------------------------------------------- 1 | name: Cancelling previous actions runs. 2 | on: pull_request 3 | 4 | jobs: 5 | cancel: 6 | name: auto-cancellation-running-action 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: fauguste/auto-cancellation-running-action@0.1.4 10 | with: 11 | githubToken: ${{ secrets.GITHUB_TOKEN }} 12 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = py3{8} 3 | skip_missing_interpreters = true 4 | 5 | [testenv] 6 | passenv = 7 | HOME 8 | UPDATE_EXPECTED 9 | KEEP_GENERATED 10 | SHOW_ERRORS 11 | deps = 12 | git+https://github.com/zuo/unittest_expander 13 | black 14 | pytest 15 | commands = 16 | pytest --ignore=tests/expected --ignore=tests/ext_expected -rs -v {posargs} 17 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | indent_style = space 7 | indent_size = 4 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | charset = utf-8 11 | end_of_line = lf 12 | 13 | [*.bat] 14 | indent_style = tab 15 | end_of_line = crlf 16 | 17 | [LICENSE] 18 | insert_final_newline = false 19 | 20 | [Makefile] 21 | indent_style = tab 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | * decaf2many version: 2 | * Python version: 3 | * Operating System: 4 | 5 | ### Description 6 | 7 | Describe what you were trying to get done. 8 | Tell us what happened, what went wrong, and what you expected to happen. 9 | 10 | ### What I Did 11 | 12 | ``` 13 | Paste the command(s) you ran and the output. 14 | If there was a crash, please include the traceback here. 15 | ``` 16 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [bumpversion] 2 | current_version = 0.1.0 3 | commit = True 4 | tag = True 5 | 6 | [bumpversion:file:setup.py] 7 | search = version='{current_version}' 8 | replace = version='{new_version}' 9 | 10 | [bumpversion:file:decaf2many/__init__.py] 11 | search = __version__ = '{current_version}' 12 | replace = __version__ = '{new_version}' 13 | 14 | [bdist_wheel] 15 | universal = 1 16 | 17 | [flake8] 18 | exclude = build, docs, decaf2many/lang 19 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # Config file for automatic testing at travis-ci.com 2 | 3 | language: python 4 | python: 5 | - 3.8 6 | - 3.7 7 | - 3.6 8 | 9 | # Command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors 10 | install: pip install -U tox-travis 11 | 12 | # Command to run tests, e.g. python setup.py test 13 | script: tox 14 | 15 | # Assuming you have installed the travis-ci CLI tool, after you 16 | # create the Github repo and add it to Travis, run the 17 | # following command to finish PyPI deployment setup: 18 | # $ travis encrypt --add deploy.password 19 | deploy: 20 | provider: pypi 21 | distributions: sdist bdist_wheel 22 | user: adsharma 23 | password: 24 | secure: PLEASE_REPLACE_ME 25 | on: 26 | tags: true 27 | repo: adsharma/decaf2many 28 | python: 3.8 29 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | # Controls when the action will run. 4 | on: [push, pull_request, workflow_dispatch] 5 | 6 | jobs: 7 | build: 8 | 9 | strategy: 10 | matrix: 11 | os: 12 | - ubuntu-18.04 13 | runs-on: ${{ matrix.os }} 14 | 15 | steps: 16 | - uses: actions/checkout@v2 17 | - uses: actions/setup-python@v2 18 | with: 19 | python-version: '3.8' 20 | 21 | - name: Install tox 22 | run: | 23 | pip3 --version 24 | pip3 install setuptools tox 25 | 26 | - name: Run tox 27 | shell: bash 28 | run: | 29 | tox 30 | 31 | lint: 32 | runs-on: ubuntu-latest 33 | 34 | steps: 35 | - uses: actions/checkout@v2 36 | 37 | - name: Install linters 38 | run: pip install black pyflakes 39 | 40 | - name: tests/expected/*.py 41 | run: rm tests/expected/*.py 42 | 43 | - name: Run black 44 | run: black --exclude decaf2many/lang --check */ *.py 45 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021, Arun Sharma 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """The setup script.""" 4 | 5 | from setuptools import find_packages, setup 6 | 7 | with open("README.md") as readme_file: 8 | readme = readme_file.read() 9 | 10 | with open("HISTORY.md") as history_file: 11 | history = history_file.read() 12 | 13 | requirements = ["antlr4-python3-runtime"] 14 | 15 | test_requirements = [] 16 | 17 | setup( 18 | author="Arun Sharma", 19 | author_email="arun@sharma-home.net", 20 | python_requires=">=3.6", 21 | classifiers=[ 22 | "Development Status :: 2 - Pre-Alpha", 23 | "Intended Audience :: Developers", 24 | "License :: OSI Approved :: MIT License", 25 | "Natural Language :: English", 26 | "Programming Language :: Python :: 3", 27 | "Programming Language :: Python :: 3.6", 28 | "Programming Language :: Python :: 3.7", 29 | "Programming Language :: Python :: 3.8", 30 | ], 31 | description="Java to Python Transpiler", 32 | entry_points={"console_scripts": ["decaf2many=decaf2many.cli:main"]}, 33 | install_requires=requirements, 34 | license="MIT license", 35 | long_description=readme + "\n\n" + history, 36 | long_description_content_type="text/markdown", 37 | include_package_data=True, 38 | keywords="decaf2many", 39 | name="decaf2many", 40 | packages=find_packages(include=["decaf2many", "decaf2many.*"]), 41 | test_suite="tests", 42 | tests_require=test_requirements, 43 | url="https://github.com/adsharma/decaf2many", 44 | version="0.1.0", 45 | zip_safe=False, 46 | ) 47 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | 58 | # Flask stuff: 59 | instance/ 60 | .webassets-cache 61 | 62 | # Scrapy stuff: 63 | .scrapy 64 | 65 | # Sphinx documentation 66 | docs/_build/ 67 | 68 | # PyBuilder 69 | target/ 70 | 71 | # Jupyter Notebook 72 | .ipynb_checkpoints 73 | 74 | # pyenv 75 | .python-version 76 | 77 | # celery beat schedule file 78 | celerybeat-schedule 79 | 80 | # SageMath parsed files 81 | *.sage.py 82 | 83 | # dotenv 84 | .env 85 | 86 | # virtualenv 87 | .venv 88 | venv/ 89 | ENV/ 90 | 91 | # Spyder project settings 92 | .spyderproject 93 | .spyproject 94 | 95 | # Rope project settings 96 | .ropeproject 97 | 98 | # mkdocs documentation 99 | /site 100 | 101 | # mypy 102 | .mypy_cache/ 103 | 104 | # IDE settings 105 | .vscode/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # decaf2many: Java to Python Transpiler 2 | 3 | [![image](https://img.shields.io/pypi/v/decaf2many.svg)](https://pypi.python.org/pypi/decaf2many) 4 | [![image](https://img.shields.io/travis/adsharma/decaf2many.svg)](https://travis-ci.com/adsharma/decaf2many) 5 | 6 | ## Overview 7 | 8 | Transpiles Java8 to the [py2many](http://github.com/adsharma/py2many) dialect of python. Doing so preserves 9 | some information about types (char, int, long map to u16, i32, i64 respectively) and can be further transpiled 10 | to downstream languages supported by py2many, which include Kotlin and Rust among others. 11 | 12 | This dialect can be thought of as a statically typed subset of python that's suitable as a universal 13 | intermediate language. It can also benefit from the rich set of tools and libraries that make up the python ecosystem. 14 | 15 | If you're looking to use dynamic typing, this is probably not a good path for you. 16 | 17 | ## Details 18 | 19 | The tool is based on [antlr4](https://github.com/antlr/antlr4) and the "optimized" 20 | [Java grammar](https://github.com/antlr/grammars-v4/tree/master/java/java) 21 | 22 | ## Usage 23 | 24 | ``` 25 | cat HelloWorld.java | decaf2many # writes to stdout 26 | decaf2many HelloWorld.java # writes to HelloWorld.py 27 | decaf2many --outdir /tmp HelloWorld.java # writes /tmp/HelloWorld.py 28 | ``` 29 | 30 | To transpile to other languages 31 | 32 | ``` 33 | py2many --rust=1 HelloWorld.py 34 | py2many --kotlin=1 HelloWorld.py 35 | ``` 36 | 37 | ## Sample programs 38 | 39 | * HelloWorld: [input](https://github.com/adsharma/decaf2many/blob/main/tests/cases/HelloWorld.java) [output](https://github.com/adsharma/decaf2many/blob/main/tests/expected/HelloWorld.py) 40 | * Expression: [input](https://github.com/adsharma/decaf2many/blob/main/tests/cases/Expression.java) [output](https://github.com/adsharma/decaf2many/blob/main/tests/expected/Expression.py) 41 | -------------------------------------------------------------------------------- /decaf2many/lang/JavadocLexer.g4: -------------------------------------------------------------------------------- 1 | /* 2 | [The "BSD licence"] 3 | Copyright (c) 2016 Pascal Gruen 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 1. Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 3. The name of the author may not be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | lexer grammar JavadocLexer; 30 | 31 | NAME 32 | : [a-zA-Z]+ 33 | ; 34 | 35 | NEWLINE 36 | : '\n' (SPACE? (STAR {_input.LA(1) != '/'}?)+)? 37 | | '\r\n' (SPACE? (STAR {_input.LA(1) != '/'}?)+)? 38 | | '\r' (SPACE? (STAR {_input.LA(1) != '/'}?)+)? 39 | ; 40 | 41 | SPACE 42 | : (' '|'\t')+ 43 | ; 44 | 45 | TEXT_CONTENT 46 | : ~[\n\r\t @*{}/a-zA-Z]+ 47 | ; 48 | 49 | AT 50 | : '@' 51 | ; 52 | 53 | STAR 54 | : '*' 55 | ; 56 | 57 | SLASH 58 | : '/' 59 | ; 60 | 61 | JAVADOC_START 62 | : '/**' STAR* 63 | ; 64 | 65 | JAVADOC_END 66 | : SPACE? STAR* '*/' 67 | ; 68 | 69 | INLINE_TAG_START 70 | : '{@' 71 | ; 72 | 73 | BRACE_OPEN 74 | : '{' 75 | ; 76 | 77 | BRACE_CLOSE 78 | : '}' 79 | ; 80 | -------------------------------------------------------------------------------- /decaf2many/cli.py: -------------------------------------------------------------------------------- 1 | """Console script for decaf2many.""" 2 | import argparse 3 | import logging 4 | import sys 5 | 6 | from antlr4 import CommonTokenStream, FileStream, StdinStream 7 | from antlr4.tree.Trees import Trees 8 | from pathlib import Path 9 | 10 | from .decaf2many import Transpiler 11 | from .lang.JavaLexer import JavaLexer 12 | from .lang.JavaParser import JavaParser 13 | 14 | logger = logging.getLogger("decaf2many") 15 | 16 | 17 | def run_one(args, file_name) -> int: 18 | file_stream = StdinStream() if file_name == "-" else FileStream(file_name) 19 | lexer = JavaLexer(file_stream) 20 | stream = CommonTokenStream(lexer) 21 | parser = JavaParser(stream) 22 | tree = parser.compilationUnit() 23 | if args.dump: 24 | print(Trees.toStringTree(tree, None, parser)) 25 | return 0 26 | tx = Transpiler() 27 | out = tx.visit(tree) 28 | if file_name != "-": 29 | file_path = Path(file_name) 30 | if args.outdir: 31 | out_dir = Path(args.outdir) 32 | out_dir.mkdir(parents=True, exist_ok=True) 33 | else: 34 | out_dir = Path(".") 35 | out_path = out_dir / Path(file_path.stem + ".py") 36 | with open(out_path, "w") as f: 37 | f.write(out) 38 | logger.info(f"wrote output to: {out_path}") 39 | else: 40 | sys.stdout.write(out) 41 | return 0 42 | 43 | 44 | def main(args=None): 45 | """Console script for decaf2many.""" 46 | parser = argparse.ArgumentParser() 47 | parser.add_argument( 48 | "--dump", 49 | default=False, 50 | action="store_true", 51 | help="dump ast instead of transpiling", 52 | ) 53 | parser.add_argument("--outdir", default=None, help="Output directory") 54 | parser.add_argument("-l", "--log-level", default="INFO", help="set log level") 55 | 56 | args, rest = parser.parse_known_args(args=args) 57 | 58 | try: 59 | logging.basicConfig(level=args.log_level) 60 | console = logging.StreamHandler() 61 | console.setLevel(logging.root.level) 62 | formatter = logging.Formatter("%(name)-12s: %(levelname)-8s %(message)s") 63 | console.setFormatter(formatter) 64 | logger.addHandler(console) 65 | except ValueError: 66 | logging.error(f"Invalid log level: {args.log_level}") 67 | sys.exit(1) 68 | 69 | rv = 0 70 | if len(rest) == 0: 71 | rest = ["-"] 72 | for infile in rest: 73 | rv |= run_one(args, infile) 74 | return rv 75 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: clean clean-test clean-pyc clean-build docs help 2 | .DEFAULT_GOAL := help 3 | 4 | define BROWSER_PYSCRIPT 5 | import os, webbrowser, sys 6 | 7 | from urllib.request import pathname2url 8 | 9 | webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1]))) 10 | endef 11 | export BROWSER_PYSCRIPT 12 | 13 | define PRINT_HELP_PYSCRIPT 14 | import re, sys 15 | 16 | for line in sys.stdin: 17 | match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line) 18 | if match: 19 | target, help = match.groups() 20 | print("%-20s %s" % (target, help)) 21 | endef 22 | export PRINT_HELP_PYSCRIPT 23 | 24 | BROWSER := python -c "$$BROWSER_PYSCRIPT" 25 | 26 | help: 27 | @python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST) 28 | 29 | clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts 30 | 31 | clean-build: ## remove build artifacts 32 | rm -fr build/ 33 | rm -fr dist/ 34 | rm -fr .eggs/ 35 | find . -name '*.egg-info' -exec rm -fr {} + 36 | find . -name '*.egg' -exec rm -f {} + 37 | 38 | clean-pyc: ## remove Python file artifacts 39 | find . -name '*.pyc' -exec rm -f {} + 40 | find . -name '*.pyo' -exec rm -f {} + 41 | find . -name '*~' -exec rm -f {} + 42 | find . -name '__pycache__' -exec rm -fr {} + 43 | 44 | clean-test: ## remove test and coverage artifacts 45 | rm -fr .tox/ 46 | rm -f .coverage 47 | rm -fr htmlcov/ 48 | rm -fr .pytest_cache 49 | 50 | lint: ## check style with flake8 51 | flake8 decaf2many tests 52 | 53 | test: ## run tests quickly with the default Python 54 | python setup.py test 55 | 56 | test-all: ## run tests on every Python version with tox 57 | tox 58 | 59 | coverage: ## check code coverage quickly with the default Python 60 | coverage run --source decaf2many setup.py test 61 | coverage report -m 62 | coverage html 63 | $(BROWSER) htmlcov/index.html 64 | 65 | docs: ## generate Sphinx HTML documentation, including API docs 66 | rm -f docs/decaf2many.md 67 | rm -f docs/modules.md 68 | sphinx-apidoc -o docs/ decaf2many 69 | $(MAKE) -C docs clean 70 | $(MAKE) -C docs html 71 | $(BROWSER) docs/_build/html/index.html 72 | 73 | servedocs: docs ## compile the docs watching for changes 74 | watchmedo shell-command -p '*.md' -c '$(MAKE) -C docs html' -R -D . 75 | 76 | release: dist ## package and upload a release 77 | twine upload dist/* 78 | 79 | dist: clean ## builds source and wheel package 80 | python setup.py sdist 81 | python setup.py bdist_wheel 82 | ls -l dist 83 | 84 | install: clean ## install the package to the active Python's site-packages 85 | python setup.py install 86 | -------------------------------------------------------------------------------- /decaf2many/lang/JavaLexer.tokens: -------------------------------------------------------------------------------- 1 | ABSTRACT=1 2 | ASSERT=2 3 | BOOLEAN=3 4 | BREAK=4 5 | BYTE=5 6 | CASE=6 7 | CATCH=7 8 | CHAR=8 9 | CLASS=9 10 | CONST=10 11 | CONTINUE=11 12 | DEFAULT=12 13 | DO=13 14 | DOUBLE=14 15 | ELSE=15 16 | ENUM=16 17 | EXTENDS=17 18 | FINAL=18 19 | FINALLY=19 20 | FLOAT=20 21 | FOR=21 22 | IF=22 23 | GOTO=23 24 | IMPLEMENTS=24 25 | IMPORT=25 26 | INSTANCEOF=26 27 | INT=27 28 | INTERFACE=28 29 | LONG=29 30 | NATIVE=30 31 | NEW=31 32 | PACKAGE=32 33 | PRIVATE=33 34 | PROTECTED=34 35 | PUBLIC=35 36 | RETURN=36 37 | SHORT=37 38 | STATIC=38 39 | STRICTFP=39 40 | SUPER=40 41 | SWITCH=41 42 | SYNCHRONIZED=42 43 | THIS=43 44 | THROW=44 45 | THROWS=45 46 | TRANSIENT=46 47 | TRY=47 48 | VOID=48 49 | VOLATILE=49 50 | WHILE=50 51 | DECIMAL_LITERAL=51 52 | HEX_LITERAL=52 53 | OCT_LITERAL=53 54 | BINARY_LITERAL=54 55 | FLOAT_LITERAL=55 56 | HEX_FLOAT_LITERAL=56 57 | BOOL_LITERAL=57 58 | CHAR_LITERAL=58 59 | STRING_LITERAL=59 60 | NULL_LITERAL=60 61 | LPAREN=61 62 | RPAREN=62 63 | LBRACE=63 64 | RBRACE=64 65 | LBRACK=65 66 | RBRACK=66 67 | SEMI=67 68 | COMMA=68 69 | DOT=69 70 | ASSIGN=70 71 | GT=71 72 | LT=72 73 | BANG=73 74 | TILDE=74 75 | QUESTION=75 76 | COLON=76 77 | EQUAL=77 78 | LE=78 79 | GE=79 80 | NOTEQUAL=80 81 | AND=81 82 | OR=82 83 | INC=83 84 | DEC=84 85 | ADD=85 86 | SUB=86 87 | MUL=87 88 | DIV=88 89 | BITAND=89 90 | BITOR=90 91 | CARET=91 92 | MOD=92 93 | ADD_ASSIGN=93 94 | SUB_ASSIGN=94 95 | MUL_ASSIGN=95 96 | DIV_ASSIGN=96 97 | AND_ASSIGN=97 98 | OR_ASSIGN=98 99 | XOR_ASSIGN=99 100 | MOD_ASSIGN=100 101 | LSHIFT_ASSIGN=101 102 | RSHIFT_ASSIGN=102 103 | URSHIFT_ASSIGN=103 104 | ARROW=104 105 | COLONCOLON=105 106 | AT=106 107 | ELLIPSIS=107 108 | WS=108 109 | COMMENT=109 110 | LINE_COMMENT=110 111 | JAVADOC_COMMENT=111 112 | IDENTIFIER=112 113 | 'abstract'=1 114 | 'assert'=2 115 | 'boolean'=3 116 | 'break'=4 117 | 'byte'=5 118 | 'case'=6 119 | 'catch'=7 120 | 'char'=8 121 | 'class'=9 122 | 'const'=10 123 | 'continue'=11 124 | 'default'=12 125 | 'do'=13 126 | 'double'=14 127 | 'else'=15 128 | 'enum'=16 129 | 'extends'=17 130 | 'final'=18 131 | 'finally'=19 132 | 'float'=20 133 | 'for'=21 134 | 'if'=22 135 | 'goto'=23 136 | 'implements'=24 137 | 'import'=25 138 | 'instanceof'=26 139 | 'int'=27 140 | 'interface'=28 141 | 'long'=29 142 | 'native'=30 143 | 'new'=31 144 | 'package'=32 145 | 'private'=33 146 | 'protected'=34 147 | 'public'=35 148 | 'return'=36 149 | 'short'=37 150 | 'static'=38 151 | 'strictfp'=39 152 | 'super'=40 153 | 'switch'=41 154 | 'synchronized'=42 155 | 'this'=43 156 | 'throw'=44 157 | 'throws'=45 158 | 'transient'=46 159 | 'try'=47 160 | 'void'=48 161 | 'volatile'=49 162 | 'while'=50 163 | 'null'=60 164 | '('=61 165 | ')'=62 166 | '{'=63 167 | '}'=64 168 | '['=65 169 | ']'=66 170 | ';'=67 171 | ','=68 172 | '.'=69 173 | '='=70 174 | '>'=71 175 | '<'=72 176 | '!'=73 177 | '~'=74 178 | '?'=75 179 | ':'=76 180 | '=='=77 181 | '<='=78 182 | '>='=79 183 | '!='=80 184 | '&&'=81 185 | '||'=82 186 | '++'=83 187 | '--'=84 188 | '+'=85 189 | '-'=86 190 | '*'=87 191 | '/'=88 192 | '&'=89 193 | '|'=90 194 | '^'=91 195 | '%'=92 196 | '+='=93 197 | '-='=94 198 | '*='=95 199 | '/='=96 200 | '&='=97 201 | '|='=98 202 | '^='=99 203 | '%='=100 204 | '<<='=101 205 | '>>='=102 206 | '>>>='=103 207 | '->'=104 208 | '::'=105 209 | '@'=106 210 | '...'=107 211 | -------------------------------------------------------------------------------- /decaf2many/lang/JavaParser.tokens: -------------------------------------------------------------------------------- 1 | ABSTRACT=1 2 | ASSERT=2 3 | BOOLEAN=3 4 | BREAK=4 5 | BYTE=5 6 | CASE=6 7 | CATCH=7 8 | CHAR=8 9 | CLASS=9 10 | CONST=10 11 | CONTINUE=11 12 | DEFAULT=12 13 | DO=13 14 | DOUBLE=14 15 | ELSE=15 16 | ENUM=16 17 | EXTENDS=17 18 | FINAL=18 19 | FINALLY=19 20 | FLOAT=20 21 | FOR=21 22 | IF=22 23 | GOTO=23 24 | IMPLEMENTS=24 25 | IMPORT=25 26 | INSTANCEOF=26 27 | INT=27 28 | INTERFACE=28 29 | LONG=29 30 | NATIVE=30 31 | NEW=31 32 | PACKAGE=32 33 | PRIVATE=33 34 | PROTECTED=34 35 | PUBLIC=35 36 | RETURN=36 37 | SHORT=37 38 | STATIC=38 39 | STRICTFP=39 40 | SUPER=40 41 | SWITCH=41 42 | SYNCHRONIZED=42 43 | THIS=43 44 | THROW=44 45 | THROWS=45 46 | TRANSIENT=46 47 | TRY=47 48 | VOID=48 49 | VOLATILE=49 50 | WHILE=50 51 | DECIMAL_LITERAL=51 52 | HEX_LITERAL=52 53 | OCT_LITERAL=53 54 | BINARY_LITERAL=54 55 | FLOAT_LITERAL=55 56 | HEX_FLOAT_LITERAL=56 57 | BOOL_LITERAL=57 58 | CHAR_LITERAL=58 59 | STRING_LITERAL=59 60 | NULL_LITERAL=60 61 | LPAREN=61 62 | RPAREN=62 63 | LBRACE=63 64 | RBRACE=64 65 | LBRACK=65 66 | RBRACK=66 67 | SEMI=67 68 | COMMA=68 69 | DOT=69 70 | ASSIGN=70 71 | GT=71 72 | LT=72 73 | BANG=73 74 | TILDE=74 75 | QUESTION=75 76 | COLON=76 77 | EQUAL=77 78 | LE=78 79 | GE=79 80 | NOTEQUAL=80 81 | AND=81 82 | OR=82 83 | INC=83 84 | DEC=84 85 | ADD=85 86 | SUB=86 87 | MUL=87 88 | DIV=88 89 | BITAND=89 90 | BITOR=90 91 | CARET=91 92 | MOD=92 93 | ADD_ASSIGN=93 94 | SUB_ASSIGN=94 95 | MUL_ASSIGN=95 96 | DIV_ASSIGN=96 97 | AND_ASSIGN=97 98 | OR_ASSIGN=98 99 | XOR_ASSIGN=99 100 | MOD_ASSIGN=100 101 | LSHIFT_ASSIGN=101 102 | RSHIFT_ASSIGN=102 103 | URSHIFT_ASSIGN=103 104 | ARROW=104 105 | COLONCOLON=105 106 | AT=106 107 | ELLIPSIS=107 108 | WS=108 109 | COMMENT=109 110 | LINE_COMMENT=110 111 | JAVADOC_COMMENT=111 112 | IDENTIFIER=112 113 | 'abstract'=1 114 | 'assert'=2 115 | 'boolean'=3 116 | 'break'=4 117 | 'byte'=5 118 | 'case'=6 119 | 'catch'=7 120 | 'char'=8 121 | 'class'=9 122 | 'const'=10 123 | 'continue'=11 124 | 'default'=12 125 | 'do'=13 126 | 'double'=14 127 | 'else'=15 128 | 'enum'=16 129 | 'extends'=17 130 | 'final'=18 131 | 'finally'=19 132 | 'float'=20 133 | 'for'=21 134 | 'if'=22 135 | 'goto'=23 136 | 'implements'=24 137 | 'import'=25 138 | 'instanceof'=26 139 | 'int'=27 140 | 'interface'=28 141 | 'long'=29 142 | 'native'=30 143 | 'new'=31 144 | 'package'=32 145 | 'private'=33 146 | 'protected'=34 147 | 'public'=35 148 | 'return'=36 149 | 'short'=37 150 | 'static'=38 151 | 'strictfp'=39 152 | 'super'=40 153 | 'switch'=41 154 | 'synchronized'=42 155 | 'this'=43 156 | 'throw'=44 157 | 'throws'=45 158 | 'transient'=46 159 | 'try'=47 160 | 'void'=48 161 | 'volatile'=49 162 | 'while'=50 163 | 'null'=60 164 | '('=61 165 | ')'=62 166 | '{'=63 167 | '}'=64 168 | '['=65 169 | ']'=66 170 | ';'=67 171 | ','=68 172 | '.'=69 173 | '='=70 174 | '>'=71 175 | '<'=72 176 | '!'=73 177 | '~'=74 178 | '?'=75 179 | ':'=76 180 | '=='=77 181 | '<='=78 182 | '>='=79 183 | '!='=80 184 | '&&'=81 185 | '||'=82 186 | '++'=83 187 | '--'=84 188 | '+'=85 189 | '-'=86 190 | '*'=87 191 | '/'=88 192 | '&'=89 193 | '|'=90 194 | '^'=91 195 | '%'=92 196 | '+='=93 197 | '-='=94 198 | '*='=95 199 | '/='=96 200 | '&='=97 201 | '|='=98 202 | '^='=99 203 | '%='=100 204 | '<<='=101 205 | '>>='=102 206 | '>>>='=103 207 | '->'=104 208 | '::'=105 209 | '@'=106 210 | '...'=107 211 | -------------------------------------------------------------------------------- /tests/test_cli.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import filecmp 3 | import logging 4 | import os.path 5 | import unittest 6 | import subprocess 7 | import sys 8 | 9 | from distutils import spawn 10 | from functools import lru_cache 11 | from pathlib import Path 12 | from subprocess import run 13 | from unittest_expander import foreach, expand 14 | 15 | from decaf2many.cli import main 16 | 17 | TESTS_DIR = Path(__file__).parent.absolute() 18 | ROOT_DIR = TESTS_DIR.parent 19 | BUILD_DIR = TESTS_DIR / "build" 20 | GENERATED_DIR = BUILD_DIR 21 | FORMATTER = "black" 22 | 23 | KEEP_GENERATED = os.environ.get("KEEP_GENERATED", False) 24 | SHOW_ERRORS = os.environ.get("SHOW_ERRORS", False) 25 | UPDATE_EXPECTED = os.environ.get("UPDATE_EXPECTED", False) 26 | 27 | 28 | TEST_CASES = [item.name for item in (TESTS_DIR / "cases").glob("*.java")] 29 | 30 | logger = logging.Logger("test_cli") 31 | 32 | 33 | @expand 34 | class CodeGeneratorTests(unittest.TestCase): 35 | maxDiff = None 36 | 37 | SHOW_ERRORS = SHOW_ERRORS 38 | KEEP_GENERATED = KEEP_GENERATED 39 | UPDATE_EXPECTED = UPDATE_EXPECTED 40 | 41 | def setUp(self): 42 | os.makedirs(BUILD_DIR, exist_ok=True) 43 | os.chdir(BUILD_DIR) 44 | 45 | @staticmethod 46 | def format_code(filename): 47 | return subprocess.run([FORMATTER, filename]).returncode 48 | 49 | @foreach(sorted(TEST_CASES)) 50 | def test_generated(self, case): 51 | out_file = Path(case).stem + ".py" 52 | expected_filename = TESTS_DIR / "expected" / f"{out_file}" 53 | 54 | if ( 55 | not self.UPDATE_EXPECTED 56 | and not self.KEEP_GENERATED 57 | and not os.path.exists(expected_filename) 58 | ): 59 | raise unittest.SkipTest(f"{expected_filename} not found") 60 | 61 | case_filename = TESTS_DIR / "cases" / f"{case}" 62 | case_output = GENERATED_DIR / f"{out_file}" 63 | 64 | args = ["--outdir", str(GENERATED_DIR), str(case_filename)] 65 | 66 | try: 67 | rv = main(args) 68 | format_rv = self.format_code(case_output) 69 | if format_rv != 0: 70 | raise unittest.SkipTest(f"{FORMATTER} not available") 71 | with open(case_output) as actual: 72 | generated = actual.read() 73 | if os.path.exists(expected_filename) and not self.UPDATE_EXPECTED: 74 | with open(expected_filename) as f2: 75 | expected_case_contents = f2.read() 76 | self.assertEqual(expected_case_contents, generated) 77 | 78 | if self.UPDATE_EXPECTED or not os.path.exists(expected_filename): 79 | with open(expected_filename, "w") as f: 80 | f.write(generated) 81 | 82 | finally: 83 | if not self.KEEP_GENERATED: 84 | case_output.unlink(missing_ok=True) 85 | 86 | 87 | if __name__ == "__main__": 88 | parser = argparse.ArgumentParser() 89 | parser.add_argument( 90 | "--keep-generated", 91 | type=bool, 92 | default=False, 93 | help="Keep generated code for debug", 94 | ) 95 | parser.add_argument( 96 | "--update-expected", type=bool, default=False, help="Update tests/expected" 97 | ) 98 | args, rest = parser.parse_known_args() 99 | 100 | CodeGeneratorTests.KEEP_GENERATED |= args.keep_generated 101 | CodeGeneratorTests.UPDATE_EXPECTED |= args.update_expected 102 | 103 | rest = [sys.argv[0]] + rest 104 | unittest.main(argv=rest) 105 | -------------------------------------------------------------------------------- /decaf2many/lang/JavadocParser.g4: -------------------------------------------------------------------------------- 1 | /* 2 | [The "BSD licence"] 3 | Copyright (c) 2016 Pascal Gruen 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 1. Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 3. The name of the author may not be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | parser grammar JavadocParser; 30 | 31 | options { tokenVocab=JavadocLexer; } 32 | 33 | 34 | documentation 35 | : EOF 36 | | JAVADOC_START skipWhitespace* documentationContent JAVADOC_END EOF 37 | | skipWhitespace* documentationContent EOF 38 | ; 39 | 40 | documentationContent 41 | : description skipWhitespace* 42 | | skipWhitespace* tagSection 43 | | description NEWLINE+ skipWhitespace* tagSection 44 | ; 45 | 46 | skipWhitespace 47 | : SPACE 48 | | NEWLINE 49 | ; 50 | 51 | 52 | description 53 | : descriptionLine (descriptionNewline+ descriptionLine)* 54 | ; 55 | 56 | descriptionLine 57 | : descriptionLineStart descriptionLineElement* 58 | | inlineTag descriptionLineElement* 59 | ; 60 | 61 | descriptionLineStart 62 | : SPACE? descriptionLineNoSpaceNoAt+ (descriptionLineNoSpaceNoAt | SPACE | AT)* 63 | ; 64 | 65 | descriptionLineNoSpaceNoAt 66 | : TEXT_CONTENT 67 | | NAME 68 | | STAR 69 | | SLASH 70 | | BRACE_OPEN 71 | | BRACE_CLOSE 72 | ; 73 | 74 | descriptionLineElement 75 | : inlineTag 76 | | descriptionLineText 77 | ; 78 | 79 | descriptionLineText 80 | : (descriptionLineNoSpaceNoAt | SPACE | AT)+ 81 | ; 82 | 83 | descriptionNewline 84 | : NEWLINE 85 | ; 86 | 87 | 88 | tagSection 89 | : blockTag+ 90 | ; 91 | 92 | blockTag 93 | : SPACE? AT blockTagName SPACE? blockTagContent* 94 | ; 95 | 96 | blockTagName 97 | : NAME 98 | ; 99 | 100 | blockTagContent 101 | : blockTagText 102 | | inlineTag 103 | | NEWLINE 104 | ; 105 | 106 | blockTagText 107 | : blockTagTextElement+ 108 | ; 109 | 110 | blockTagTextElement 111 | : TEXT_CONTENT 112 | | NAME 113 | | SPACE 114 | | STAR 115 | | SLASH 116 | | BRACE_OPEN 117 | | BRACE_CLOSE 118 | ; 119 | 120 | 121 | inlineTag 122 | : INLINE_TAG_START inlineTagName SPACE* inlineTagContent? BRACE_CLOSE 123 | ; 124 | 125 | inlineTagName 126 | : NAME 127 | ; 128 | 129 | inlineTagContent 130 | : braceContent+ 131 | ; 132 | 133 | braceExpression 134 | : BRACE_OPEN braceContent* BRACE_CLOSE 135 | ; 136 | 137 | braceContent 138 | : braceExpression 139 | | braceText (NEWLINE* braceText)* 140 | ; 141 | 142 | braceText 143 | : TEXT_CONTENT 144 | | NAME 145 | | SPACE 146 | | STAR 147 | | SLASH 148 | | NEWLINE 149 | ; 150 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | .. highlight:: shell 2 | 3 | ============ 4 | Contributing 5 | ============ 6 | 7 | Contributions are welcome, and they are greatly appreciated! Every little bit 8 | helps, and credit will always be given. 9 | 10 | You can contribute in many ways: 11 | 12 | Types of Contributions 13 | ---------------------- 14 | 15 | Report Bugs 16 | ~~~~~~~~~~~ 17 | 18 | Report bugs at https://github.com/adsharma/decaf2many/issues. 19 | 20 | If you are reporting a bug, please include: 21 | 22 | * Your operating system name and version. 23 | * Any details about your local setup that might be helpful in troubleshooting. 24 | * Detailed steps to reproduce the bug. 25 | 26 | Fix Bugs 27 | ~~~~~~~~ 28 | 29 | Look through the GitHub issues for bugs. Anything tagged with "bug" and "help 30 | wanted" is open to whoever wants to implement it. 31 | 32 | Implement Features 33 | ~~~~~~~~~~~~~~~~~~ 34 | 35 | Look through the GitHub issues for features. Anything tagged with "enhancement" 36 | and "help wanted" is open to whoever wants to implement it. 37 | 38 | Write Documentation 39 | ~~~~~~~~~~~~~~~~~~~ 40 | 41 | decaf2many could always use more documentation, whether as part of the 42 | official decaf2many docs, in docstrings, or even on the web in blog posts, 43 | articles, and such. 44 | 45 | Submit Feedback 46 | ~~~~~~~~~~~~~~~ 47 | 48 | The best way to send feedback is to file an issue at https://github.com/adsharma/decaf2many/issues. 49 | 50 | If you are proposing a feature: 51 | 52 | * Explain in detail how it would work. 53 | * Keep the scope as narrow as possible, to make it easier to implement. 54 | * Remember that this is a volunteer-driven project, and that contributions 55 | are welcome :) 56 | 57 | Get Started! 58 | ------------ 59 | 60 | Ready to contribute? Here's how to set up `decaf2many` for local development. 61 | 62 | 1. Fork the `decaf2many` repo on GitHub. 63 | 2. Clone your fork locally:: 64 | 65 | $ git clone git@github.com:your_name_here/decaf2many.git 66 | 67 | 3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:: 68 | 69 | $ mkvirtualenv decaf2many 70 | $ cd decaf2many/ 71 | $ python setup.py develop 72 | 73 | 4. Create a branch for local development:: 74 | 75 | $ git checkout -b name-of-your-bugfix-or-feature 76 | 77 | Now you can make your changes locally. 78 | 79 | 5. When you're done making changes, check that your changes pass flake8 and the 80 | tests, including testing other Python versions with tox:: 81 | 82 | $ flake8 decaf2many tests 83 | $ python setup.py test or pytest 84 | $ tox 85 | 86 | To get flake8 and tox, just pip install them into your virtualenv. 87 | 88 | 6. Commit your changes and push your branch to GitHub:: 89 | 90 | $ git add . 91 | $ git commit -m "Your detailed description of your changes." 92 | $ git push origin name-of-your-bugfix-or-feature 93 | 94 | 7. Submit a pull request through the GitHub website. 95 | 96 | Pull Request Guidelines 97 | ----------------------- 98 | 99 | Before you submit a pull request, check that it meets these guidelines: 100 | 101 | 1. The pull request should include tests. 102 | 2. If the pull request adds functionality, the docs should be updated. Put 103 | your new functionality into a function with a docstring, and add the 104 | feature to the list in README.md. 105 | 3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check 106 | https://travis-ci.com/adsharma/decaf2many/pull_requests 107 | and make sure that the tests pass for all supported Python versions. 108 | 109 | Tips 110 | ---- 111 | 112 | To run a subset of tests:: 113 | 114 | 115 | $ python -m unittest tests.test_decaf2many 116 | 117 | Deploying 118 | --------- 119 | 120 | A reminder for the maintainers on how to deploy. 121 | Make sure all your changes are committed (including an entry in HISTORY.md). 122 | Then run:: 123 | 124 | $ bump2version patch # possible: major / minor / patch 125 | $ git push 126 | $ git push --tags 127 | 128 | Travis will then deploy to PyPI if tests pass. 129 | -------------------------------------------------------------------------------- /decaf2many/lang/JavadocLexer.interp: -------------------------------------------------------------------------------- 1 | token literal names: 2 | null 3 | null 4 | null 5 | null 6 | null 7 | '@' 8 | '*' 9 | '/' 10 | null 11 | null 12 | '{@' 13 | '{' 14 | '}' 15 | 16 | token symbolic names: 17 | null 18 | NAME 19 | NEWLINE 20 | SPACE 21 | TEXT_CONTENT 22 | AT 23 | STAR 24 | SLASH 25 | JAVADOC_START 26 | JAVADOC_END 27 | INLINE_TAG_START 28 | BRACE_OPEN 29 | BRACE_CLOSE 30 | 31 | rule names: 32 | NAME 33 | NEWLINE 34 | SPACE 35 | TEXT_CONTENT 36 | AT 37 | STAR 38 | SLASH 39 | JAVADOC_START 40 | JAVADOC_END 41 | INLINE_TAG_START 42 | BRACE_OPEN 43 | BRACE_CLOSE 44 | 45 | channel names: 46 | DEFAULT_TOKEN_CHANNEL 47 | HIDDEN 48 | 49 | mode names: 50 | DEFAULT_MODE 51 | 52 | atn: 53 | [3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 14, 120, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 3, 2, 6, 2, 29, 10, 2, 13, 2, 14, 2, 30, 3, 3, 3, 3, 5, 3, 35, 10, 3, 3, 3, 3, 3, 3, 3, 6, 3, 40, 10, 3, 13, 3, 14, 3, 41, 5, 3, 44, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 50, 10, 3, 3, 3, 3, 3, 3, 3, 6, 3, 55, 10, 3, 13, 3, 14, 3, 56, 5, 3, 59, 10, 3, 3, 3, 3, 3, 5, 3, 63, 10, 3, 3, 3, 3, 3, 3, 3, 6, 3, 68, 10, 3, 13, 3, 14, 3, 69, 5, 3, 72, 10, 3, 5, 3, 74, 10, 3, 3, 4, 6, 4, 77, 10, 4, 13, 4, 14, 4, 78, 3, 5, 6, 5, 82, 10, 5, 13, 5, 14, 5, 83, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 7, 9, 97, 10, 9, 12, 9, 14, 9, 100, 11, 9, 3, 10, 5, 10, 103, 10, 10, 3, 10, 7, 10, 106, 10, 10, 12, 10, 14, 10, 109, 11, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 2, 2, 14, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 3, 2, 5, 4, 2, 67, 92, 99, 124, 4, 2, 11, 11, 34, 34, 10, 2, 11, 12, 15, 15, 34, 34, 44, 44, 49, 49, 66, 92, 99, 125, 127, 127, 2, 136, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 3, 28, 3, 2, 2, 2, 5, 73, 3, 2, 2, 2, 7, 76, 3, 2, 2, 2, 9, 81, 3, 2, 2, 2, 11, 85, 3, 2, 2, 2, 13, 87, 3, 2, 2, 2, 15, 89, 3, 2, 2, 2, 17, 91, 3, 2, 2, 2, 19, 102, 3, 2, 2, 2, 21, 113, 3, 2, 2, 2, 23, 116, 3, 2, 2, 2, 25, 118, 3, 2, 2, 2, 27, 29, 9, 2, 2, 2, 28, 27, 3, 2, 2, 2, 29, 30, 3, 2, 2, 2, 30, 28, 3, 2, 2, 2, 30, 31, 3, 2, 2, 2, 31, 4, 3, 2, 2, 2, 32, 43, 7, 12, 2, 2, 33, 35, 5, 7, 4, 2, 34, 33, 3, 2, 2, 2, 34, 35, 3, 2, 2, 2, 35, 39, 3, 2, 2, 2, 36, 37, 5, 13, 7, 2, 37, 38, 6, 3, 2, 2, 38, 40, 3, 2, 2, 2, 39, 36, 3, 2, 2, 2, 40, 41, 3, 2, 2, 2, 41, 39, 3, 2, 2, 2, 41, 42, 3, 2, 2, 2, 42, 44, 3, 2, 2, 2, 43, 34, 3, 2, 2, 2, 43, 44, 3, 2, 2, 2, 44, 74, 3, 2, 2, 2, 45, 46, 7, 15, 2, 2, 46, 47, 7, 12, 2, 2, 47, 58, 3, 2, 2, 2, 48, 50, 5, 7, 4, 2, 49, 48, 3, 2, 2, 2, 49, 50, 3, 2, 2, 2, 50, 54, 3, 2, 2, 2, 51, 52, 5, 13, 7, 2, 52, 53, 6, 3, 3, 2, 53, 55, 3, 2, 2, 2, 54, 51, 3, 2, 2, 2, 55, 56, 3, 2, 2, 2, 56, 54, 3, 2, 2, 2, 56, 57, 3, 2, 2, 2, 57, 59, 3, 2, 2, 2, 58, 49, 3, 2, 2, 2, 58, 59, 3, 2, 2, 2, 59, 74, 3, 2, 2, 2, 60, 71, 7, 15, 2, 2, 61, 63, 5, 7, 4, 2, 62, 61, 3, 2, 2, 2, 62, 63, 3, 2, 2, 2, 63, 67, 3, 2, 2, 2, 64, 65, 5, 13, 7, 2, 65, 66, 6, 3, 4, 2, 66, 68, 3, 2, 2, 2, 67, 64, 3, 2, 2, 2, 68, 69, 3, 2, 2, 2, 69, 67, 3, 2, 2, 2, 69, 70, 3, 2, 2, 2, 70, 72, 3, 2, 2, 2, 71, 62, 3, 2, 2, 2, 71, 72, 3, 2, 2, 2, 72, 74, 3, 2, 2, 2, 73, 32, 3, 2, 2, 2, 73, 45, 3, 2, 2, 2, 73, 60, 3, 2, 2, 2, 74, 6, 3, 2, 2, 2, 75, 77, 9, 3, 2, 2, 76, 75, 3, 2, 2, 2, 77, 78, 3, 2, 2, 2, 78, 76, 3, 2, 2, 2, 78, 79, 3, 2, 2, 2, 79, 8, 3, 2, 2, 2, 80, 82, 10, 4, 2, 2, 81, 80, 3, 2, 2, 2, 82, 83, 3, 2, 2, 2, 83, 81, 3, 2, 2, 2, 83, 84, 3, 2, 2, 2, 84, 10, 3, 2, 2, 2, 85, 86, 7, 66, 2, 2, 86, 12, 3, 2, 2, 2, 87, 88, 7, 44, 2, 2, 88, 14, 3, 2, 2, 2, 89, 90, 7, 49, 2, 2, 90, 16, 3, 2, 2, 2, 91, 92, 7, 49, 2, 2, 92, 93, 7, 44, 2, 2, 93, 94, 7, 44, 2, 2, 94, 98, 3, 2, 2, 2, 95, 97, 5, 13, 7, 2, 96, 95, 3, 2, 2, 2, 97, 100, 3, 2, 2, 2, 98, 96, 3, 2, 2, 2, 98, 99, 3, 2, 2, 2, 99, 18, 3, 2, 2, 2, 100, 98, 3, 2, 2, 2, 101, 103, 5, 7, 4, 2, 102, 101, 3, 2, 2, 2, 102, 103, 3, 2, 2, 2, 103, 107, 3, 2, 2, 2, 104, 106, 5, 13, 7, 2, 105, 104, 3, 2, 2, 2, 106, 109, 3, 2, 2, 2, 107, 105, 3, 2, 2, 2, 107, 108, 3, 2, 2, 2, 108, 110, 3, 2, 2, 2, 109, 107, 3, 2, 2, 2, 110, 111, 7, 44, 2, 2, 111, 112, 7, 49, 2, 2, 112, 20, 3, 2, 2, 2, 113, 114, 7, 125, 2, 2, 114, 115, 7, 66, 2, 2, 115, 22, 3, 2, 2, 2, 116, 117, 7, 125, 2, 2, 117, 24, 3, 2, 2, 2, 118, 119, 7, 127, 2, 2, 119, 26, 3, 2, 2, 2, 19, 2, 30, 34, 41, 43, 49, 56, 58, 62, 69, 71, 73, 78, 83, 98, 102, 107, 2] -------------------------------------------------------------------------------- /decaf2many/lang/JavadocParserVisitor.py: -------------------------------------------------------------------------------- 1 | # Generated from JavadocParser.g4 by ANTLR 4.7.2 2 | from antlr4 import * 3 | if __name__ is not None and "." in __name__: 4 | from .JavadocParser import JavadocParser 5 | else: 6 | from JavadocParser import JavadocParser 7 | 8 | # This class defines a complete generic visitor for a parse tree produced by JavadocParser. 9 | 10 | class JavadocParserVisitor(ParseTreeVisitor): 11 | 12 | # Visit a parse tree produced by JavadocParser#documentation. 13 | def visitDocumentation(self, ctx:JavadocParser.DocumentationContext): 14 | return self.visitChildren(ctx) 15 | 16 | 17 | # Visit a parse tree produced by JavadocParser#documentationContent. 18 | def visitDocumentationContent(self, ctx:JavadocParser.DocumentationContentContext): 19 | return self.visitChildren(ctx) 20 | 21 | 22 | # Visit a parse tree produced by JavadocParser#skipWhitespace. 23 | def visitSkipWhitespace(self, ctx:JavadocParser.SkipWhitespaceContext): 24 | return self.visitChildren(ctx) 25 | 26 | 27 | # Visit a parse tree produced by JavadocParser#description. 28 | def visitDescription(self, ctx:JavadocParser.DescriptionContext): 29 | return self.visitChildren(ctx) 30 | 31 | 32 | # Visit a parse tree produced by JavadocParser#descriptionLine. 33 | def visitDescriptionLine(self, ctx:JavadocParser.DescriptionLineContext): 34 | return self.visitChildren(ctx) 35 | 36 | 37 | # Visit a parse tree produced by JavadocParser#descriptionLineStart. 38 | def visitDescriptionLineStart(self, ctx:JavadocParser.DescriptionLineStartContext): 39 | return self.visitChildren(ctx) 40 | 41 | 42 | # Visit a parse tree produced by JavadocParser#descriptionLineNoSpaceNoAt. 43 | def visitDescriptionLineNoSpaceNoAt(self, ctx:JavadocParser.DescriptionLineNoSpaceNoAtContext): 44 | return self.visitChildren(ctx) 45 | 46 | 47 | # Visit a parse tree produced by JavadocParser#descriptionLineElement. 48 | def visitDescriptionLineElement(self, ctx:JavadocParser.DescriptionLineElementContext): 49 | return self.visitChildren(ctx) 50 | 51 | 52 | # Visit a parse tree produced by JavadocParser#descriptionLineText. 53 | def visitDescriptionLineText(self, ctx:JavadocParser.DescriptionLineTextContext): 54 | return self.visitChildren(ctx) 55 | 56 | 57 | # Visit a parse tree produced by JavadocParser#descriptionNewline. 58 | def visitDescriptionNewline(self, ctx:JavadocParser.DescriptionNewlineContext): 59 | return self.visitChildren(ctx) 60 | 61 | 62 | # Visit a parse tree produced by JavadocParser#tagSection. 63 | def visitTagSection(self, ctx:JavadocParser.TagSectionContext): 64 | return self.visitChildren(ctx) 65 | 66 | 67 | # Visit a parse tree produced by JavadocParser#blockTag. 68 | def visitBlockTag(self, ctx:JavadocParser.BlockTagContext): 69 | return self.visitChildren(ctx) 70 | 71 | 72 | # Visit a parse tree produced by JavadocParser#blockTagName. 73 | def visitBlockTagName(self, ctx:JavadocParser.BlockTagNameContext): 74 | return self.visitChildren(ctx) 75 | 76 | 77 | # Visit a parse tree produced by JavadocParser#blockTagContent. 78 | def visitBlockTagContent(self, ctx:JavadocParser.BlockTagContentContext): 79 | return self.visitChildren(ctx) 80 | 81 | 82 | # Visit a parse tree produced by JavadocParser#blockTagText. 83 | def visitBlockTagText(self, ctx:JavadocParser.BlockTagTextContext): 84 | return self.visitChildren(ctx) 85 | 86 | 87 | # Visit a parse tree produced by JavadocParser#blockTagTextElement. 88 | def visitBlockTagTextElement(self, ctx:JavadocParser.BlockTagTextElementContext): 89 | return self.visitChildren(ctx) 90 | 91 | 92 | # Visit a parse tree produced by JavadocParser#inlineTag. 93 | def visitInlineTag(self, ctx:JavadocParser.InlineTagContext): 94 | return self.visitChildren(ctx) 95 | 96 | 97 | # Visit a parse tree produced by JavadocParser#inlineTagName. 98 | def visitInlineTagName(self, ctx:JavadocParser.InlineTagNameContext): 99 | return self.visitChildren(ctx) 100 | 101 | 102 | # Visit a parse tree produced by JavadocParser#inlineTagContent. 103 | def visitInlineTagContent(self, ctx:JavadocParser.InlineTagContentContext): 104 | return self.visitChildren(ctx) 105 | 106 | 107 | # Visit a parse tree produced by JavadocParser#braceExpression. 108 | def visitBraceExpression(self, ctx:JavadocParser.BraceExpressionContext): 109 | return self.visitChildren(ctx) 110 | 111 | 112 | # Visit a parse tree produced by JavadocParser#braceContent. 113 | def visitBraceContent(self, ctx:JavadocParser.BraceContentContext): 114 | return self.visitChildren(ctx) 115 | 116 | 117 | # Visit a parse tree produced by JavadocParser#braceText. 118 | def visitBraceText(self, ctx:JavadocParser.BraceTextContext): 119 | return self.visitChildren(ctx) 120 | 121 | 122 | 123 | del JavadocParser -------------------------------------------------------------------------------- /decaf2many/lang/JavadocLexer.py: -------------------------------------------------------------------------------- 1 | # Generated from JavadocLexer.g4 by ANTLR 4.7.2 2 | from antlr4 import * 3 | from io import StringIO 4 | from typing.io import TextIO 5 | import sys 6 | 7 | 8 | def serializedATN(): 9 | with StringIO() as buf: 10 | buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\16") 11 | buf.write("x\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") 12 | buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\3\2") 13 | buf.write("\6\2\35\n\2\r\2\16\2\36\3\3\3\3\5\3#\n\3\3\3\3\3\3\3\6") 14 | buf.write("\3(\n\3\r\3\16\3)\5\3,\n\3\3\3\3\3\3\3\3\3\5\3\62\n\3") 15 | buf.write("\3\3\3\3\3\3\6\3\67\n\3\r\3\16\38\5\3;\n\3\3\3\3\3\5\3") 16 | buf.write("?\n\3\3\3\3\3\3\3\6\3D\n\3\r\3\16\3E\5\3H\n\3\5\3J\n\3") 17 | buf.write("\3\4\6\4M\n\4\r\4\16\4N\3\5\6\5R\n\5\r\5\16\5S\3\6\3\6") 18 | buf.write("\3\7\3\7\3\b\3\b\3\t\3\t\3\t\3\t\3\t\7\ta\n\t\f\t\16\t") 19 | buf.write("d\13\t\3\n\5\ng\n\n\3\n\7\nj\n\n\f\n\16\nm\13\n\3\n\3") 20 | buf.write("\n\3\n\3\13\3\13\3\13\3\f\3\f\3\r\3\r\2\2\16\3\3\5\4\7") 21 | buf.write("\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\3\2\5") 22 | buf.write("\4\2C\\c|\4\2\13\13\"\"\n\2\13\f\17\17\"\",,\61\61B\\") 23 | buf.write("c}\177\177\2\u0088\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2") 24 | buf.write("\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21") 25 | buf.write("\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3") 26 | buf.write("\2\2\2\3\34\3\2\2\2\5I\3\2\2\2\7L\3\2\2\2\tQ\3\2\2\2\13") 27 | buf.write("U\3\2\2\2\rW\3\2\2\2\17Y\3\2\2\2\21[\3\2\2\2\23f\3\2\2") 28 | buf.write("\2\25q\3\2\2\2\27t\3\2\2\2\31v\3\2\2\2\33\35\t\2\2\2\34") 29 | buf.write("\33\3\2\2\2\35\36\3\2\2\2\36\34\3\2\2\2\36\37\3\2\2\2") 30 | buf.write("\37\4\3\2\2\2 +\7\f\2\2!#\5\7\4\2\"!\3\2\2\2\"#\3\2\2") 31 | buf.write("\2#\'\3\2\2\2$%\5\r\7\2%&\6\3\2\2&(\3\2\2\2\'$\3\2\2\2") 32 | buf.write("()\3\2\2\2)\'\3\2\2\2)*\3\2\2\2*,\3\2\2\2+\"\3\2\2\2+") 33 | buf.write(",\3\2\2\2,J\3\2\2\2-.\7\17\2\2./\7\f\2\2/:\3\2\2\2\60") 34 | buf.write("\62\5\7\4\2\61\60\3\2\2\2\61\62\3\2\2\2\62\66\3\2\2\2") 35 | buf.write("\63\64\5\r\7\2\64\65\6\3\3\2\65\67\3\2\2\2\66\63\3\2\2") 36 | buf.write("\2\678\3\2\2\28\66\3\2\2\289\3\2\2\29;\3\2\2\2:\61\3\2") 37 | buf.write("\2\2:;\3\2\2\2;J\3\2\2\2=\3\2\2") 38 | buf.write("\2>?\3\2\2\2?C\3\2\2\2@A\5\r\7\2AB\6\3\4\2BD\3\2\2\2C") 39 | buf.write("@\3\2\2\2DE\3\2\2\2EC\3\2\2\2EF\3\2\2\2FH\3\2\2\2G>\3") 40 | buf.write("\2\2\2GH\3\2\2\2HJ\3\2\2\2I \3\2\2\2I-\3\2\2\2I<\3\2\2") 41 | buf.write("\2J\6\3\2\2\2KM\t\3\2\2LK\3\2\2\2MN\3\2\2\2NL\3\2\2\2") 42 | buf.write("NO\3\2\2\2O\b\3\2\2\2PR\n\4\2\2QP\3\2\2\2RS\3\2\2\2SQ") 43 | buf.write("\3\2\2\2ST\3\2\2\2T\n\3\2\2\2UV\7B\2\2V\f\3\2\2\2WX\7") 44 | buf.write(",\2\2X\16\3\2\2\2YZ\7\61\2\2Z\20\3\2\2\2[\\\7\61\2\2\\") 45 | buf.write("]\7,\2\2]^\7,\2\2^b\3\2\2\2_a\5\r\7\2`_\3\2\2\2ad\3\2") 46 | buf.write("\2\2b`\3\2\2\2bc\3\2\2\2c\22\3\2\2\2db\3\2\2\2eg\5\7\4") 47 | buf.write("\2fe\3\2\2\2fg\3\2\2\2gk\3\2\2\2hj\5\r\7\2ih\3\2\2\2j") 48 | buf.write("m\3\2\2\2ki\3\2\2\2kl\3\2\2\2ln\3\2\2\2mk\3\2\2\2no\7") 49 | buf.write(",\2\2op\7\61\2\2p\24\3\2\2\2qr\7}\2\2rs\7B\2\2s\26\3\2") 50 | buf.write("\2\2tu\7}\2\2u\30\3\2\2\2vw\7\177\2\2w\32\3\2\2\2\23\2") 51 | buf.write("\36\")+\618:>EGINSbfk\2") 52 | return buf.getvalue() 53 | 54 | 55 | class JavadocLexer(Lexer): 56 | 57 | atn = ATNDeserializer().deserialize(serializedATN()) 58 | 59 | decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ] 60 | 61 | NAME = 1 62 | NEWLINE = 2 63 | SPACE = 3 64 | TEXT_CONTENT = 4 65 | AT = 5 66 | STAR = 6 67 | SLASH = 7 68 | JAVADOC_START = 8 69 | JAVADOC_END = 9 70 | INLINE_TAG_START = 10 71 | BRACE_OPEN = 11 72 | BRACE_CLOSE = 12 73 | 74 | channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ] 75 | 76 | modeNames = [ "DEFAULT_MODE" ] 77 | 78 | literalNames = [ "", 79 | "'@'", "'*'", "'/'", "'{@'", "'{'", "'}'" ] 80 | 81 | symbolicNames = [ "", 82 | "NAME", "NEWLINE", "SPACE", "TEXT_CONTENT", "AT", "STAR", "SLASH", 83 | "JAVADOC_START", "JAVADOC_END", "INLINE_TAG_START", "BRACE_OPEN", 84 | "BRACE_CLOSE" ] 85 | 86 | ruleNames = [ "NAME", "NEWLINE", "SPACE", "TEXT_CONTENT", "AT", "STAR", 87 | "SLASH", "JAVADOC_START", "JAVADOC_END", "INLINE_TAG_START", 88 | "BRACE_OPEN", "BRACE_CLOSE" ] 89 | 90 | grammarFileName = "JavadocLexer.g4" 91 | 92 | def __init__(self, input=None, output:TextIO = sys.stdout): 93 | super().__init__(input, output) 94 | self.checkVersion("4.7.2") 95 | self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache()) 96 | self._actions = None 97 | self._predicates = None 98 | 99 | 100 | def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int): 101 | if self._predicates is None: 102 | preds = dict() 103 | preds[1] = self.NEWLINE_sempred 104 | self._predicates = preds 105 | pred = self._predicates.get(ruleIndex, None) 106 | if pred is not None: 107 | return pred(localctx, predIndex) 108 | else: 109 | raise Exception("No registered predicate for:" + str(ruleIndex)) 110 | 111 | def NEWLINE_sempred(self, localctx:RuleContext, predIndex:int): 112 | if predIndex == 0: 113 | return _input.LA(1) != '/' 114 | 115 | 116 | if predIndex == 1: 117 | return _input.LA(1) != '/' 118 | 119 | 120 | if predIndex == 2: 121 | return _input.LA(1) != '/' 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /decaf2many/lang/JavaLexer.g4: -------------------------------------------------------------------------------- 1 | /* 2 | [The "BSD licence"] 3 | Copyright (c) 2013 Terence Parr, Sam Harwell 4 | Copyright (c) 2017 Ivan Kochurkin (upgrade to Java 8) 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions 9 | are met: 10 | 1. Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 3. The name of the author may not be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 19 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | lexer grammar JavaLexer; 31 | 32 | // Keywords 33 | 34 | ABSTRACT: 'abstract'; 35 | ASSERT: 'assert'; 36 | BOOLEAN: 'boolean'; 37 | BREAK: 'break'; 38 | BYTE: 'byte'; 39 | CASE: 'case'; 40 | CATCH: 'catch'; 41 | CHAR: 'char'; 42 | CLASS: 'class'; 43 | CONST: 'const'; 44 | CONTINUE: 'continue'; 45 | DEFAULT: 'default'; 46 | DO: 'do'; 47 | DOUBLE: 'double'; 48 | ELSE: 'else'; 49 | ENUM: 'enum'; 50 | EXTENDS: 'extends'; 51 | FINAL: 'final'; 52 | FINALLY: 'finally'; 53 | FLOAT: 'float'; 54 | FOR: 'for'; 55 | IF: 'if'; 56 | GOTO: 'goto'; 57 | IMPLEMENTS: 'implements'; 58 | IMPORT: 'import'; 59 | INSTANCEOF: 'instanceof'; 60 | INT: 'int'; 61 | INTERFACE: 'interface'; 62 | LONG: 'long'; 63 | NATIVE: 'native'; 64 | NEW: 'new'; 65 | PACKAGE: 'package'; 66 | PRIVATE: 'private'; 67 | PROTECTED: 'protected'; 68 | PUBLIC: 'public'; 69 | RETURN: 'return'; 70 | SHORT: 'short'; 71 | STATIC: 'static'; 72 | STRICTFP: 'strictfp'; 73 | SUPER: 'super'; 74 | SWITCH: 'switch'; 75 | SYNCHRONIZED: 'synchronized'; 76 | THIS: 'this'; 77 | THROW: 'throw'; 78 | THROWS: 'throws'; 79 | TRANSIENT: 'transient'; 80 | TRY: 'try'; 81 | VOID: 'void'; 82 | VOLATILE: 'volatile'; 83 | WHILE: 'while'; 84 | 85 | // Literals 86 | 87 | DECIMAL_LITERAL: ('0' | [1-9] (Digits? | '_'+ Digits)) [lL]?; 88 | HEX_LITERAL: '0' [xX] [0-9a-fA-F] ([0-9a-fA-F_]* [0-9a-fA-F])? [lL]?; 89 | OCT_LITERAL: '0' '_'* [0-7] ([0-7_]* [0-7])? [lL]?; 90 | BINARY_LITERAL: '0' [bB] [01] ([01_]* [01])? [lL]?; 91 | 92 | FLOAT_LITERAL: (Digits '.' Digits? | '.' Digits) ExponentPart? [fFdD]? 93 | | Digits (ExponentPart [fFdD]? | [fFdD]) 94 | ; 95 | 96 | HEX_FLOAT_LITERAL: '0' [xX] (HexDigits '.'? | HexDigits? '.' HexDigits) [pP] [+-]? Digits [fFdD]?; 97 | 98 | BOOL_LITERAL: 'true' 99 | | 'false' 100 | ; 101 | 102 | CHAR_LITERAL: '\'' (~['\\\r\n] | EscapeSequence) '\''; 103 | 104 | STRING_LITERAL: '"' (~["\\\r\n] | EscapeSequence)* '"'; 105 | 106 | NULL_LITERAL: 'null'; 107 | 108 | // Separators 109 | 110 | LPAREN: '('; 111 | RPAREN: ')'; 112 | LBRACE: '{'; 113 | RBRACE: '}'; 114 | LBRACK: '['; 115 | RBRACK: ']'; 116 | SEMI: ';'; 117 | COMMA: ','; 118 | DOT: '.'; 119 | 120 | // Operators 121 | 122 | ASSIGN: '='; 123 | GT: '>'; 124 | LT: '<'; 125 | BANG: '!'; 126 | TILDE: '~'; 127 | QUESTION: '?'; 128 | COLON: ':'; 129 | EQUAL: '=='; 130 | LE: '<='; 131 | GE: '>='; 132 | NOTEQUAL: '!='; 133 | AND: '&&'; 134 | OR: '||'; 135 | INC: '++'; 136 | DEC: '--'; 137 | ADD: '+'; 138 | SUB: '-'; 139 | MUL: '*'; 140 | DIV: '/'; 141 | BITAND: '&'; 142 | BITOR: '|'; 143 | CARET: '^'; 144 | MOD: '%'; 145 | 146 | ADD_ASSIGN: '+='; 147 | SUB_ASSIGN: '-='; 148 | MUL_ASSIGN: '*='; 149 | DIV_ASSIGN: '/='; 150 | AND_ASSIGN: '&='; 151 | OR_ASSIGN: '|='; 152 | XOR_ASSIGN: '^='; 153 | MOD_ASSIGN: '%='; 154 | LSHIFT_ASSIGN: '<<='; 155 | RSHIFT_ASSIGN: '>>='; 156 | URSHIFT_ASSIGN: '>>>='; 157 | 158 | // Java 8 tokens 159 | 160 | ARROW: '->'; 161 | COLONCOLON: '::'; 162 | 163 | // Additional symbols not defined in the lexical specification 164 | 165 | AT: '@'; 166 | ELLIPSIS: '...'; 167 | 168 | // Whitespace and comments 169 | 170 | WS: [ \t\r\n\u000C]+ -> channel(HIDDEN); 171 | COMMENT: '/*' .*? '*/' -> channel(HIDDEN); 172 | LINE_COMMENT: '//' ~[\r\n]* -> channel(HIDDEN); 173 | JAVADOC_COMMENT: '/**' .*? '*/' -> channel(HIDDEN); 174 | 175 | // Identifiers 176 | 177 | IDENTIFIER: Letter LetterOrDigit*; 178 | 179 | // Fragment rules 180 | 181 | fragment ExponentPart 182 | : [eE] [+-]? Digits 183 | ; 184 | 185 | fragment EscapeSequence 186 | : '\\' [btnfr"'\\] 187 | | '\\' ([0-3]? [0-7])? [0-7] 188 | | '\\' 'u'+ HexDigit HexDigit HexDigit HexDigit 189 | ; 190 | 191 | fragment HexDigits 192 | : HexDigit ((HexDigit | '_')* HexDigit)? 193 | ; 194 | 195 | fragment HexDigit 196 | : [0-9a-fA-F] 197 | ; 198 | 199 | fragment Digits 200 | : [0-9] ([0-9_]* [0-9])? 201 | ; 202 | 203 | fragment LetterOrDigit 204 | : Letter 205 | | [0-9] 206 | ; 207 | 208 | fragment Letter 209 | : [a-zA-Z$_] // these are the "java letters" below 0x7F 210 | | ~[\u0000-\u007F\uD800-\uDBFF] // covers all characters above 0x7F which are not a surrogate 211 | | [\uD800-\uDBFF] [\uDC00-\uDFFF] // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF 212 | ; 213 | -------------------------------------------------------------------------------- /decaf2many/lang/JavadocParserListener.py: -------------------------------------------------------------------------------- 1 | # Generated from JavadocParser.g4 by ANTLR 4.7.2 2 | from antlr4 import * 3 | if __name__ is not None and "." in __name__: 4 | from .JavadocParser import JavadocParser 5 | else: 6 | from JavadocParser import JavadocParser 7 | 8 | # This class defines a complete listener for a parse tree produced by JavadocParser. 9 | class JavadocParserListener(ParseTreeListener): 10 | 11 | # Enter a parse tree produced by JavadocParser#documentation. 12 | def enterDocumentation(self, ctx:JavadocParser.DocumentationContext): 13 | pass 14 | 15 | # Exit a parse tree produced by JavadocParser#documentation. 16 | def exitDocumentation(self, ctx:JavadocParser.DocumentationContext): 17 | pass 18 | 19 | 20 | # Enter a parse tree produced by JavadocParser#documentationContent. 21 | def enterDocumentationContent(self, ctx:JavadocParser.DocumentationContentContext): 22 | pass 23 | 24 | # Exit a parse tree produced by JavadocParser#documentationContent. 25 | def exitDocumentationContent(self, ctx:JavadocParser.DocumentationContentContext): 26 | pass 27 | 28 | 29 | # Enter a parse tree produced by JavadocParser#skipWhitespace. 30 | def enterSkipWhitespace(self, ctx:JavadocParser.SkipWhitespaceContext): 31 | pass 32 | 33 | # Exit a parse tree produced by JavadocParser#skipWhitespace. 34 | def exitSkipWhitespace(self, ctx:JavadocParser.SkipWhitespaceContext): 35 | pass 36 | 37 | 38 | # Enter a parse tree produced by JavadocParser#description. 39 | def enterDescription(self, ctx:JavadocParser.DescriptionContext): 40 | pass 41 | 42 | # Exit a parse tree produced by JavadocParser#description. 43 | def exitDescription(self, ctx:JavadocParser.DescriptionContext): 44 | pass 45 | 46 | 47 | # Enter a parse tree produced by JavadocParser#descriptionLine. 48 | def enterDescriptionLine(self, ctx:JavadocParser.DescriptionLineContext): 49 | pass 50 | 51 | # Exit a parse tree produced by JavadocParser#descriptionLine. 52 | def exitDescriptionLine(self, ctx:JavadocParser.DescriptionLineContext): 53 | pass 54 | 55 | 56 | # Enter a parse tree produced by JavadocParser#descriptionLineStart. 57 | def enterDescriptionLineStart(self, ctx:JavadocParser.DescriptionLineStartContext): 58 | pass 59 | 60 | # Exit a parse tree produced by JavadocParser#descriptionLineStart. 61 | def exitDescriptionLineStart(self, ctx:JavadocParser.DescriptionLineStartContext): 62 | pass 63 | 64 | 65 | # Enter a parse tree produced by JavadocParser#descriptionLineNoSpaceNoAt. 66 | def enterDescriptionLineNoSpaceNoAt(self, ctx:JavadocParser.DescriptionLineNoSpaceNoAtContext): 67 | pass 68 | 69 | # Exit a parse tree produced by JavadocParser#descriptionLineNoSpaceNoAt. 70 | def exitDescriptionLineNoSpaceNoAt(self, ctx:JavadocParser.DescriptionLineNoSpaceNoAtContext): 71 | pass 72 | 73 | 74 | # Enter a parse tree produced by JavadocParser#descriptionLineElement. 75 | def enterDescriptionLineElement(self, ctx:JavadocParser.DescriptionLineElementContext): 76 | pass 77 | 78 | # Exit a parse tree produced by JavadocParser#descriptionLineElement. 79 | def exitDescriptionLineElement(self, ctx:JavadocParser.DescriptionLineElementContext): 80 | pass 81 | 82 | 83 | # Enter a parse tree produced by JavadocParser#descriptionLineText. 84 | def enterDescriptionLineText(self, ctx:JavadocParser.DescriptionLineTextContext): 85 | pass 86 | 87 | # Exit a parse tree produced by JavadocParser#descriptionLineText. 88 | def exitDescriptionLineText(self, ctx:JavadocParser.DescriptionLineTextContext): 89 | pass 90 | 91 | 92 | # Enter a parse tree produced by JavadocParser#descriptionNewline. 93 | def enterDescriptionNewline(self, ctx:JavadocParser.DescriptionNewlineContext): 94 | pass 95 | 96 | # Exit a parse tree produced by JavadocParser#descriptionNewline. 97 | def exitDescriptionNewline(self, ctx:JavadocParser.DescriptionNewlineContext): 98 | pass 99 | 100 | 101 | # Enter a parse tree produced by JavadocParser#tagSection. 102 | def enterTagSection(self, ctx:JavadocParser.TagSectionContext): 103 | pass 104 | 105 | # Exit a parse tree produced by JavadocParser#tagSection. 106 | def exitTagSection(self, ctx:JavadocParser.TagSectionContext): 107 | pass 108 | 109 | 110 | # Enter a parse tree produced by JavadocParser#blockTag. 111 | def enterBlockTag(self, ctx:JavadocParser.BlockTagContext): 112 | pass 113 | 114 | # Exit a parse tree produced by JavadocParser#blockTag. 115 | def exitBlockTag(self, ctx:JavadocParser.BlockTagContext): 116 | pass 117 | 118 | 119 | # Enter a parse tree produced by JavadocParser#blockTagName. 120 | def enterBlockTagName(self, ctx:JavadocParser.BlockTagNameContext): 121 | pass 122 | 123 | # Exit a parse tree produced by JavadocParser#blockTagName. 124 | def exitBlockTagName(self, ctx:JavadocParser.BlockTagNameContext): 125 | pass 126 | 127 | 128 | # Enter a parse tree produced by JavadocParser#blockTagContent. 129 | def enterBlockTagContent(self, ctx:JavadocParser.BlockTagContentContext): 130 | pass 131 | 132 | # Exit a parse tree produced by JavadocParser#blockTagContent. 133 | def exitBlockTagContent(self, ctx:JavadocParser.BlockTagContentContext): 134 | pass 135 | 136 | 137 | # Enter a parse tree produced by JavadocParser#blockTagText. 138 | def enterBlockTagText(self, ctx:JavadocParser.BlockTagTextContext): 139 | pass 140 | 141 | # Exit a parse tree produced by JavadocParser#blockTagText. 142 | def exitBlockTagText(self, ctx:JavadocParser.BlockTagTextContext): 143 | pass 144 | 145 | 146 | # Enter a parse tree produced by JavadocParser#blockTagTextElement. 147 | def enterBlockTagTextElement(self, ctx:JavadocParser.BlockTagTextElementContext): 148 | pass 149 | 150 | # Exit a parse tree produced by JavadocParser#blockTagTextElement. 151 | def exitBlockTagTextElement(self, ctx:JavadocParser.BlockTagTextElementContext): 152 | pass 153 | 154 | 155 | # Enter a parse tree produced by JavadocParser#inlineTag. 156 | def enterInlineTag(self, ctx:JavadocParser.InlineTagContext): 157 | pass 158 | 159 | # Exit a parse tree produced by JavadocParser#inlineTag. 160 | def exitInlineTag(self, ctx:JavadocParser.InlineTagContext): 161 | pass 162 | 163 | 164 | # Enter a parse tree produced by JavadocParser#inlineTagName. 165 | def enterInlineTagName(self, ctx:JavadocParser.InlineTagNameContext): 166 | pass 167 | 168 | # Exit a parse tree produced by JavadocParser#inlineTagName. 169 | def exitInlineTagName(self, ctx:JavadocParser.InlineTagNameContext): 170 | pass 171 | 172 | 173 | # Enter a parse tree produced by JavadocParser#inlineTagContent. 174 | def enterInlineTagContent(self, ctx:JavadocParser.InlineTagContentContext): 175 | pass 176 | 177 | # Exit a parse tree produced by JavadocParser#inlineTagContent. 178 | def exitInlineTagContent(self, ctx:JavadocParser.InlineTagContentContext): 179 | pass 180 | 181 | 182 | # Enter a parse tree produced by JavadocParser#braceExpression. 183 | def enterBraceExpression(self, ctx:JavadocParser.BraceExpressionContext): 184 | pass 185 | 186 | # Exit a parse tree produced by JavadocParser#braceExpression. 187 | def exitBraceExpression(self, ctx:JavadocParser.BraceExpressionContext): 188 | pass 189 | 190 | 191 | # Enter a parse tree produced by JavadocParser#braceContent. 192 | def enterBraceContent(self, ctx:JavadocParser.BraceContentContext): 193 | pass 194 | 195 | # Exit a parse tree produced by JavadocParser#braceContent. 196 | def exitBraceContent(self, ctx:JavadocParser.BraceContentContext): 197 | pass 198 | 199 | 200 | # Enter a parse tree produced by JavadocParser#braceText. 201 | def enterBraceText(self, ctx:JavadocParser.BraceTextContext): 202 | pass 203 | 204 | # Exit a parse tree produced by JavadocParser#braceText. 205 | def exitBraceText(self, ctx:JavadocParser.BraceTextContext): 206 | pass 207 | 208 | 209 | -------------------------------------------------------------------------------- /decaf2many/lang/JavadocParser.interp: -------------------------------------------------------------------------------- 1 | token literal names: 2 | null 3 | null 4 | null 5 | null 6 | null 7 | '@' 8 | '*' 9 | '/' 10 | null 11 | null 12 | '{@' 13 | '{' 14 | '}' 15 | 16 | token symbolic names: 17 | null 18 | NAME 19 | NEWLINE 20 | SPACE 21 | TEXT_CONTENT 22 | AT 23 | STAR 24 | SLASH 25 | JAVADOC_START 26 | JAVADOC_END 27 | INLINE_TAG_START 28 | BRACE_OPEN 29 | BRACE_CLOSE 30 | 31 | rule names: 32 | documentation 33 | documentationContent 34 | skipWhitespace 35 | description 36 | descriptionLine 37 | descriptionLineStart 38 | descriptionLineNoSpaceNoAt 39 | descriptionLineElement 40 | descriptionLineText 41 | descriptionNewline 42 | tagSection 43 | blockTag 44 | blockTagName 45 | blockTagContent 46 | blockTagText 47 | blockTagTextElement 48 | inlineTag 49 | inlineTagName 50 | inlineTagContent 51 | braceExpression 52 | braceContent 53 | braceText 54 | 55 | 56 | atn: 57 | [3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 14, 242, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 3, 2, 3, 2, 3, 2, 7, 2, 50, 10, 2, 12, 2, 14, 2, 53, 11, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 60, 10, 2, 12, 2, 14, 2, 63, 11, 2, 3, 2, 3, 2, 3, 2, 5, 2, 68, 10, 2, 3, 3, 3, 3, 7, 3, 72, 10, 3, 12, 3, 14, 3, 75, 11, 3, 3, 3, 7, 3, 78, 10, 3, 12, 3, 14, 3, 81, 11, 3, 3, 3, 3, 3, 3, 3, 6, 3, 86, 10, 3, 13, 3, 14, 3, 87, 3, 3, 7, 3, 91, 10, 3, 12, 3, 14, 3, 94, 11, 3, 3, 3, 3, 3, 5, 3, 98, 10, 3, 3, 4, 3, 4, 3, 5, 3, 5, 6, 5, 104, 10, 5, 13, 5, 14, 5, 105, 3, 5, 3, 5, 7, 5, 110, 10, 5, 12, 5, 14, 5, 113, 11, 5, 3, 6, 3, 6, 7, 6, 117, 10, 6, 12, 6, 14, 6, 120, 11, 6, 3, 6, 3, 6, 7, 6, 124, 10, 6, 12, 6, 14, 6, 127, 11, 6, 5, 6, 129, 10, 6, 3, 7, 5, 7, 132, 10, 7, 3, 7, 6, 7, 135, 10, 7, 13, 7, 14, 7, 136, 3, 7, 3, 7, 3, 7, 7, 7, 142, 10, 7, 12, 7, 14, 7, 145, 11, 7, 3, 8, 3, 8, 3, 9, 3, 9, 5, 9, 151, 10, 9, 3, 10, 3, 10, 3, 10, 6, 10, 156, 10, 10, 13, 10, 14, 10, 157, 3, 11, 3, 11, 3, 12, 6, 12, 163, 10, 12, 13, 12, 14, 12, 164, 3, 13, 5, 13, 168, 10, 13, 3, 13, 3, 13, 3, 13, 5, 13, 173, 10, 13, 3, 13, 7, 13, 176, 10, 13, 12, 13, 14, 13, 179, 11, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 5, 15, 186, 10, 15, 3, 16, 6, 16, 189, 10, 16, 13, 16, 14, 16, 190, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 7, 18, 198, 10, 18, 12, 18, 14, 18, 201, 11, 18, 3, 18, 5, 18, 204, 10, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 6, 20, 211, 10, 20, 13, 20, 14, 20, 212, 3, 21, 3, 21, 7, 21, 217, 10, 21, 12, 21, 14, 21, 220, 11, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 7, 22, 227, 10, 22, 12, 22, 14, 22, 230, 11, 22, 3, 22, 7, 22, 233, 10, 22, 12, 22, 14, 22, 236, 11, 22, 5, 22, 238, 10, 22, 3, 23, 3, 23, 3, 23, 2, 2, 24, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 2, 6, 3, 2, 4, 5, 6, 2, 3, 3, 6, 6, 8, 9, 13, 14, 6, 2, 3, 3, 5, 6, 8, 9, 13, 14, 4, 2, 3, 6, 8, 9, 2, 257, 2, 67, 3, 2, 2, 2, 4, 97, 3, 2, 2, 2, 6, 99, 3, 2, 2, 2, 8, 101, 3, 2, 2, 2, 10, 128, 3, 2, 2, 2, 12, 131, 3, 2, 2, 2, 14, 146, 3, 2, 2, 2, 16, 150, 3, 2, 2, 2, 18, 155, 3, 2, 2, 2, 20, 159, 3, 2, 2, 2, 22, 162, 3, 2, 2, 2, 24, 167, 3, 2, 2, 2, 26, 180, 3, 2, 2, 2, 28, 185, 3, 2, 2, 2, 30, 188, 3, 2, 2, 2, 32, 192, 3, 2, 2, 2, 34, 194, 3, 2, 2, 2, 36, 207, 3, 2, 2, 2, 38, 210, 3, 2, 2, 2, 40, 214, 3, 2, 2, 2, 42, 237, 3, 2, 2, 2, 44, 239, 3, 2, 2, 2, 46, 68, 7, 2, 2, 3, 47, 51, 7, 10, 2, 2, 48, 50, 5, 6, 4, 2, 49, 48, 3, 2, 2, 2, 50, 53, 3, 2, 2, 2, 51, 49, 3, 2, 2, 2, 51, 52, 3, 2, 2, 2, 52, 54, 3, 2, 2, 2, 53, 51, 3, 2, 2, 2, 54, 55, 5, 4, 3, 2, 55, 56, 7, 11, 2, 2, 56, 57, 7, 2, 2, 3, 57, 68, 3, 2, 2, 2, 58, 60, 5, 6, 4, 2, 59, 58, 3, 2, 2, 2, 60, 63, 3, 2, 2, 2, 61, 59, 3, 2, 2, 2, 61, 62, 3, 2, 2, 2, 62, 64, 3, 2, 2, 2, 63, 61, 3, 2, 2, 2, 64, 65, 5, 4, 3, 2, 65, 66, 7, 2, 2, 3, 66, 68, 3, 2, 2, 2, 67, 46, 3, 2, 2, 2, 67, 47, 3, 2, 2, 2, 67, 61, 3, 2, 2, 2, 68, 3, 3, 2, 2, 2, 69, 73, 5, 8, 5, 2, 70, 72, 5, 6, 4, 2, 71, 70, 3, 2, 2, 2, 72, 75, 3, 2, 2, 2, 73, 71, 3, 2, 2, 2, 73, 74, 3, 2, 2, 2, 74, 98, 3, 2, 2, 2, 75, 73, 3, 2, 2, 2, 76, 78, 5, 6, 4, 2, 77, 76, 3, 2, 2, 2, 78, 81, 3, 2, 2, 2, 79, 77, 3, 2, 2, 2, 79, 80, 3, 2, 2, 2, 80, 82, 3, 2, 2, 2, 81, 79, 3, 2, 2, 2, 82, 98, 5, 22, 12, 2, 83, 85, 5, 8, 5, 2, 84, 86, 7, 4, 2, 2, 85, 84, 3, 2, 2, 2, 86, 87, 3, 2, 2, 2, 87, 85, 3, 2, 2, 2, 87, 88, 3, 2, 2, 2, 88, 92, 3, 2, 2, 2, 89, 91, 5, 6, 4, 2, 90, 89, 3, 2, 2, 2, 91, 94, 3, 2, 2, 2, 92, 90, 3, 2, 2, 2, 92, 93, 3, 2, 2, 2, 93, 95, 3, 2, 2, 2, 94, 92, 3, 2, 2, 2, 95, 96, 5, 22, 12, 2, 96, 98, 3, 2, 2, 2, 97, 69, 3, 2, 2, 2, 97, 79, 3, 2, 2, 2, 97, 83, 3, 2, 2, 2, 98, 5, 3, 2, 2, 2, 99, 100, 9, 2, 2, 2, 100, 7, 3, 2, 2, 2, 101, 111, 5, 10, 6, 2, 102, 104, 5, 20, 11, 2, 103, 102, 3, 2, 2, 2, 104, 105, 3, 2, 2, 2, 105, 103, 3, 2, 2, 2, 105, 106, 3, 2, 2, 2, 106, 107, 3, 2, 2, 2, 107, 108, 5, 10, 6, 2, 108, 110, 3, 2, 2, 2, 109, 103, 3, 2, 2, 2, 110, 113, 3, 2, 2, 2, 111, 109, 3, 2, 2, 2, 111, 112, 3, 2, 2, 2, 112, 9, 3, 2, 2, 2, 113, 111, 3, 2, 2, 2, 114, 118, 5, 12, 7, 2, 115, 117, 5, 16, 9, 2, 116, 115, 3, 2, 2, 2, 117, 120, 3, 2, 2, 2, 118, 116, 3, 2, 2, 2, 118, 119, 3, 2, 2, 2, 119, 129, 3, 2, 2, 2, 120, 118, 3, 2, 2, 2, 121, 125, 5, 34, 18, 2, 122, 124, 5, 16, 9, 2, 123, 122, 3, 2, 2, 2, 124, 127, 3, 2, 2, 2, 125, 123, 3, 2, 2, 2, 125, 126, 3, 2, 2, 2, 126, 129, 3, 2, 2, 2, 127, 125, 3, 2, 2, 2, 128, 114, 3, 2, 2, 2, 128, 121, 3, 2, 2, 2, 129, 11, 3, 2, 2, 2, 130, 132, 7, 5, 2, 2, 131, 130, 3, 2, 2, 2, 131, 132, 3, 2, 2, 2, 132, 134, 3, 2, 2, 2, 133, 135, 5, 14, 8, 2, 134, 133, 3, 2, 2, 2, 135, 136, 3, 2, 2, 2, 136, 134, 3, 2, 2, 2, 136, 137, 3, 2, 2, 2, 137, 143, 3, 2, 2, 2, 138, 142, 5, 14, 8, 2, 139, 142, 7, 5, 2, 2, 140, 142, 7, 7, 2, 2, 141, 138, 3, 2, 2, 2, 141, 139, 3, 2, 2, 2, 141, 140, 3, 2, 2, 2, 142, 145, 3, 2, 2, 2, 143, 141, 3, 2, 2, 2, 143, 144, 3, 2, 2, 2, 144, 13, 3, 2, 2, 2, 145, 143, 3, 2, 2, 2, 146, 147, 9, 3, 2, 2, 147, 15, 3, 2, 2, 2, 148, 151, 5, 34, 18, 2, 149, 151, 5, 18, 10, 2, 150, 148, 3, 2, 2, 2, 150, 149, 3, 2, 2, 2, 151, 17, 3, 2, 2, 2, 152, 156, 5, 14, 8, 2, 153, 156, 7, 5, 2, 2, 154, 156, 7, 7, 2, 2, 155, 152, 3, 2, 2, 2, 155, 153, 3, 2, 2, 2, 155, 154, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 155, 3, 2, 2, 2, 157, 158, 3, 2, 2, 2, 158, 19, 3, 2, 2, 2, 159, 160, 7, 4, 2, 2, 160, 21, 3, 2, 2, 2, 161, 163, 5, 24, 13, 2, 162, 161, 3, 2, 2, 2, 163, 164, 3, 2, 2, 2, 164, 162, 3, 2, 2, 2, 164, 165, 3, 2, 2, 2, 165, 23, 3, 2, 2, 2, 166, 168, 7, 5, 2, 2, 167, 166, 3, 2, 2, 2, 167, 168, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 170, 7, 7, 2, 2, 170, 172, 5, 26, 14, 2, 171, 173, 7, 5, 2, 2, 172, 171, 3, 2, 2, 2, 172, 173, 3, 2, 2, 2, 173, 177, 3, 2, 2, 2, 174, 176, 5, 28, 15, 2, 175, 174, 3, 2, 2, 2, 176, 179, 3, 2, 2, 2, 177, 175, 3, 2, 2, 2, 177, 178, 3, 2, 2, 2, 178, 25, 3, 2, 2, 2, 179, 177, 3, 2, 2, 2, 180, 181, 7, 3, 2, 2, 181, 27, 3, 2, 2, 2, 182, 186, 5, 30, 16, 2, 183, 186, 5, 34, 18, 2, 184, 186, 7, 4, 2, 2, 185, 182, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 185, 184, 3, 2, 2, 2, 186, 29, 3, 2, 2, 2, 187, 189, 5, 32, 17, 2, 188, 187, 3, 2, 2, 2, 189, 190, 3, 2, 2, 2, 190, 188, 3, 2, 2, 2, 190, 191, 3, 2, 2, 2, 191, 31, 3, 2, 2, 2, 192, 193, 9, 4, 2, 2, 193, 33, 3, 2, 2, 2, 194, 195, 7, 12, 2, 2, 195, 199, 5, 36, 19, 2, 196, 198, 7, 5, 2, 2, 197, 196, 3, 2, 2, 2, 198, 201, 3, 2, 2, 2, 199, 197, 3, 2, 2, 2, 199, 200, 3, 2, 2, 2, 200, 203, 3, 2, 2, 2, 201, 199, 3, 2, 2, 2, 202, 204, 5, 38, 20, 2, 203, 202, 3, 2, 2, 2, 203, 204, 3, 2, 2, 2, 204, 205, 3, 2, 2, 2, 205, 206, 7, 14, 2, 2, 206, 35, 3, 2, 2, 2, 207, 208, 7, 3, 2, 2, 208, 37, 3, 2, 2, 2, 209, 211, 5, 42, 22, 2, 210, 209, 3, 2, 2, 2, 211, 212, 3, 2, 2, 2, 212, 210, 3, 2, 2, 2, 212, 213, 3, 2, 2, 2, 213, 39, 3, 2, 2, 2, 214, 218, 7, 13, 2, 2, 215, 217, 5, 42, 22, 2, 216, 215, 3, 2, 2, 2, 217, 220, 3, 2, 2, 2, 218, 216, 3, 2, 2, 2, 218, 219, 3, 2, 2, 2, 219, 221, 3, 2, 2, 2, 220, 218, 3, 2, 2, 2, 221, 222, 7, 14, 2, 2, 222, 41, 3, 2, 2, 2, 223, 238, 5, 40, 21, 2, 224, 234, 5, 44, 23, 2, 225, 227, 7, 4, 2, 2, 226, 225, 3, 2, 2, 2, 227, 230, 3, 2, 2, 2, 228, 226, 3, 2, 2, 2, 228, 229, 3, 2, 2, 2, 229, 231, 3, 2, 2, 2, 230, 228, 3, 2, 2, 2, 231, 233, 5, 44, 23, 2, 232, 228, 3, 2, 2, 2, 233, 236, 3, 2, 2, 2, 234, 232, 3, 2, 2, 2, 234, 235, 3, 2, 2, 2, 235, 238, 3, 2, 2, 2, 236, 234, 3, 2, 2, 2, 237, 223, 3, 2, 2, 2, 237, 224, 3, 2, 2, 2, 238, 43, 3, 2, 2, 2, 239, 240, 9, 5, 2, 2, 240, 45, 3, 2, 2, 2, 35, 51, 61, 67, 73, 79, 87, 92, 97, 105, 111, 118, 125, 128, 131, 136, 141, 143, 150, 155, 157, 164, 167, 172, 177, 185, 190, 199, 203, 212, 218, 228, 234, 237] -------------------------------------------------------------------------------- /decaf2many/decaf2many.py: -------------------------------------------------------------------------------- 1 | """Main module.""" 2 | 3 | import textwrap 4 | from typing import DefaultDict 5 | from .lang.JavaParserVisitor import JavaParserVisitor 6 | from .lang.JavaParser import JavaParser 7 | 8 | 9 | class Transpiler(JavaParserVisitor): 10 | DISPATCH_MAP = {"System.out.println": "print"} 11 | INDENT = " " * 4 12 | TYPE_MAP = { 13 | "String": "str", 14 | "Integer": "i32", 15 | "int": "i32", 16 | "Boolean": "bool", 17 | "boolean": "bool", 18 | "Double": "float", 19 | "double": "float", 20 | "char": "u16", 21 | "Long": "u64", 22 | "long": "u64", 23 | } 24 | BINARY_OPS = { 25 | # Arithmetic 26 | JavaParser.ADD, 27 | JavaParser.SUB, 28 | JavaParser.MUL, 29 | JavaParser.DIV, 30 | JavaParser.MOD, 31 | # Bitwise 32 | JavaParser.BITAND, 33 | JavaParser.BITOR, 34 | JavaParser.CARET, 35 | # Logical 36 | JavaParser.GT, 37 | JavaParser.LT, 38 | JavaParser.GE, 39 | JavaParser.LE, 40 | JavaParser.EQUAL, 41 | JavaParser.NOTEQUAL, 42 | JavaParser.AND, 43 | JavaParser.OR, 44 | } 45 | 46 | def __init__(self) -> None: 47 | super().__init__() 48 | 49 | def indent(self, text): 50 | return textwrap.indent(text, self.INDENT) 51 | 52 | def defaultResult(self): 53 | return "" 54 | 55 | def aggregateResult(self, aggregate, nextResult): 56 | return aggregate + nextResult 57 | 58 | def _dispatch(self, fname): 59 | if fname in self.DISPATCH_MAP: 60 | return self.DISPATCH_MAP[fname] 61 | return fname 62 | 63 | def visitComment(self, comment, parser): 64 | if comment.type == parser.LINE_COMMENT: 65 | return comment.text.replace("//", "#") 66 | return comment.text 67 | 68 | def visitComments(self, ctx): 69 | pos = ctx.getSourceInterval()[0] 70 | comments = ctx.parser.getTokenStream().getHiddenTokensToLeft(pos) 71 | if comments is None: 72 | return "" 73 | comments_str = [self.visitComment(c, ctx.parser) for c in comments] 74 | return "\n".join(comments_str) 75 | 76 | def visitCompilationUnit(self, ctx: JavaParser.CompilationUnitContext): 77 | c = self.visitComments(ctx) 78 | return c + "\n".join([self.visit(t) for t in ctx.typeDeclaration()]) + "\n" 79 | 80 | def visitClassDeclaration(self, ctx: JavaParser.ClassDeclarationContext): 81 | name = ctx.IDENTIFIER().getText() 82 | body = self.visit(ctx.classBody()) 83 | body = self.indent(body) 84 | return ( 85 | textwrap.dedent( 86 | f"""\ 87 | class {name}: 88 | """ 89 | ) 90 | + body 91 | ) 92 | 93 | def getDecorator(self, m: str) -> str: 94 | if m == "static": 95 | return "@staticmethod" 96 | return "" 97 | 98 | def visitMethodDeclaration(self, ctx: JavaParser.MethodDeclarationContext): 99 | fname = ctx.IDENTIFIER().getText() 100 | body = self.visit(ctx.methodBody()) 101 | params = self.visit(ctx.formalParameters()) 102 | body = self.indent(body) 103 | modifiers = "\n".join( 104 | [self.getDecorator(m) for m in ctx.parentCtx.parentCtx.modifiers] 105 | ) 106 | return ( 107 | modifiers 108 | + "\n" 109 | + textwrap.dedent( 110 | f"""\ 111 | def {fname}{params}: 112 | """ 113 | ) 114 | + body 115 | + "\n" 116 | ) 117 | 118 | def visitClassBodyDeclaration(self, ctx: JavaParser.ClassBodyDeclarationContext): 119 | ctx.modifiers = [] 120 | return super().visitClassBodyDeclaration(ctx) 121 | 122 | def visitClassOrInterfaceModifier( 123 | self, ctx: JavaParser.ClassOrInterfaceModifierContext 124 | ): 125 | ctx.parentCtx.parentCtx.modifiers.append(ctx.getText()) 126 | return "" 127 | 128 | def visitMethodCall(self, ctx: JavaParser.MethodCallContext): 129 | fname = ctx.IDENTIFIER().getText() 130 | args = ctx.expressionList() 131 | args = [args.expression(i) for i in range(args.getChildCount())] 132 | args_str = ",".join([self.visit(a) for a in args]) 133 | return f"{fname}({args_str})" 134 | 135 | def visitLiteral(self, ctx: JavaParser.LiteralContext): 136 | if ctx.STRING_LITERAL: 137 | return ctx.getText() 138 | # Possibly other transformations go here 139 | return ctx.getText() 140 | 141 | def visitFormalParameterList(self, ctx: JavaParser.FormalParameterListContext): 142 | params = [ctx.formalParameter(i) for i in range(ctx.getChildCount())] 143 | return ", ".join([self.visit(a) for a in params if a is not None]) 144 | 145 | def visitFormalParameter(self, ctx: JavaParser.FormalParameterContext): 146 | name = self.visit(ctx.variableDeclaratorId()) 147 | ptype = self.visit(ctx.typeType()) 148 | return f"{name}: {ptype}" 149 | 150 | def visitVariableDeclaratorId(self, ctx: JavaParser.VariableDeclaratorIdContext): 151 | return ctx.getText() 152 | 153 | def visitClassOrInterfaceType(self, ctx: JavaParser.ClassOrInterfaceTypeContext): 154 | java_type = ctx.getText() 155 | return self.TYPE_MAP[java_type] 156 | 157 | def visitPrimitiveType(self, ctx: JavaParser.PrimitiveTypeContext): 158 | java_type = ctx.getText() 159 | return self.TYPE_MAP[java_type] 160 | 161 | def visitTypeType(self, ctx: JavaParser.TypeTypeContext): 162 | base = "UnknownType" 163 | if ctx.classOrInterfaceType(): 164 | base = self.visit(ctx.classOrInterfaceType()) 165 | elif ctx.primitiveType(): 166 | base = self.visit(ctx.primitiveType()) 167 | if len(ctx.LBRACK()): 168 | return f"List[{base}]" 169 | return base 170 | 171 | def visitPrimary(self, ctx: JavaParser.PrimaryContext): 172 | return ctx.getText() 173 | 174 | def visitTerminal(self, ctx): 175 | if ctx.getText() in {"{", "}"}: 176 | return "" 177 | return ctx.getText() 178 | 179 | def visitExpression(self, ctx: JavaParser.ExpressionContext): 180 | if ctx.bop and ctx.bop.type in self.BINARY_OPS: 181 | left = self.visit(ctx.expression(0)) 182 | right = self.visit(ctx.expression(1)) 183 | return f"{left} {ctx.bop.text} {right}" 184 | elif ctx.bop and ctx.bop.type == JavaParser.DOT: 185 | left = self.visit(ctx.getChild(0)) 186 | right_ctx = ctx.getChild(2) 187 | right = self.visit(right_ctx) 188 | expr = f"{left}.{right}" 189 | if isinstance(right_ctx, JavaParser.MethodCallContext): 190 | # TODO: avoid string manipulation 191 | method, rest = right.split("(", 1) 192 | method_fq = f"{left}.{method}" 193 | py_method = self._dispatch(method_fq) 194 | return f"{py_method}({rest}" 195 | return expr 196 | return super().visitExpression(ctx) 197 | 198 | def visitStatement(self, ctx: JavaParser.StatementContext): 199 | if ctx.RETURN(): 200 | value = self.visit(ctx.expression(0)) 201 | return f"return {value}" 202 | return super().visitStatement(ctx) 203 | 204 | def visitBlock(self, ctx: JavaParser.BlockContext): 205 | # minus 2 because of the terminals {, } 206 | stmts = [ctx.blockStatement(i) for i in range(ctx.getChildCount() - 2)] 207 | return "\n".join([self.visit(s) for s in stmts]) 208 | 209 | def visitLocalVariableDeclaration( 210 | self, ctx: JavaParser.LocalVariableDeclarationContext 211 | ): 212 | decls = ctx.variableDeclarators() 213 | return " ".join( 214 | [ 215 | self.visit(decls.variableDeclarator(i)) 216 | for i in range(decls.getChildCount()) 217 | ] 218 | ) 219 | 220 | def visitVariableDeclarator(self, ctx: JavaParser.VariableDeclaratorContext): 221 | return " ".join([self.visit(c) for c in ctx.getChildren()]) 222 | 223 | def visitBlockStatement(self, ctx: JavaParser.BlockStatementContext): 224 | children = list(ctx.getChildren()) 225 | if children[-1] == ctx.SEMI(): 226 | children = children[:-1] 227 | return " ".join([self.visit(c) for c in children]) 228 | -------------------------------------------------------------------------------- /decaf2many/lang/JavaParser.g4: -------------------------------------------------------------------------------- 1 | /* 2 | [The "BSD licence"] 3 | Copyright (c) 2013 Terence Parr, Sam Harwell 4 | Copyright (c) 2017 Ivan Kochurkin (upgrade to Java 8) 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions 9 | are met: 10 | 1. Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 3. The name of the author may not be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 19 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | parser grammar JavaParser; 31 | 32 | options { tokenVocab=JavaLexer; } 33 | 34 | compilationUnit 35 | : packageDeclaration? importDeclaration* typeDeclaration* EOF 36 | ; 37 | 38 | packageDeclaration 39 | : annotation* PACKAGE qualifiedName ';' 40 | ; 41 | 42 | importDeclaration 43 | : IMPORT STATIC? qualifiedName ('.' '*')? ';' 44 | ; 45 | 46 | typeDeclaration 47 | : classOrInterfaceModifier* 48 | (classDeclaration | enumDeclaration | interfaceDeclaration | annotationTypeDeclaration) 49 | | ';' 50 | ; 51 | 52 | modifier 53 | : classOrInterfaceModifier 54 | | NATIVE 55 | | SYNCHRONIZED 56 | | TRANSIENT 57 | | VOLATILE 58 | ; 59 | 60 | classOrInterfaceModifier 61 | : annotation 62 | | PUBLIC 63 | | PROTECTED 64 | | PRIVATE 65 | | STATIC 66 | | ABSTRACT 67 | | FINAL // FINAL for class only -- does not apply to interfaces 68 | | STRICTFP 69 | ; 70 | 71 | variableModifier 72 | : FINAL 73 | | annotation 74 | ; 75 | 76 | classDeclaration 77 | : CLASS IDENTIFIER typeParameters? 78 | (EXTENDS typeType)? 79 | (IMPLEMENTS typeList)? 80 | classBody 81 | ; 82 | 83 | typeParameters 84 | : '<' typeParameter (',' typeParameter)* '>' 85 | ; 86 | 87 | typeParameter 88 | : annotation* IDENTIFIER (EXTENDS annotation* typeBound)? 89 | ; 90 | 91 | typeBound 92 | : typeType ('&' typeType)* 93 | ; 94 | 95 | enumDeclaration 96 | : ENUM IDENTIFIER (IMPLEMENTS typeList)? '{' enumConstants? ','? enumBodyDeclarations? '}' 97 | ; 98 | 99 | enumConstants 100 | : enumConstant (',' enumConstant)* 101 | ; 102 | 103 | enumConstant 104 | : annotation* IDENTIFIER arguments? classBody? 105 | ; 106 | 107 | enumBodyDeclarations 108 | : ';' classBodyDeclaration* 109 | ; 110 | 111 | interfaceDeclaration 112 | : INTERFACE IDENTIFIER typeParameters? (EXTENDS typeList)? interfaceBody 113 | ; 114 | 115 | classBody 116 | : '{' classBodyDeclaration* '}' 117 | ; 118 | 119 | interfaceBody 120 | : '{' interfaceBodyDeclaration* '}' 121 | ; 122 | 123 | classBodyDeclaration 124 | : ';' 125 | | STATIC? block 126 | | modifier* memberDeclaration 127 | ; 128 | 129 | memberDeclaration 130 | : methodDeclaration 131 | | genericMethodDeclaration 132 | | fieldDeclaration 133 | | constructorDeclaration 134 | | genericConstructorDeclaration 135 | | interfaceDeclaration 136 | | annotationTypeDeclaration 137 | | classDeclaration 138 | | enumDeclaration 139 | ; 140 | 141 | /* We use rule this even for void methods which cannot have [] after parameters. 142 | This simplifies grammar and we can consider void to be a type, which 143 | renders the [] matching as a context-sensitive issue or a semantic check 144 | for invalid return type after parsing. 145 | */ 146 | methodDeclaration 147 | : typeTypeOrVoid IDENTIFIER formalParameters ('[' ']')* 148 | (THROWS qualifiedNameList)? 149 | methodBody 150 | ; 151 | 152 | methodBody 153 | : block 154 | | ';' 155 | ; 156 | 157 | typeTypeOrVoid 158 | : typeType 159 | | VOID 160 | ; 161 | 162 | genericMethodDeclaration 163 | : typeParameters methodDeclaration 164 | ; 165 | 166 | genericConstructorDeclaration 167 | : typeParameters constructorDeclaration 168 | ; 169 | 170 | constructorDeclaration 171 | : IDENTIFIER formalParameters (THROWS qualifiedNameList)? constructorBody=block 172 | ; 173 | 174 | fieldDeclaration 175 | : typeType variableDeclarators ';' 176 | ; 177 | 178 | interfaceBodyDeclaration 179 | : modifier* interfaceMemberDeclaration 180 | | ';' 181 | ; 182 | 183 | interfaceMemberDeclaration 184 | : constDeclaration 185 | | interfaceMethodDeclaration 186 | | genericInterfaceMethodDeclaration 187 | | interfaceDeclaration 188 | | annotationTypeDeclaration 189 | | classDeclaration 190 | | enumDeclaration 191 | ; 192 | 193 | constDeclaration 194 | : typeType constantDeclarator (',' constantDeclarator)* ';' 195 | ; 196 | 197 | constantDeclarator 198 | : IDENTIFIER ('[' ']')* '=' variableInitializer 199 | ; 200 | 201 | // Early versions of Java allows brackets after the method name, eg. 202 | // public int[] return2DArray() [] { ... } 203 | // is the same as 204 | // public int[][] return2DArray() { ... } 205 | interfaceMethodDeclaration 206 | : interfaceMethodModifier* (typeTypeOrVoid | typeParameters annotation* typeTypeOrVoid) 207 | IDENTIFIER formalParameters ('[' ']')* (THROWS qualifiedNameList)? methodBody 208 | ; 209 | 210 | // Java8 211 | interfaceMethodModifier 212 | : annotation 213 | | PUBLIC 214 | | ABSTRACT 215 | | DEFAULT 216 | | STATIC 217 | | STRICTFP 218 | ; 219 | 220 | genericInterfaceMethodDeclaration 221 | : typeParameters interfaceMethodDeclaration 222 | ; 223 | 224 | variableDeclarators 225 | : variableDeclarator (',' variableDeclarator)* 226 | ; 227 | 228 | variableDeclarator 229 | : variableDeclaratorId ('=' variableInitializer)? 230 | ; 231 | 232 | variableDeclaratorId 233 | : IDENTIFIER ('[' ']')* 234 | ; 235 | 236 | variableInitializer 237 | : arrayInitializer 238 | | expression 239 | ; 240 | 241 | arrayInitializer 242 | : '{' (variableInitializer (',' variableInitializer)* (',')? )? '}' 243 | ; 244 | 245 | classOrInterfaceType 246 | : IDENTIFIER typeArguments? ('.' IDENTIFIER typeArguments?)* 247 | ; 248 | 249 | typeArgument 250 | : typeType 251 | | annotation* '?' ((EXTENDS | SUPER) typeType)? 252 | ; 253 | 254 | qualifiedNameList 255 | : qualifiedName (',' qualifiedName)* 256 | ; 257 | 258 | formalParameters 259 | : '(' formalParameterList? ')' 260 | ; 261 | 262 | formalParameterList 263 | : formalParameter (',' formalParameter)* (',' lastFormalParameter)? 264 | | lastFormalParameter 265 | ; 266 | 267 | formalParameter 268 | : variableModifier* typeType variableDeclaratorId 269 | ; 270 | 271 | lastFormalParameter 272 | : variableModifier* typeType annotation* '...' variableDeclaratorId 273 | ; 274 | 275 | qualifiedName 276 | : IDENTIFIER ('.' IDENTIFIER)* 277 | ; 278 | 279 | literal 280 | : integerLiteral 281 | | floatLiteral 282 | | CHAR_LITERAL 283 | | STRING_LITERAL 284 | | BOOL_LITERAL 285 | | NULL_LITERAL 286 | ; 287 | 288 | integerLiteral 289 | : DECIMAL_LITERAL 290 | | HEX_LITERAL 291 | | OCT_LITERAL 292 | | BINARY_LITERAL 293 | ; 294 | 295 | floatLiteral 296 | : FLOAT_LITERAL 297 | | HEX_FLOAT_LITERAL 298 | ; 299 | 300 | // ANNOTATIONS 301 | altAnnotationQualifiedName 302 | : (IDENTIFIER DOT)* '@' IDENTIFIER 303 | ; 304 | 305 | annotation 306 | : ('@' qualifiedName | altAnnotationQualifiedName) ('(' ( elementValuePairs | elementValue )? ')')? 307 | ; 308 | 309 | elementValuePairs 310 | : elementValuePair (',' elementValuePair)* 311 | ; 312 | 313 | elementValuePair 314 | : IDENTIFIER '=' elementValue 315 | ; 316 | 317 | elementValue 318 | : expression 319 | | annotation 320 | | elementValueArrayInitializer 321 | ; 322 | 323 | elementValueArrayInitializer 324 | : '{' (elementValue (',' elementValue)*)? (',')? '}' 325 | ; 326 | 327 | annotationTypeDeclaration 328 | : '@' INTERFACE IDENTIFIER annotationTypeBody 329 | ; 330 | 331 | annotationTypeBody 332 | : '{' (annotationTypeElementDeclaration)* '}' 333 | ; 334 | 335 | annotationTypeElementDeclaration 336 | : modifier* annotationTypeElementRest 337 | | ';' // this is not allowed by the grammar, but apparently allowed by the actual compiler 338 | ; 339 | 340 | annotationTypeElementRest 341 | : typeType annotationMethodOrConstantRest ';' 342 | | classDeclaration ';'? 343 | | interfaceDeclaration ';'? 344 | | enumDeclaration ';'? 345 | | annotationTypeDeclaration ';'? 346 | ; 347 | 348 | annotationMethodOrConstantRest 349 | : annotationMethodRest 350 | | annotationConstantRest 351 | ; 352 | 353 | annotationMethodRest 354 | : IDENTIFIER '(' ')' defaultValue? 355 | ; 356 | 357 | annotationConstantRest 358 | : variableDeclarators 359 | ; 360 | 361 | defaultValue 362 | : DEFAULT elementValue 363 | ; 364 | 365 | // STATEMENTS / BLOCKS 366 | 367 | block 368 | : '{' blockStatement* '}' 369 | ; 370 | 371 | blockStatement 372 | : localVariableDeclaration ';' 373 | | statement 374 | | localTypeDeclaration 375 | ; 376 | 377 | localVariableDeclaration 378 | : variableModifier* typeType variableDeclarators 379 | ; 380 | 381 | localTypeDeclaration 382 | : classOrInterfaceModifier* 383 | (classDeclaration | interfaceDeclaration) 384 | | ';' 385 | ; 386 | 387 | statement 388 | : blockLabel=block 389 | | ASSERT expression (':' expression)? ';' 390 | | IF parExpression statement (ELSE statement)? 391 | | FOR '(' forControl ')' statement 392 | | WHILE parExpression statement 393 | | DO statement WHILE parExpression ';' 394 | | TRY block (catchClause+ finallyBlock? | finallyBlock) 395 | | TRY resourceSpecification block catchClause* finallyBlock? 396 | | SWITCH parExpression '{' switchBlockStatementGroup* switchLabel* '}' 397 | | SYNCHRONIZED parExpression block 398 | | RETURN expression? ';' 399 | | THROW expression ';' 400 | | BREAK IDENTIFIER? ';' 401 | | CONTINUE IDENTIFIER? ';' 402 | | SEMI 403 | | statementExpression=expression ';' 404 | | identifierLabel=IDENTIFIER ':' statement 405 | ; 406 | 407 | catchClause 408 | : CATCH '(' variableModifier* catchType IDENTIFIER ')' block 409 | ; 410 | 411 | catchType 412 | : qualifiedName ('|' qualifiedName)* 413 | ; 414 | 415 | finallyBlock 416 | : FINALLY block 417 | ; 418 | 419 | resourceSpecification 420 | : '(' resources ';'? ')' 421 | ; 422 | 423 | resources 424 | : resource (';' resource)* 425 | ; 426 | 427 | resource 428 | : variableModifier* classOrInterfaceType variableDeclaratorId '=' expression 429 | ; 430 | 431 | /** Matches cases then statements, both of which are mandatory. 432 | * To handle empty cases at the end, we add switchLabel* to statement. 433 | */ 434 | switchBlockStatementGroup 435 | : switchLabel+ blockStatement+ 436 | ; 437 | 438 | switchLabel 439 | : CASE (constantExpression=expression | enumConstantName=IDENTIFIER) ':' 440 | | DEFAULT ':' 441 | ; 442 | 443 | forControl 444 | : enhancedForControl 445 | | forInit? ';' expression? ';' forUpdate=expressionList? 446 | ; 447 | 448 | forInit 449 | : localVariableDeclaration 450 | | expressionList 451 | ; 452 | 453 | enhancedForControl 454 | : variableModifier* typeType variableDeclaratorId ':' expression 455 | ; 456 | 457 | // EXPRESSIONS 458 | 459 | parExpression 460 | : '(' expression ')' 461 | ; 462 | 463 | expressionList 464 | : expression (',' expression)* 465 | ; 466 | 467 | methodCall 468 | : IDENTIFIER '(' expressionList? ')' 469 | | THIS '(' expressionList? ')' 470 | | SUPER '(' expressionList? ')' 471 | ; 472 | 473 | expression 474 | : primary 475 | | expression bop='.' 476 | ( IDENTIFIER 477 | | methodCall 478 | | THIS 479 | | NEW nonWildcardTypeArguments? innerCreator 480 | | SUPER superSuffix 481 | | explicitGenericInvocation 482 | ) 483 | | expression '[' expression ']' 484 | | methodCall 485 | | NEW creator 486 | | '(' annotation* typeType ('&' typeType)* ')' expression 487 | | expression postfix=('++' | '--') 488 | | prefix=('+'|'-'|'++'|'--') expression 489 | | prefix=('~'|'!') expression 490 | | expression bop=('*'|'/'|'%') expression 491 | | expression bop=('+'|'-') expression 492 | | expression ('<' '<' | '>' '>' '>' | '>' '>') expression 493 | | expression bop=('<=' | '>=' | '>' | '<') expression 494 | | expression bop=INSTANCEOF typeType 495 | | expression bop=('==' | '!=') expression 496 | | expression bop='&' expression 497 | | expression bop='^' expression 498 | | expression bop='|' expression 499 | | expression bop='&&' expression 500 | | expression bop='||' expression 501 | | expression bop='?' expression ':' expression 502 | | expression 503 | bop=('=' | '+=' | '-=' | '*=' | '/=' | '&=' | '|=' | '^=' | '>>=' | '>>>=' | '<<=' | '%=') 504 | expression 505 | | lambdaExpression // Java8 506 | 507 | // Java 8 methodReference 508 | | expression '::' typeArguments? IDENTIFIER 509 | | typeType '::' (typeArguments? IDENTIFIER | NEW) 510 | | classType '::' typeArguments? NEW 511 | ; 512 | 513 | // Java8 514 | lambdaExpression 515 | : lambdaParameters '->' lambdaBody 516 | ; 517 | 518 | // Java8 519 | lambdaParameters 520 | : IDENTIFIER 521 | | '(' formalParameterList? ')' 522 | | '(' IDENTIFIER (',' IDENTIFIER)* ')' 523 | ; 524 | 525 | // Java8 526 | lambdaBody 527 | : expression 528 | | block 529 | ; 530 | 531 | primary 532 | : '(' expression ')' 533 | | THIS 534 | | SUPER 535 | | literal 536 | | IDENTIFIER 537 | | typeTypeOrVoid '.' CLASS 538 | | nonWildcardTypeArguments (explicitGenericInvocationSuffix | THIS arguments) 539 | ; 540 | 541 | classType 542 | : (classOrInterfaceType '.')? annotation* IDENTIFIER typeArguments? 543 | ; 544 | 545 | creator 546 | : nonWildcardTypeArguments createdName classCreatorRest 547 | | createdName (arrayCreatorRest | classCreatorRest) 548 | ; 549 | 550 | createdName 551 | : IDENTIFIER typeArgumentsOrDiamond? ('.' IDENTIFIER typeArgumentsOrDiamond?)* 552 | | primitiveType 553 | ; 554 | 555 | innerCreator 556 | : IDENTIFIER nonWildcardTypeArgumentsOrDiamond? classCreatorRest 557 | ; 558 | 559 | arrayCreatorRest 560 | : '[' (']' ('[' ']')* arrayInitializer | expression ']' ('[' expression ']')* ('[' ']')*) 561 | ; 562 | 563 | classCreatorRest 564 | : arguments classBody? 565 | ; 566 | 567 | explicitGenericInvocation 568 | : nonWildcardTypeArguments explicitGenericInvocationSuffix 569 | ; 570 | 571 | typeArgumentsOrDiamond 572 | : '<' '>' 573 | | typeArguments 574 | ; 575 | 576 | nonWildcardTypeArgumentsOrDiamond 577 | : '<' '>' 578 | | nonWildcardTypeArguments 579 | ; 580 | 581 | nonWildcardTypeArguments 582 | : '<' typeList '>' 583 | ; 584 | 585 | typeList 586 | : typeType (',' typeType)* 587 | ; 588 | 589 | typeType 590 | : annotation* (classOrInterfaceType | primitiveType) (annotation* '[' ']')* 591 | ; 592 | 593 | primitiveType 594 | : BOOLEAN 595 | | CHAR 596 | | BYTE 597 | | SHORT 598 | | INT 599 | | LONG 600 | | FLOAT 601 | | DOUBLE 602 | ; 603 | 604 | typeArguments 605 | : '<' typeArgument (',' typeArgument)* '>' 606 | ; 607 | 608 | superSuffix 609 | : arguments 610 | | '.' IDENTIFIER arguments? 611 | ; 612 | 613 | explicitGenericInvocationSuffix 614 | : SUPER superSuffix 615 | | IDENTIFIER arguments 616 | ; 617 | 618 | arguments 619 | : '(' expressionList? ')' 620 | ; 621 | -------------------------------------------------------------------------------- /decaf2many/lang/JavaParserVisitor.py: -------------------------------------------------------------------------------- 1 | # Generated from JavaParser.g4 by ANTLR 4.7.2 2 | from antlr4 import * 3 | if __name__ is not None and "." in __name__: 4 | from .JavaParser import JavaParser 5 | else: 6 | from JavaParser import JavaParser 7 | 8 | # This class defines a complete generic visitor for a parse tree produced by JavaParser. 9 | 10 | class JavaParserVisitor(ParseTreeVisitor): 11 | 12 | # Visit a parse tree produced by JavaParser#compilationUnit. 13 | def visitCompilationUnit(self, ctx:JavaParser.CompilationUnitContext): 14 | return self.visitChildren(ctx) 15 | 16 | 17 | # Visit a parse tree produced by JavaParser#packageDeclaration. 18 | def visitPackageDeclaration(self, ctx:JavaParser.PackageDeclarationContext): 19 | return self.visitChildren(ctx) 20 | 21 | 22 | # Visit a parse tree produced by JavaParser#importDeclaration. 23 | def visitImportDeclaration(self, ctx:JavaParser.ImportDeclarationContext): 24 | return self.visitChildren(ctx) 25 | 26 | 27 | # Visit a parse tree produced by JavaParser#typeDeclaration. 28 | def visitTypeDeclaration(self, ctx:JavaParser.TypeDeclarationContext): 29 | return self.visitChildren(ctx) 30 | 31 | 32 | # Visit a parse tree produced by JavaParser#modifier. 33 | def visitModifier(self, ctx:JavaParser.ModifierContext): 34 | return self.visitChildren(ctx) 35 | 36 | 37 | # Visit a parse tree produced by JavaParser#classOrInterfaceModifier. 38 | def visitClassOrInterfaceModifier(self, ctx:JavaParser.ClassOrInterfaceModifierContext): 39 | return self.visitChildren(ctx) 40 | 41 | 42 | # Visit a parse tree produced by JavaParser#variableModifier. 43 | def visitVariableModifier(self, ctx:JavaParser.VariableModifierContext): 44 | return self.visitChildren(ctx) 45 | 46 | 47 | # Visit a parse tree produced by JavaParser#classDeclaration. 48 | def visitClassDeclaration(self, ctx:JavaParser.ClassDeclarationContext): 49 | return self.visitChildren(ctx) 50 | 51 | 52 | # Visit a parse tree produced by JavaParser#typeParameters. 53 | def visitTypeParameters(self, ctx:JavaParser.TypeParametersContext): 54 | return self.visitChildren(ctx) 55 | 56 | 57 | # Visit a parse tree produced by JavaParser#typeParameter. 58 | def visitTypeParameter(self, ctx:JavaParser.TypeParameterContext): 59 | return self.visitChildren(ctx) 60 | 61 | 62 | # Visit a parse tree produced by JavaParser#typeBound. 63 | def visitTypeBound(self, ctx:JavaParser.TypeBoundContext): 64 | return self.visitChildren(ctx) 65 | 66 | 67 | # Visit a parse tree produced by JavaParser#enumDeclaration. 68 | def visitEnumDeclaration(self, ctx:JavaParser.EnumDeclarationContext): 69 | return self.visitChildren(ctx) 70 | 71 | 72 | # Visit a parse tree produced by JavaParser#enumConstants. 73 | def visitEnumConstants(self, ctx:JavaParser.EnumConstantsContext): 74 | return self.visitChildren(ctx) 75 | 76 | 77 | # Visit a parse tree produced by JavaParser#enumConstant. 78 | def visitEnumConstant(self, ctx:JavaParser.EnumConstantContext): 79 | return self.visitChildren(ctx) 80 | 81 | 82 | # Visit a parse tree produced by JavaParser#enumBodyDeclarations. 83 | def visitEnumBodyDeclarations(self, ctx:JavaParser.EnumBodyDeclarationsContext): 84 | return self.visitChildren(ctx) 85 | 86 | 87 | # Visit a parse tree produced by JavaParser#interfaceDeclaration. 88 | def visitInterfaceDeclaration(self, ctx:JavaParser.InterfaceDeclarationContext): 89 | return self.visitChildren(ctx) 90 | 91 | 92 | # Visit a parse tree produced by JavaParser#classBody. 93 | def visitClassBody(self, ctx:JavaParser.ClassBodyContext): 94 | return self.visitChildren(ctx) 95 | 96 | 97 | # Visit a parse tree produced by JavaParser#interfaceBody. 98 | def visitInterfaceBody(self, ctx:JavaParser.InterfaceBodyContext): 99 | return self.visitChildren(ctx) 100 | 101 | 102 | # Visit a parse tree produced by JavaParser#classBodyDeclaration. 103 | def visitClassBodyDeclaration(self, ctx:JavaParser.ClassBodyDeclarationContext): 104 | return self.visitChildren(ctx) 105 | 106 | 107 | # Visit a parse tree produced by JavaParser#memberDeclaration. 108 | def visitMemberDeclaration(self, ctx:JavaParser.MemberDeclarationContext): 109 | return self.visitChildren(ctx) 110 | 111 | 112 | # Visit a parse tree produced by JavaParser#methodDeclaration. 113 | def visitMethodDeclaration(self, ctx:JavaParser.MethodDeclarationContext): 114 | return self.visitChildren(ctx) 115 | 116 | 117 | # Visit a parse tree produced by JavaParser#methodBody. 118 | def visitMethodBody(self, ctx:JavaParser.MethodBodyContext): 119 | return self.visitChildren(ctx) 120 | 121 | 122 | # Visit a parse tree produced by JavaParser#typeTypeOrVoid. 123 | def visitTypeTypeOrVoid(self, ctx:JavaParser.TypeTypeOrVoidContext): 124 | return self.visitChildren(ctx) 125 | 126 | 127 | # Visit a parse tree produced by JavaParser#genericMethodDeclaration. 128 | def visitGenericMethodDeclaration(self, ctx:JavaParser.GenericMethodDeclarationContext): 129 | return self.visitChildren(ctx) 130 | 131 | 132 | # Visit a parse tree produced by JavaParser#genericConstructorDeclaration. 133 | def visitGenericConstructorDeclaration(self, ctx:JavaParser.GenericConstructorDeclarationContext): 134 | return self.visitChildren(ctx) 135 | 136 | 137 | # Visit a parse tree produced by JavaParser#constructorDeclaration. 138 | def visitConstructorDeclaration(self, ctx:JavaParser.ConstructorDeclarationContext): 139 | return self.visitChildren(ctx) 140 | 141 | 142 | # Visit a parse tree produced by JavaParser#fieldDeclaration. 143 | def visitFieldDeclaration(self, ctx:JavaParser.FieldDeclarationContext): 144 | return self.visitChildren(ctx) 145 | 146 | 147 | # Visit a parse tree produced by JavaParser#interfaceBodyDeclaration. 148 | def visitInterfaceBodyDeclaration(self, ctx:JavaParser.InterfaceBodyDeclarationContext): 149 | return self.visitChildren(ctx) 150 | 151 | 152 | # Visit a parse tree produced by JavaParser#interfaceMemberDeclaration. 153 | def visitInterfaceMemberDeclaration(self, ctx:JavaParser.InterfaceMemberDeclarationContext): 154 | return self.visitChildren(ctx) 155 | 156 | 157 | # Visit a parse tree produced by JavaParser#constDeclaration. 158 | def visitConstDeclaration(self, ctx:JavaParser.ConstDeclarationContext): 159 | return self.visitChildren(ctx) 160 | 161 | 162 | # Visit a parse tree produced by JavaParser#constantDeclarator. 163 | def visitConstantDeclarator(self, ctx:JavaParser.ConstantDeclaratorContext): 164 | return self.visitChildren(ctx) 165 | 166 | 167 | # Visit a parse tree produced by JavaParser#interfaceMethodDeclaration. 168 | def visitInterfaceMethodDeclaration(self, ctx:JavaParser.InterfaceMethodDeclarationContext): 169 | return self.visitChildren(ctx) 170 | 171 | 172 | # Visit a parse tree produced by JavaParser#interfaceMethodModifier. 173 | def visitInterfaceMethodModifier(self, ctx:JavaParser.InterfaceMethodModifierContext): 174 | return self.visitChildren(ctx) 175 | 176 | 177 | # Visit a parse tree produced by JavaParser#genericInterfaceMethodDeclaration. 178 | def visitGenericInterfaceMethodDeclaration(self, ctx:JavaParser.GenericInterfaceMethodDeclarationContext): 179 | return self.visitChildren(ctx) 180 | 181 | 182 | # Visit a parse tree produced by JavaParser#variableDeclarators. 183 | def visitVariableDeclarators(self, ctx:JavaParser.VariableDeclaratorsContext): 184 | return self.visitChildren(ctx) 185 | 186 | 187 | # Visit a parse tree produced by JavaParser#variableDeclarator. 188 | def visitVariableDeclarator(self, ctx:JavaParser.VariableDeclaratorContext): 189 | return self.visitChildren(ctx) 190 | 191 | 192 | # Visit a parse tree produced by JavaParser#variableDeclaratorId. 193 | def visitVariableDeclaratorId(self, ctx:JavaParser.VariableDeclaratorIdContext): 194 | return self.visitChildren(ctx) 195 | 196 | 197 | # Visit a parse tree produced by JavaParser#variableInitializer. 198 | def visitVariableInitializer(self, ctx:JavaParser.VariableInitializerContext): 199 | return self.visitChildren(ctx) 200 | 201 | 202 | # Visit a parse tree produced by JavaParser#arrayInitializer. 203 | def visitArrayInitializer(self, ctx:JavaParser.ArrayInitializerContext): 204 | return self.visitChildren(ctx) 205 | 206 | 207 | # Visit a parse tree produced by JavaParser#classOrInterfaceType. 208 | def visitClassOrInterfaceType(self, ctx:JavaParser.ClassOrInterfaceTypeContext): 209 | return self.visitChildren(ctx) 210 | 211 | 212 | # Visit a parse tree produced by JavaParser#typeArgument. 213 | def visitTypeArgument(self, ctx:JavaParser.TypeArgumentContext): 214 | return self.visitChildren(ctx) 215 | 216 | 217 | # Visit a parse tree produced by JavaParser#qualifiedNameList. 218 | def visitQualifiedNameList(self, ctx:JavaParser.QualifiedNameListContext): 219 | return self.visitChildren(ctx) 220 | 221 | 222 | # Visit a parse tree produced by JavaParser#formalParameters. 223 | def visitFormalParameters(self, ctx:JavaParser.FormalParametersContext): 224 | return self.visitChildren(ctx) 225 | 226 | 227 | # Visit a parse tree produced by JavaParser#formalParameterList. 228 | def visitFormalParameterList(self, ctx:JavaParser.FormalParameterListContext): 229 | return self.visitChildren(ctx) 230 | 231 | 232 | # Visit a parse tree produced by JavaParser#formalParameter. 233 | def visitFormalParameter(self, ctx:JavaParser.FormalParameterContext): 234 | return self.visitChildren(ctx) 235 | 236 | 237 | # Visit a parse tree produced by JavaParser#lastFormalParameter. 238 | def visitLastFormalParameter(self, ctx:JavaParser.LastFormalParameterContext): 239 | return self.visitChildren(ctx) 240 | 241 | 242 | # Visit a parse tree produced by JavaParser#qualifiedName. 243 | def visitQualifiedName(self, ctx:JavaParser.QualifiedNameContext): 244 | return self.visitChildren(ctx) 245 | 246 | 247 | # Visit a parse tree produced by JavaParser#literal. 248 | def visitLiteral(self, ctx:JavaParser.LiteralContext): 249 | return self.visitChildren(ctx) 250 | 251 | 252 | # Visit a parse tree produced by JavaParser#integerLiteral. 253 | def visitIntegerLiteral(self, ctx:JavaParser.IntegerLiteralContext): 254 | return self.visitChildren(ctx) 255 | 256 | 257 | # Visit a parse tree produced by JavaParser#floatLiteral. 258 | def visitFloatLiteral(self, ctx:JavaParser.FloatLiteralContext): 259 | return self.visitChildren(ctx) 260 | 261 | 262 | # Visit a parse tree produced by JavaParser#altAnnotationQualifiedName. 263 | def visitAltAnnotationQualifiedName(self, ctx:JavaParser.AltAnnotationQualifiedNameContext): 264 | return self.visitChildren(ctx) 265 | 266 | 267 | # Visit a parse tree produced by JavaParser#annotation. 268 | def visitAnnotation(self, ctx:JavaParser.AnnotationContext): 269 | return self.visitChildren(ctx) 270 | 271 | 272 | # Visit a parse tree produced by JavaParser#elementValuePairs. 273 | def visitElementValuePairs(self, ctx:JavaParser.ElementValuePairsContext): 274 | return self.visitChildren(ctx) 275 | 276 | 277 | # Visit a parse tree produced by JavaParser#elementValuePair. 278 | def visitElementValuePair(self, ctx:JavaParser.ElementValuePairContext): 279 | return self.visitChildren(ctx) 280 | 281 | 282 | # Visit a parse tree produced by JavaParser#elementValue. 283 | def visitElementValue(self, ctx:JavaParser.ElementValueContext): 284 | return self.visitChildren(ctx) 285 | 286 | 287 | # Visit a parse tree produced by JavaParser#elementValueArrayInitializer. 288 | def visitElementValueArrayInitializer(self, ctx:JavaParser.ElementValueArrayInitializerContext): 289 | return self.visitChildren(ctx) 290 | 291 | 292 | # Visit a parse tree produced by JavaParser#annotationTypeDeclaration. 293 | def visitAnnotationTypeDeclaration(self, ctx:JavaParser.AnnotationTypeDeclarationContext): 294 | return self.visitChildren(ctx) 295 | 296 | 297 | # Visit a parse tree produced by JavaParser#annotationTypeBody. 298 | def visitAnnotationTypeBody(self, ctx:JavaParser.AnnotationTypeBodyContext): 299 | return self.visitChildren(ctx) 300 | 301 | 302 | # Visit a parse tree produced by JavaParser#annotationTypeElementDeclaration. 303 | def visitAnnotationTypeElementDeclaration(self, ctx:JavaParser.AnnotationTypeElementDeclarationContext): 304 | return self.visitChildren(ctx) 305 | 306 | 307 | # Visit a parse tree produced by JavaParser#annotationTypeElementRest. 308 | def visitAnnotationTypeElementRest(self, ctx:JavaParser.AnnotationTypeElementRestContext): 309 | return self.visitChildren(ctx) 310 | 311 | 312 | # Visit a parse tree produced by JavaParser#annotationMethodOrConstantRest. 313 | def visitAnnotationMethodOrConstantRest(self, ctx:JavaParser.AnnotationMethodOrConstantRestContext): 314 | return self.visitChildren(ctx) 315 | 316 | 317 | # Visit a parse tree produced by JavaParser#annotationMethodRest. 318 | def visitAnnotationMethodRest(self, ctx:JavaParser.AnnotationMethodRestContext): 319 | return self.visitChildren(ctx) 320 | 321 | 322 | # Visit a parse tree produced by JavaParser#annotationConstantRest. 323 | def visitAnnotationConstantRest(self, ctx:JavaParser.AnnotationConstantRestContext): 324 | return self.visitChildren(ctx) 325 | 326 | 327 | # Visit a parse tree produced by JavaParser#defaultValue. 328 | def visitDefaultValue(self, ctx:JavaParser.DefaultValueContext): 329 | return self.visitChildren(ctx) 330 | 331 | 332 | # Visit a parse tree produced by JavaParser#block. 333 | def visitBlock(self, ctx:JavaParser.BlockContext): 334 | return self.visitChildren(ctx) 335 | 336 | 337 | # Visit a parse tree produced by JavaParser#blockStatement. 338 | def visitBlockStatement(self, ctx:JavaParser.BlockStatementContext): 339 | return self.visitChildren(ctx) 340 | 341 | 342 | # Visit a parse tree produced by JavaParser#localVariableDeclaration. 343 | def visitLocalVariableDeclaration(self, ctx:JavaParser.LocalVariableDeclarationContext): 344 | return self.visitChildren(ctx) 345 | 346 | 347 | # Visit a parse tree produced by JavaParser#localTypeDeclaration. 348 | def visitLocalTypeDeclaration(self, ctx:JavaParser.LocalTypeDeclarationContext): 349 | return self.visitChildren(ctx) 350 | 351 | 352 | # Visit a parse tree produced by JavaParser#statement. 353 | def visitStatement(self, ctx:JavaParser.StatementContext): 354 | return self.visitChildren(ctx) 355 | 356 | 357 | # Visit a parse tree produced by JavaParser#catchClause. 358 | def visitCatchClause(self, ctx:JavaParser.CatchClauseContext): 359 | return self.visitChildren(ctx) 360 | 361 | 362 | # Visit a parse tree produced by JavaParser#catchType. 363 | def visitCatchType(self, ctx:JavaParser.CatchTypeContext): 364 | return self.visitChildren(ctx) 365 | 366 | 367 | # Visit a parse tree produced by JavaParser#finallyBlock. 368 | def visitFinallyBlock(self, ctx:JavaParser.FinallyBlockContext): 369 | return self.visitChildren(ctx) 370 | 371 | 372 | # Visit a parse tree produced by JavaParser#resourceSpecification. 373 | def visitResourceSpecification(self, ctx:JavaParser.ResourceSpecificationContext): 374 | return self.visitChildren(ctx) 375 | 376 | 377 | # Visit a parse tree produced by JavaParser#resources. 378 | def visitResources(self, ctx:JavaParser.ResourcesContext): 379 | return self.visitChildren(ctx) 380 | 381 | 382 | # Visit a parse tree produced by JavaParser#resource. 383 | def visitResource(self, ctx:JavaParser.ResourceContext): 384 | return self.visitChildren(ctx) 385 | 386 | 387 | # Visit a parse tree produced by JavaParser#switchBlockStatementGroup. 388 | def visitSwitchBlockStatementGroup(self, ctx:JavaParser.SwitchBlockStatementGroupContext): 389 | return self.visitChildren(ctx) 390 | 391 | 392 | # Visit a parse tree produced by JavaParser#switchLabel. 393 | def visitSwitchLabel(self, ctx:JavaParser.SwitchLabelContext): 394 | return self.visitChildren(ctx) 395 | 396 | 397 | # Visit a parse tree produced by JavaParser#forControl. 398 | def visitForControl(self, ctx:JavaParser.ForControlContext): 399 | return self.visitChildren(ctx) 400 | 401 | 402 | # Visit a parse tree produced by JavaParser#forInit. 403 | def visitForInit(self, ctx:JavaParser.ForInitContext): 404 | return self.visitChildren(ctx) 405 | 406 | 407 | # Visit a parse tree produced by JavaParser#enhancedForControl. 408 | def visitEnhancedForControl(self, ctx:JavaParser.EnhancedForControlContext): 409 | return self.visitChildren(ctx) 410 | 411 | 412 | # Visit a parse tree produced by JavaParser#parExpression. 413 | def visitParExpression(self, ctx:JavaParser.ParExpressionContext): 414 | return self.visitChildren(ctx) 415 | 416 | 417 | # Visit a parse tree produced by JavaParser#expressionList. 418 | def visitExpressionList(self, ctx:JavaParser.ExpressionListContext): 419 | return self.visitChildren(ctx) 420 | 421 | 422 | # Visit a parse tree produced by JavaParser#methodCall. 423 | def visitMethodCall(self, ctx:JavaParser.MethodCallContext): 424 | return self.visitChildren(ctx) 425 | 426 | 427 | # Visit a parse tree produced by JavaParser#expression. 428 | def visitExpression(self, ctx:JavaParser.ExpressionContext): 429 | return self.visitChildren(ctx) 430 | 431 | 432 | # Visit a parse tree produced by JavaParser#lambdaExpression. 433 | def visitLambdaExpression(self, ctx:JavaParser.LambdaExpressionContext): 434 | return self.visitChildren(ctx) 435 | 436 | 437 | # Visit a parse tree produced by JavaParser#lambdaParameters. 438 | def visitLambdaParameters(self, ctx:JavaParser.LambdaParametersContext): 439 | return self.visitChildren(ctx) 440 | 441 | 442 | # Visit a parse tree produced by JavaParser#lambdaBody. 443 | def visitLambdaBody(self, ctx:JavaParser.LambdaBodyContext): 444 | return self.visitChildren(ctx) 445 | 446 | 447 | # Visit a parse tree produced by JavaParser#primary. 448 | def visitPrimary(self, ctx:JavaParser.PrimaryContext): 449 | return self.visitChildren(ctx) 450 | 451 | 452 | # Visit a parse tree produced by JavaParser#classType. 453 | def visitClassType(self, ctx:JavaParser.ClassTypeContext): 454 | return self.visitChildren(ctx) 455 | 456 | 457 | # Visit a parse tree produced by JavaParser#creator. 458 | def visitCreator(self, ctx:JavaParser.CreatorContext): 459 | return self.visitChildren(ctx) 460 | 461 | 462 | # Visit a parse tree produced by JavaParser#createdName. 463 | def visitCreatedName(self, ctx:JavaParser.CreatedNameContext): 464 | return self.visitChildren(ctx) 465 | 466 | 467 | # Visit a parse tree produced by JavaParser#innerCreator. 468 | def visitInnerCreator(self, ctx:JavaParser.InnerCreatorContext): 469 | return self.visitChildren(ctx) 470 | 471 | 472 | # Visit a parse tree produced by JavaParser#arrayCreatorRest. 473 | def visitArrayCreatorRest(self, ctx:JavaParser.ArrayCreatorRestContext): 474 | return self.visitChildren(ctx) 475 | 476 | 477 | # Visit a parse tree produced by JavaParser#classCreatorRest. 478 | def visitClassCreatorRest(self, ctx:JavaParser.ClassCreatorRestContext): 479 | return self.visitChildren(ctx) 480 | 481 | 482 | # Visit a parse tree produced by JavaParser#explicitGenericInvocation. 483 | def visitExplicitGenericInvocation(self, ctx:JavaParser.ExplicitGenericInvocationContext): 484 | return self.visitChildren(ctx) 485 | 486 | 487 | # Visit a parse tree produced by JavaParser#typeArgumentsOrDiamond. 488 | def visitTypeArgumentsOrDiamond(self, ctx:JavaParser.TypeArgumentsOrDiamondContext): 489 | return self.visitChildren(ctx) 490 | 491 | 492 | # Visit a parse tree produced by JavaParser#nonWildcardTypeArgumentsOrDiamond. 493 | def visitNonWildcardTypeArgumentsOrDiamond(self, ctx:JavaParser.NonWildcardTypeArgumentsOrDiamondContext): 494 | return self.visitChildren(ctx) 495 | 496 | 497 | # Visit a parse tree produced by JavaParser#nonWildcardTypeArguments. 498 | def visitNonWildcardTypeArguments(self, ctx:JavaParser.NonWildcardTypeArgumentsContext): 499 | return self.visitChildren(ctx) 500 | 501 | 502 | # Visit a parse tree produced by JavaParser#typeList. 503 | def visitTypeList(self, ctx:JavaParser.TypeListContext): 504 | return self.visitChildren(ctx) 505 | 506 | 507 | # Visit a parse tree produced by JavaParser#typeType. 508 | def visitTypeType(self, ctx:JavaParser.TypeTypeContext): 509 | return self.visitChildren(ctx) 510 | 511 | 512 | # Visit a parse tree produced by JavaParser#primitiveType. 513 | def visitPrimitiveType(self, ctx:JavaParser.PrimitiveTypeContext): 514 | return self.visitChildren(ctx) 515 | 516 | 517 | # Visit a parse tree produced by JavaParser#typeArguments. 518 | def visitTypeArguments(self, ctx:JavaParser.TypeArgumentsContext): 519 | return self.visitChildren(ctx) 520 | 521 | 522 | # Visit a parse tree produced by JavaParser#superSuffix. 523 | def visitSuperSuffix(self, ctx:JavaParser.SuperSuffixContext): 524 | return self.visitChildren(ctx) 525 | 526 | 527 | # Visit a parse tree produced by JavaParser#explicitGenericInvocationSuffix. 528 | def visitExplicitGenericInvocationSuffix(self, ctx:JavaParser.ExplicitGenericInvocationSuffixContext): 529 | return self.visitChildren(ctx) 530 | 531 | 532 | # Visit a parse tree produced by JavaParser#arguments. 533 | def visitArguments(self, ctx:JavaParser.ArgumentsContext): 534 | return self.visitChildren(ctx) 535 | 536 | 537 | 538 | del JavaParser -------------------------------------------------------------------------------- /decaf2many/lang/JavaLexer.interp: -------------------------------------------------------------------------------- 1 | token literal names: 2 | null 3 | 'abstract' 4 | 'assert' 5 | 'boolean' 6 | 'break' 7 | 'byte' 8 | 'case' 9 | 'catch' 10 | 'char' 11 | 'class' 12 | 'const' 13 | 'continue' 14 | 'default' 15 | 'do' 16 | 'double' 17 | 'else' 18 | 'enum' 19 | 'extends' 20 | 'final' 21 | 'finally' 22 | 'float' 23 | 'for' 24 | 'if' 25 | 'goto' 26 | 'implements' 27 | 'import' 28 | 'instanceof' 29 | 'int' 30 | 'interface' 31 | 'long' 32 | 'native' 33 | 'new' 34 | 'package' 35 | 'private' 36 | 'protected' 37 | 'public' 38 | 'return' 39 | 'short' 40 | 'static' 41 | 'strictfp' 42 | 'super' 43 | 'switch' 44 | 'synchronized' 45 | 'this' 46 | 'throw' 47 | 'throws' 48 | 'transient' 49 | 'try' 50 | 'void' 51 | 'volatile' 52 | 'while' 53 | null 54 | null 55 | null 56 | null 57 | null 58 | null 59 | null 60 | null 61 | null 62 | 'null' 63 | '(' 64 | ')' 65 | '{' 66 | '}' 67 | '[' 68 | ']' 69 | ';' 70 | ',' 71 | '.' 72 | '=' 73 | '>' 74 | '<' 75 | '!' 76 | '~' 77 | '?' 78 | ':' 79 | '==' 80 | '<=' 81 | '>=' 82 | '!=' 83 | '&&' 84 | '||' 85 | '++' 86 | '--' 87 | '+' 88 | '-' 89 | '*' 90 | '/' 91 | '&' 92 | '|' 93 | '^' 94 | '%' 95 | '+=' 96 | '-=' 97 | '*=' 98 | '/=' 99 | '&=' 100 | '|=' 101 | '^=' 102 | '%=' 103 | '<<=' 104 | '>>=' 105 | '>>>=' 106 | '->' 107 | '::' 108 | '@' 109 | '...' 110 | null 111 | null 112 | null 113 | null 114 | null 115 | 116 | token symbolic names: 117 | null 118 | ABSTRACT 119 | ASSERT 120 | BOOLEAN 121 | BREAK 122 | BYTE 123 | CASE 124 | CATCH 125 | CHAR 126 | CLASS 127 | CONST 128 | CONTINUE 129 | DEFAULT 130 | DO 131 | DOUBLE 132 | ELSE 133 | ENUM 134 | EXTENDS 135 | FINAL 136 | FINALLY 137 | FLOAT 138 | FOR 139 | IF 140 | GOTO 141 | IMPLEMENTS 142 | IMPORT 143 | INSTANCEOF 144 | INT 145 | INTERFACE 146 | LONG 147 | NATIVE 148 | NEW 149 | PACKAGE 150 | PRIVATE 151 | PROTECTED 152 | PUBLIC 153 | RETURN 154 | SHORT 155 | STATIC 156 | STRICTFP 157 | SUPER 158 | SWITCH 159 | SYNCHRONIZED 160 | THIS 161 | THROW 162 | THROWS 163 | TRANSIENT 164 | TRY 165 | VOID 166 | VOLATILE 167 | WHILE 168 | DECIMAL_LITERAL 169 | HEX_LITERAL 170 | OCT_LITERAL 171 | BINARY_LITERAL 172 | FLOAT_LITERAL 173 | HEX_FLOAT_LITERAL 174 | BOOL_LITERAL 175 | CHAR_LITERAL 176 | STRING_LITERAL 177 | NULL_LITERAL 178 | LPAREN 179 | RPAREN 180 | LBRACE 181 | RBRACE 182 | LBRACK 183 | RBRACK 184 | SEMI 185 | COMMA 186 | DOT 187 | ASSIGN 188 | GT 189 | LT 190 | BANG 191 | TILDE 192 | QUESTION 193 | COLON 194 | EQUAL 195 | LE 196 | GE 197 | NOTEQUAL 198 | AND 199 | OR 200 | INC 201 | DEC 202 | ADD 203 | SUB 204 | MUL 205 | DIV 206 | BITAND 207 | BITOR 208 | CARET 209 | MOD 210 | ADD_ASSIGN 211 | SUB_ASSIGN 212 | MUL_ASSIGN 213 | DIV_ASSIGN 214 | AND_ASSIGN 215 | OR_ASSIGN 216 | XOR_ASSIGN 217 | MOD_ASSIGN 218 | LSHIFT_ASSIGN 219 | RSHIFT_ASSIGN 220 | URSHIFT_ASSIGN 221 | ARROW 222 | COLONCOLON 223 | AT 224 | ELLIPSIS 225 | WS 226 | COMMENT 227 | LINE_COMMENT 228 | JAVADOC_COMMENT 229 | IDENTIFIER 230 | 231 | rule names: 232 | ABSTRACT 233 | ASSERT 234 | BOOLEAN 235 | BREAK 236 | BYTE 237 | CASE 238 | CATCH 239 | CHAR 240 | CLASS 241 | CONST 242 | CONTINUE 243 | DEFAULT 244 | DO 245 | DOUBLE 246 | ELSE 247 | ENUM 248 | EXTENDS 249 | FINAL 250 | FINALLY 251 | FLOAT 252 | FOR 253 | IF 254 | GOTO 255 | IMPLEMENTS 256 | IMPORT 257 | INSTANCEOF 258 | INT 259 | INTERFACE 260 | LONG 261 | NATIVE 262 | NEW 263 | PACKAGE 264 | PRIVATE 265 | PROTECTED 266 | PUBLIC 267 | RETURN 268 | SHORT 269 | STATIC 270 | STRICTFP 271 | SUPER 272 | SWITCH 273 | SYNCHRONIZED 274 | THIS 275 | THROW 276 | THROWS 277 | TRANSIENT 278 | TRY 279 | VOID 280 | VOLATILE 281 | WHILE 282 | DECIMAL_LITERAL 283 | HEX_LITERAL 284 | OCT_LITERAL 285 | BINARY_LITERAL 286 | FLOAT_LITERAL 287 | HEX_FLOAT_LITERAL 288 | BOOL_LITERAL 289 | CHAR_LITERAL 290 | STRING_LITERAL 291 | NULL_LITERAL 292 | LPAREN 293 | RPAREN 294 | LBRACE 295 | RBRACE 296 | LBRACK 297 | RBRACK 298 | SEMI 299 | COMMA 300 | DOT 301 | ASSIGN 302 | GT 303 | LT 304 | BANG 305 | TILDE 306 | QUESTION 307 | COLON 308 | EQUAL 309 | LE 310 | GE 311 | NOTEQUAL 312 | AND 313 | OR 314 | INC 315 | DEC 316 | ADD 317 | SUB 318 | MUL 319 | DIV 320 | BITAND 321 | BITOR 322 | CARET 323 | MOD 324 | ADD_ASSIGN 325 | SUB_ASSIGN 326 | MUL_ASSIGN 327 | DIV_ASSIGN 328 | AND_ASSIGN 329 | OR_ASSIGN 330 | XOR_ASSIGN 331 | MOD_ASSIGN 332 | LSHIFT_ASSIGN 333 | RSHIFT_ASSIGN 334 | URSHIFT_ASSIGN 335 | ARROW 336 | COLONCOLON 337 | AT 338 | ELLIPSIS 339 | WS 340 | COMMENT 341 | LINE_COMMENT 342 | JAVADOC_COMMENT 343 | IDENTIFIER 344 | ExponentPart 345 | EscapeSequence 346 | HexDigits 347 | HexDigit 348 | Digits 349 | LetterOrDigit 350 | Letter 351 | 352 | channel names: 353 | DEFAULT_TOKEN_CHANNEL 354 | HIDDEN 355 | 356 | mode names: 357 | DEFAULT_MODE 358 | 359 | atn: 360 | [3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 114, 964, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 4, 84, 9, 84, 4, 85, 9, 85, 4, 86, 9, 86, 4, 87, 9, 87, 4, 88, 9, 88, 4, 89, 9, 89, 4, 90, 9, 90, 4, 91, 9, 91, 4, 92, 9, 92, 4, 93, 9, 93, 4, 94, 9, 94, 4, 95, 9, 95, 4, 96, 9, 96, 4, 97, 9, 97, 4, 98, 9, 98, 4, 99, 9, 99, 4, 100, 9, 100, 4, 101, 9, 101, 4, 102, 9, 102, 4, 103, 9, 103, 4, 104, 9, 104, 4, 105, 9, 105, 4, 106, 9, 106, 4, 107, 9, 107, 4, 108, 9, 108, 4, 109, 9, 109, 4, 110, 9, 110, 4, 111, 9, 111, 4, 112, 9, 112, 4, 113, 9, 113, 4, 114, 9, 114, 4, 115, 9, 115, 4, 116, 9, 116, 4, 117, 9, 117, 4, 118, 9, 118, 4, 119, 9, 119, 4, 120, 9, 120, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 52, 5, 52, 584, 10, 52, 3, 52, 6, 52, 587, 10, 52, 13, 52, 14, 52, 588, 3, 52, 5, 52, 592, 10, 52, 5, 52, 594, 10, 52, 3, 52, 5, 52, 597, 10, 52, 3, 53, 3, 53, 3, 53, 3, 53, 7, 53, 603, 10, 53, 12, 53, 14, 53, 606, 11, 53, 3, 53, 5, 53, 609, 10, 53, 3, 53, 5, 53, 612, 10, 53, 3, 54, 3, 54, 7, 54, 616, 10, 54, 12, 54, 14, 54, 619, 11, 54, 3, 54, 3, 54, 7, 54, 623, 10, 54, 12, 54, 14, 54, 626, 11, 54, 3, 54, 5, 54, 629, 10, 54, 3, 54, 5, 54, 632, 10, 54, 3, 55, 3, 55, 3, 55, 3, 55, 7, 55, 638, 10, 55, 12, 55, 14, 55, 641, 11, 55, 3, 55, 5, 55, 644, 10, 55, 3, 55, 5, 55, 647, 10, 55, 3, 56, 3, 56, 3, 56, 5, 56, 652, 10, 56, 3, 56, 3, 56, 5, 56, 656, 10, 56, 3, 56, 5, 56, 659, 10, 56, 3, 56, 5, 56, 662, 10, 56, 3, 56, 3, 56, 3, 56, 5, 56, 667, 10, 56, 3, 56, 5, 56, 670, 10, 56, 5, 56, 672, 10, 56, 3, 57, 3, 57, 3, 57, 3, 57, 5, 57, 678, 10, 57, 3, 57, 5, 57, 681, 10, 57, 3, 57, 3, 57, 5, 57, 685, 10, 57, 3, 57, 3, 57, 5, 57, 689, 10, 57, 3, 57, 3, 57, 5, 57, 693, 10, 57, 3, 58, 3, 58, 3, 58, 3, 58, 3, 58, 3, 58, 3, 58, 3, 58, 3, 58, 5, 58, 704, 10, 58, 3, 59, 3, 59, 3, 59, 5, 59, 709, 10, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 7, 60, 716, 10, 60, 12, 60, 14, 60, 719, 11, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 62, 3, 62, 3, 63, 3, 63, 3, 64, 3, 64, 3, 65, 3, 65, 3, 66, 3, 66, 3, 67, 3, 67, 3, 68, 3, 68, 3, 69, 3, 69, 3, 70, 3, 70, 3, 71, 3, 71, 3, 72, 3, 72, 3, 73, 3, 73, 3, 74, 3, 74, 3, 75, 3, 75, 3, 76, 3, 76, 3, 77, 3, 77, 3, 78, 3, 78, 3, 78, 3, 79, 3, 79, 3, 79, 3, 80, 3, 80, 3, 80, 3, 81, 3, 81, 3, 81, 3, 82, 3, 82, 3, 82, 3, 83, 3, 83, 3, 83, 3, 84, 3, 84, 3, 84, 3, 85, 3, 85, 3, 85, 3, 86, 3, 86, 3, 87, 3, 87, 3, 88, 3, 88, 3, 89, 3, 89, 3, 90, 3, 90, 3, 91, 3, 91, 3, 92, 3, 92, 3, 93, 3, 93, 3, 94, 3, 94, 3, 94, 3, 95, 3, 95, 3, 95, 3, 96, 3, 96, 3, 96, 3, 97, 3, 97, 3, 97, 3, 98, 3, 98, 3, 98, 3, 99, 3, 99, 3, 99, 3, 100, 3, 100, 3, 100, 3, 101, 3, 101, 3, 101, 3, 102, 3, 102, 3, 102, 3, 102, 3, 103, 3, 103, 3, 103, 3, 103, 3, 104, 3, 104, 3, 104, 3, 104, 3, 104, 3, 105, 3, 105, 3, 105, 3, 106, 3, 106, 3, 106, 3, 107, 3, 107, 3, 108, 3, 108, 3, 108, 3, 108, 3, 109, 6, 109, 850, 10, 109, 13, 109, 14, 109, 851, 3, 109, 3, 109, 3, 110, 3, 110, 3, 110, 3, 110, 7, 110, 860, 10, 110, 12, 110, 14, 110, 863, 11, 110, 3, 110, 3, 110, 3, 110, 3, 110, 3, 110, 3, 111, 3, 111, 3, 111, 3, 111, 7, 111, 874, 10, 111, 12, 111, 14, 111, 877, 11, 111, 3, 111, 3, 111, 3, 112, 3, 112, 3, 112, 3, 112, 3, 112, 7, 112, 886, 10, 112, 12, 112, 14, 112, 889, 11, 112, 3, 112, 3, 112, 3, 112, 3, 112, 3, 112, 3, 113, 3, 113, 7, 113, 898, 10, 113, 12, 113, 14, 113, 901, 11, 113, 3, 114, 3, 114, 5, 114, 905, 10, 114, 3, 114, 3, 114, 3, 115, 3, 115, 3, 115, 3, 115, 5, 115, 913, 10, 115, 3, 115, 5, 115, 916, 10, 115, 3, 115, 3, 115, 3, 115, 6, 115, 921, 10, 115, 13, 115, 14, 115, 922, 3, 115, 3, 115, 3, 115, 3, 115, 3, 115, 5, 115, 930, 10, 115, 3, 116, 3, 116, 3, 116, 7, 116, 935, 10, 116, 12, 116, 14, 116, 938, 11, 116, 3, 116, 5, 116, 941, 10, 116, 3, 117, 3, 117, 3, 118, 3, 118, 7, 118, 947, 10, 118, 12, 118, 14, 118, 950, 11, 118, 3, 118, 5, 118, 953, 10, 118, 3, 119, 3, 119, 5, 119, 957, 10, 119, 3, 120, 3, 120, 3, 120, 3, 120, 5, 120, 963, 10, 120, 4, 861, 887, 2, 121, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 91, 47, 93, 48, 95, 49, 97, 50, 99, 51, 101, 52, 103, 53, 105, 54, 107, 55, 109, 56, 111, 57, 113, 58, 115, 59, 117, 60, 119, 61, 121, 62, 123, 63, 125, 64, 127, 65, 129, 66, 131, 67, 133, 68, 135, 69, 137, 70, 139, 71, 141, 72, 143, 73, 145, 74, 147, 75, 149, 76, 151, 77, 153, 78, 155, 79, 157, 80, 159, 81, 161, 82, 163, 83, 165, 84, 167, 85, 169, 86, 171, 87, 173, 88, 175, 89, 177, 90, 179, 91, 181, 92, 183, 93, 185, 94, 187, 95, 189, 96, 191, 97, 193, 98, 195, 99, 197, 100, 199, 101, 201, 102, 203, 103, 205, 104, 207, 105, 209, 106, 211, 107, 213, 108, 215, 109, 217, 110, 219, 111, 221, 112, 223, 113, 225, 114, 227, 2, 229, 2, 231, 2, 233, 2, 235, 2, 237, 2, 239, 2, 3, 2, 28, 3, 2, 51, 59, 4, 2, 78, 78, 110, 110, 4, 2, 90, 90, 122, 122, 5, 2, 50, 59, 67, 72, 99, 104, 6, 2, 50, 59, 67, 72, 97, 97, 99, 104, 3, 2, 50, 57, 4, 2, 50, 57, 97, 97, 4, 2, 68, 68, 100, 100, 3, 2, 50, 51, 4, 2, 50, 51, 97, 97, 6, 2, 70, 70, 72, 72, 102, 102, 104, 104, 4, 2, 82, 82, 114, 114, 4, 2, 45, 45, 47, 47, 6, 2, 12, 12, 15, 15, 41, 41, 94, 94, 6, 2, 12, 12, 15, 15, 36, 36, 94, 94, 5, 2, 11, 12, 14, 15, 34, 34, 4, 2, 12, 12, 15, 15, 4, 2, 71, 71, 103, 103, 10, 2, 36, 36, 41, 41, 94, 94, 100, 100, 104, 104, 112, 112, 116, 116, 118, 118, 3, 2, 50, 53, 3, 2, 50, 59, 4, 2, 50, 59, 97, 97, 6, 2, 38, 38, 67, 92, 97, 97, 99, 124, 4, 2, 2, 129, 55298, 56321, 3, 2, 55298, 56321, 3, 2, 56322, 57345, 2, 1006, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3, 2, 2, 2, 2, 95, 3, 2, 2, 2, 2, 97, 3, 2, 2, 2, 2, 99, 3, 2, 2, 2, 2, 101, 3, 2, 2, 2, 2, 103, 3, 2, 2, 2, 2, 105, 3, 2, 2, 2, 2, 107, 3, 2, 2, 2, 2, 109, 3, 2, 2, 2, 2, 111, 3, 2, 2, 2, 2, 113, 3, 2, 2, 2, 2, 115, 3, 2, 2, 2, 2, 117, 3, 2, 2, 2, 2, 119, 3, 2, 2, 2, 2, 121, 3, 2, 2, 2, 2, 123, 3, 2, 2, 2, 2, 125, 3, 2, 2, 2, 2, 127, 3, 2, 2, 2, 2, 129, 3, 2, 2, 2, 2, 131, 3, 2, 2, 2, 2, 133, 3, 2, 2, 2, 2, 135, 3, 2, 2, 2, 2, 137, 3, 2, 2, 2, 2, 139, 3, 2, 2, 2, 2, 141, 3, 2, 2, 2, 2, 143, 3, 2, 2, 2, 2, 145, 3, 2, 2, 2, 2, 147, 3, 2, 2, 2, 2, 149, 3, 2, 2, 2, 2, 151, 3, 2, 2, 2, 2, 153, 3, 2, 2, 2, 2, 155, 3, 2, 2, 2, 2, 157, 3, 2, 2, 2, 2, 159, 3, 2, 2, 2, 2, 161, 3, 2, 2, 2, 2, 163, 3, 2, 2, 2, 2, 165, 3, 2, 2, 2, 2, 167, 3, 2, 2, 2, 2, 169, 3, 2, 2, 2, 2, 171, 3, 2, 2, 2, 2, 173, 3, 2, 2, 2, 2, 175, 3, 2, 2, 2, 2, 177, 3, 2, 2, 2, 2, 179, 3, 2, 2, 2, 2, 181, 3, 2, 2, 2, 2, 183, 3, 2, 2, 2, 2, 185, 3, 2, 2, 2, 2, 187, 3, 2, 2, 2, 2, 189, 3, 2, 2, 2, 2, 191, 3, 2, 2, 2, 2, 193, 3, 2, 2, 2, 2, 195, 3, 2, 2, 2, 2, 197, 3, 2, 2, 2, 2, 199, 3, 2, 2, 2, 2, 201, 3, 2, 2, 2, 2, 203, 3, 2, 2, 2, 2, 205, 3, 2, 2, 2, 2, 207, 3, 2, 2, 2, 2, 209, 3, 2, 2, 2, 2, 211, 3, 2, 2, 2, 2, 213, 3, 2, 2, 2, 2, 215, 3, 2, 2, 2, 2, 217, 3, 2, 2, 2, 2, 219, 3, 2, 2, 2, 2, 221, 3, 2, 2, 2, 2, 223, 3, 2, 2, 2, 2, 225, 3, 2, 2, 2, 3, 241, 3, 2, 2, 2, 5, 250, 3, 2, 2, 2, 7, 257, 3, 2, 2, 2, 9, 265, 3, 2, 2, 2, 11, 271, 3, 2, 2, 2, 13, 276, 3, 2, 2, 2, 15, 281, 3, 2, 2, 2, 17, 287, 3, 2, 2, 2, 19, 292, 3, 2, 2, 2, 21, 298, 3, 2, 2, 2, 23, 304, 3, 2, 2, 2, 25, 313, 3, 2, 2, 2, 27, 321, 3, 2, 2, 2, 29, 324, 3, 2, 2, 2, 31, 331, 3, 2, 2, 2, 33, 336, 3, 2, 2, 2, 35, 341, 3, 2, 2, 2, 37, 349, 3, 2, 2, 2, 39, 355, 3, 2, 2, 2, 41, 363, 3, 2, 2, 2, 43, 369, 3, 2, 2, 2, 45, 373, 3, 2, 2, 2, 47, 376, 3, 2, 2, 2, 49, 381, 3, 2, 2, 2, 51, 392, 3, 2, 2, 2, 53, 399, 3, 2, 2, 2, 55, 410, 3, 2, 2, 2, 57, 414, 3, 2, 2, 2, 59, 424, 3, 2, 2, 2, 61, 429, 3, 2, 2, 2, 63, 436, 3, 2, 2, 2, 65, 440, 3, 2, 2, 2, 67, 448, 3, 2, 2, 2, 69, 456, 3, 2, 2, 2, 71, 466, 3, 2, 2, 2, 73, 473, 3, 2, 2, 2, 75, 480, 3, 2, 2, 2, 77, 486, 3, 2, 2, 2, 79, 493, 3, 2, 2, 2, 81, 502, 3, 2, 2, 2, 83, 508, 3, 2, 2, 2, 85, 515, 3, 2, 2, 2, 87, 528, 3, 2, 2, 2, 89, 533, 3, 2, 2, 2, 91, 539, 3, 2, 2, 2, 93, 546, 3, 2, 2, 2, 95, 556, 3, 2, 2, 2, 97, 560, 3, 2, 2, 2, 99, 565, 3, 2, 2, 2, 101, 574, 3, 2, 2, 2, 103, 593, 3, 2, 2, 2, 105, 598, 3, 2, 2, 2, 107, 613, 3, 2, 2, 2, 109, 633, 3, 2, 2, 2, 111, 671, 3, 2, 2, 2, 113, 673, 3, 2, 2, 2, 115, 703, 3, 2, 2, 2, 117, 705, 3, 2, 2, 2, 119, 712, 3, 2, 2, 2, 121, 722, 3, 2, 2, 2, 123, 727, 3, 2, 2, 2, 125, 729, 3, 2, 2, 2, 127, 731, 3, 2, 2, 2, 129, 733, 3, 2, 2, 2, 131, 735, 3, 2, 2, 2, 133, 737, 3, 2, 2, 2, 135, 739, 3, 2, 2, 2, 137, 741, 3, 2, 2, 2, 139, 743, 3, 2, 2, 2, 141, 745, 3, 2, 2, 2, 143, 747, 3, 2, 2, 2, 145, 749, 3, 2, 2, 2, 147, 751, 3, 2, 2, 2, 149, 753, 3, 2, 2, 2, 151, 755, 3, 2, 2, 2, 153, 757, 3, 2, 2, 2, 155, 759, 3, 2, 2, 2, 157, 762, 3, 2, 2, 2, 159, 765, 3, 2, 2, 2, 161, 768, 3, 2, 2, 2, 163, 771, 3, 2, 2, 2, 165, 774, 3, 2, 2, 2, 167, 777, 3, 2, 2, 2, 169, 780, 3, 2, 2, 2, 171, 783, 3, 2, 2, 2, 173, 785, 3, 2, 2, 2, 175, 787, 3, 2, 2, 2, 177, 789, 3, 2, 2, 2, 179, 791, 3, 2, 2, 2, 181, 793, 3, 2, 2, 2, 183, 795, 3, 2, 2, 2, 185, 797, 3, 2, 2, 2, 187, 799, 3, 2, 2, 2, 189, 802, 3, 2, 2, 2, 191, 805, 3, 2, 2, 2, 193, 808, 3, 2, 2, 2, 195, 811, 3, 2, 2, 2, 197, 814, 3, 2, 2, 2, 199, 817, 3, 2, 2, 2, 201, 820, 3, 2, 2, 2, 203, 823, 3, 2, 2, 2, 205, 827, 3, 2, 2, 2, 207, 831, 3, 2, 2, 2, 209, 836, 3, 2, 2, 2, 211, 839, 3, 2, 2, 2, 213, 842, 3, 2, 2, 2, 215, 844, 3, 2, 2, 2, 217, 849, 3, 2, 2, 2, 219, 855, 3, 2, 2, 2, 221, 869, 3, 2, 2, 2, 223, 880, 3, 2, 2, 2, 225, 895, 3, 2, 2, 2, 227, 902, 3, 2, 2, 2, 229, 929, 3, 2, 2, 2, 231, 931, 3, 2, 2, 2, 233, 942, 3, 2, 2, 2, 235, 944, 3, 2, 2, 2, 237, 956, 3, 2, 2, 2, 239, 962, 3, 2, 2, 2, 241, 242, 7, 99, 2, 2, 242, 243, 7, 100, 2, 2, 243, 244, 7, 117, 2, 2, 244, 245, 7, 118, 2, 2, 245, 246, 7, 116, 2, 2, 246, 247, 7, 99, 2, 2, 247, 248, 7, 101, 2, 2, 248, 249, 7, 118, 2, 2, 249, 4, 3, 2, 2, 2, 250, 251, 7, 99, 2, 2, 251, 252, 7, 117, 2, 2, 252, 253, 7, 117, 2, 2, 253, 254, 7, 103, 2, 2, 254, 255, 7, 116, 2, 2, 255, 256, 7, 118, 2, 2, 256, 6, 3, 2, 2, 2, 257, 258, 7, 100, 2, 2, 258, 259, 7, 113, 2, 2, 259, 260, 7, 113, 2, 2, 260, 261, 7, 110, 2, 2, 261, 262, 7, 103, 2, 2, 262, 263, 7, 99, 2, 2, 263, 264, 7, 112, 2, 2, 264, 8, 3, 2, 2, 2, 265, 266, 7, 100, 2, 2, 266, 267, 7, 116, 2, 2, 267, 268, 7, 103, 2, 2, 268, 269, 7, 99, 2, 2, 269, 270, 7, 109, 2, 2, 270, 10, 3, 2, 2, 2, 271, 272, 7, 100, 2, 2, 272, 273, 7, 123, 2, 2, 273, 274, 7, 118, 2, 2, 274, 275, 7, 103, 2, 2, 275, 12, 3, 2, 2, 2, 276, 277, 7, 101, 2, 2, 277, 278, 7, 99, 2, 2, 278, 279, 7, 117, 2, 2, 279, 280, 7, 103, 2, 2, 280, 14, 3, 2, 2, 2, 281, 282, 7, 101, 2, 2, 282, 283, 7, 99, 2, 2, 283, 284, 7, 118, 2, 2, 284, 285, 7, 101, 2, 2, 285, 286, 7, 106, 2, 2, 286, 16, 3, 2, 2, 2, 287, 288, 7, 101, 2, 2, 288, 289, 7, 106, 2, 2, 289, 290, 7, 99, 2, 2, 290, 291, 7, 116, 2, 2, 291, 18, 3, 2, 2, 2, 292, 293, 7, 101, 2, 2, 293, 294, 7, 110, 2, 2, 294, 295, 7, 99, 2, 2, 295, 296, 7, 117, 2, 2, 296, 297, 7, 117, 2, 2, 297, 20, 3, 2, 2, 2, 298, 299, 7, 101, 2, 2, 299, 300, 7, 113, 2, 2, 300, 301, 7, 112, 2, 2, 301, 302, 7, 117, 2, 2, 302, 303, 7, 118, 2, 2, 303, 22, 3, 2, 2, 2, 304, 305, 7, 101, 2, 2, 305, 306, 7, 113, 2, 2, 306, 307, 7, 112, 2, 2, 307, 308, 7, 118, 2, 2, 308, 309, 7, 107, 2, 2, 309, 310, 7, 112, 2, 2, 310, 311, 7, 119, 2, 2, 311, 312, 7, 103, 2, 2, 312, 24, 3, 2, 2, 2, 313, 314, 7, 102, 2, 2, 314, 315, 7, 103, 2, 2, 315, 316, 7, 104, 2, 2, 316, 317, 7, 99, 2, 2, 317, 318, 7, 119, 2, 2, 318, 319, 7, 110, 2, 2, 319, 320, 7, 118, 2, 2, 320, 26, 3, 2, 2, 2, 321, 322, 7, 102, 2, 2, 322, 323, 7, 113, 2, 2, 323, 28, 3, 2, 2, 2, 324, 325, 7, 102, 2, 2, 325, 326, 7, 113, 2, 2, 326, 327, 7, 119, 2, 2, 327, 328, 7, 100, 2, 2, 328, 329, 7, 110, 2, 2, 329, 330, 7, 103, 2, 2, 330, 30, 3, 2, 2, 2, 331, 332, 7, 103, 2, 2, 332, 333, 7, 110, 2, 2, 333, 334, 7, 117, 2, 2, 334, 335, 7, 103, 2, 2, 335, 32, 3, 2, 2, 2, 336, 337, 7, 103, 2, 2, 337, 338, 7, 112, 2, 2, 338, 339, 7, 119, 2, 2, 339, 340, 7, 111, 2, 2, 340, 34, 3, 2, 2, 2, 341, 342, 7, 103, 2, 2, 342, 343, 7, 122, 2, 2, 343, 344, 7, 118, 2, 2, 344, 345, 7, 103, 2, 2, 345, 346, 7, 112, 2, 2, 346, 347, 7, 102, 2, 2, 347, 348, 7, 117, 2, 2, 348, 36, 3, 2, 2, 2, 349, 350, 7, 104, 2, 2, 350, 351, 7, 107, 2, 2, 351, 352, 7, 112, 2, 2, 352, 353, 7, 99, 2, 2, 353, 354, 7, 110, 2, 2, 354, 38, 3, 2, 2, 2, 355, 356, 7, 104, 2, 2, 356, 357, 7, 107, 2, 2, 357, 358, 7, 112, 2, 2, 358, 359, 7, 99, 2, 2, 359, 360, 7, 110, 2, 2, 360, 361, 7, 110, 2, 2, 361, 362, 7, 123, 2, 2, 362, 40, 3, 2, 2, 2, 363, 364, 7, 104, 2, 2, 364, 365, 7, 110, 2, 2, 365, 366, 7, 113, 2, 2, 366, 367, 7, 99, 2, 2, 367, 368, 7, 118, 2, 2, 368, 42, 3, 2, 2, 2, 369, 370, 7, 104, 2, 2, 370, 371, 7, 113, 2, 2, 371, 372, 7, 116, 2, 2, 372, 44, 3, 2, 2, 2, 373, 374, 7, 107, 2, 2, 374, 375, 7, 104, 2, 2, 375, 46, 3, 2, 2, 2, 376, 377, 7, 105, 2, 2, 377, 378, 7, 113, 2, 2, 378, 379, 7, 118, 2, 2, 379, 380, 7, 113, 2, 2, 380, 48, 3, 2, 2, 2, 381, 382, 7, 107, 2, 2, 382, 383, 7, 111, 2, 2, 383, 384, 7, 114, 2, 2, 384, 385, 7, 110, 2, 2, 385, 386, 7, 103, 2, 2, 386, 387, 7, 111, 2, 2, 387, 388, 7, 103, 2, 2, 388, 389, 7, 112, 2, 2, 389, 390, 7, 118, 2, 2, 390, 391, 7, 117, 2, 2, 391, 50, 3, 2, 2, 2, 392, 393, 7, 107, 2, 2, 393, 394, 7, 111, 2, 2, 394, 395, 7, 114, 2, 2, 395, 396, 7, 113, 2, 2, 396, 397, 7, 116, 2, 2, 397, 398, 7, 118, 2, 2, 398, 52, 3, 2, 2, 2, 399, 400, 7, 107, 2, 2, 400, 401, 7, 112, 2, 2, 401, 402, 7, 117, 2, 2, 402, 403, 7, 118, 2, 2, 403, 404, 7, 99, 2, 2, 404, 405, 7, 112, 2, 2, 405, 406, 7, 101, 2, 2, 406, 407, 7, 103, 2, 2, 407, 408, 7, 113, 2, 2, 408, 409, 7, 104, 2, 2, 409, 54, 3, 2, 2, 2, 410, 411, 7, 107, 2, 2, 411, 412, 7, 112, 2, 2, 412, 413, 7, 118, 2, 2, 413, 56, 3, 2, 2, 2, 414, 415, 7, 107, 2, 2, 415, 416, 7, 112, 2, 2, 416, 417, 7, 118, 2, 2, 417, 418, 7, 103, 2, 2, 418, 419, 7, 116, 2, 2, 419, 420, 7, 104, 2, 2, 420, 421, 7, 99, 2, 2, 421, 422, 7, 101, 2, 2, 422, 423, 7, 103, 2, 2, 423, 58, 3, 2, 2, 2, 424, 425, 7, 110, 2, 2, 425, 426, 7, 113, 2, 2, 426, 427, 7, 112, 2, 2, 427, 428, 7, 105, 2, 2, 428, 60, 3, 2, 2, 2, 429, 430, 7, 112, 2, 2, 430, 431, 7, 99, 2, 2, 431, 432, 7, 118, 2, 2, 432, 433, 7, 107, 2, 2, 433, 434, 7, 120, 2, 2, 434, 435, 7, 103, 2, 2, 435, 62, 3, 2, 2, 2, 436, 437, 7, 112, 2, 2, 437, 438, 7, 103, 2, 2, 438, 439, 7, 121, 2, 2, 439, 64, 3, 2, 2, 2, 440, 441, 7, 114, 2, 2, 441, 442, 7, 99, 2, 2, 442, 443, 7, 101, 2, 2, 443, 444, 7, 109, 2, 2, 444, 445, 7, 99, 2, 2, 445, 446, 7, 105, 2, 2, 446, 447, 7, 103, 2, 2, 447, 66, 3, 2, 2, 2, 448, 449, 7, 114, 2, 2, 449, 450, 7, 116, 2, 2, 450, 451, 7, 107, 2, 2, 451, 452, 7, 120, 2, 2, 452, 453, 7, 99, 2, 2, 453, 454, 7, 118, 2, 2, 454, 455, 7, 103, 2, 2, 455, 68, 3, 2, 2, 2, 456, 457, 7, 114, 2, 2, 457, 458, 7, 116, 2, 2, 458, 459, 7, 113, 2, 2, 459, 460, 7, 118, 2, 2, 460, 461, 7, 103, 2, 2, 461, 462, 7, 101, 2, 2, 462, 463, 7, 118, 2, 2, 463, 464, 7, 103, 2, 2, 464, 465, 7, 102, 2, 2, 465, 70, 3, 2, 2, 2, 466, 467, 7, 114, 2, 2, 467, 468, 7, 119, 2, 2, 468, 469, 7, 100, 2, 2, 469, 470, 7, 110, 2, 2, 470, 471, 7, 107, 2, 2, 471, 472, 7, 101, 2, 2, 472, 72, 3, 2, 2, 2, 473, 474, 7, 116, 2, 2, 474, 475, 7, 103, 2, 2, 475, 476, 7, 118, 2, 2, 476, 477, 7, 119, 2, 2, 477, 478, 7, 116, 2, 2, 478, 479, 7, 112, 2, 2, 479, 74, 3, 2, 2, 2, 480, 481, 7, 117, 2, 2, 481, 482, 7, 106, 2, 2, 482, 483, 7, 113, 2, 2, 483, 484, 7, 116, 2, 2, 484, 485, 7, 118, 2, 2, 485, 76, 3, 2, 2, 2, 486, 487, 7, 117, 2, 2, 487, 488, 7, 118, 2, 2, 488, 489, 7, 99, 2, 2, 489, 490, 7, 118, 2, 2, 490, 491, 7, 107, 2, 2, 491, 492, 7, 101, 2, 2, 492, 78, 3, 2, 2, 2, 493, 494, 7, 117, 2, 2, 494, 495, 7, 118, 2, 2, 495, 496, 7, 116, 2, 2, 496, 497, 7, 107, 2, 2, 497, 498, 7, 101, 2, 2, 498, 499, 7, 118, 2, 2, 499, 500, 7, 104, 2, 2, 500, 501, 7, 114, 2, 2, 501, 80, 3, 2, 2, 2, 502, 503, 7, 117, 2, 2, 503, 504, 7, 119, 2, 2, 504, 505, 7, 114, 2, 2, 505, 506, 7, 103, 2, 2, 506, 507, 7, 116, 2, 2, 507, 82, 3, 2, 2, 2, 508, 509, 7, 117, 2, 2, 509, 510, 7, 121, 2, 2, 510, 511, 7, 107, 2, 2, 511, 512, 7, 118, 2, 2, 512, 513, 7, 101, 2, 2, 513, 514, 7, 106, 2, 2, 514, 84, 3, 2, 2, 2, 515, 516, 7, 117, 2, 2, 516, 517, 7, 123, 2, 2, 517, 518, 7, 112, 2, 2, 518, 519, 7, 101, 2, 2, 519, 520, 7, 106, 2, 2, 520, 521, 7, 116, 2, 2, 521, 522, 7, 113, 2, 2, 522, 523, 7, 112, 2, 2, 523, 524, 7, 107, 2, 2, 524, 525, 7, 124, 2, 2, 525, 526, 7, 103, 2, 2, 526, 527, 7, 102, 2, 2, 527, 86, 3, 2, 2, 2, 528, 529, 7, 118, 2, 2, 529, 530, 7, 106, 2, 2, 530, 531, 7, 107, 2, 2, 531, 532, 7, 117, 2, 2, 532, 88, 3, 2, 2, 2, 533, 534, 7, 118, 2, 2, 534, 535, 7, 106, 2, 2, 535, 536, 7, 116, 2, 2, 536, 537, 7, 113, 2, 2, 537, 538, 7, 121, 2, 2, 538, 90, 3, 2, 2, 2, 539, 540, 7, 118, 2, 2, 540, 541, 7, 106, 2, 2, 541, 542, 7, 116, 2, 2, 542, 543, 7, 113, 2, 2, 543, 544, 7, 121, 2, 2, 544, 545, 7, 117, 2, 2, 545, 92, 3, 2, 2, 2, 546, 547, 7, 118, 2, 2, 547, 548, 7, 116, 2, 2, 548, 549, 7, 99, 2, 2, 549, 550, 7, 112, 2, 2, 550, 551, 7, 117, 2, 2, 551, 552, 7, 107, 2, 2, 552, 553, 7, 103, 2, 2, 553, 554, 7, 112, 2, 2, 554, 555, 7, 118, 2, 2, 555, 94, 3, 2, 2, 2, 556, 557, 7, 118, 2, 2, 557, 558, 7, 116, 2, 2, 558, 559, 7, 123, 2, 2, 559, 96, 3, 2, 2, 2, 560, 561, 7, 120, 2, 2, 561, 562, 7, 113, 2, 2, 562, 563, 7, 107, 2, 2, 563, 564, 7, 102, 2, 2, 564, 98, 3, 2, 2, 2, 565, 566, 7, 120, 2, 2, 566, 567, 7, 113, 2, 2, 567, 568, 7, 110, 2, 2, 568, 569, 7, 99, 2, 2, 569, 570, 7, 118, 2, 2, 570, 571, 7, 107, 2, 2, 571, 572, 7, 110, 2, 2, 572, 573, 7, 103, 2, 2, 573, 100, 3, 2, 2, 2, 574, 575, 7, 121, 2, 2, 575, 576, 7, 106, 2, 2, 576, 577, 7, 107, 2, 2, 577, 578, 7, 110, 2, 2, 578, 579, 7, 103, 2, 2, 579, 102, 3, 2, 2, 2, 580, 594, 7, 50, 2, 2, 581, 591, 9, 2, 2, 2, 582, 584, 5, 235, 118, 2, 583, 582, 3, 2, 2, 2, 583, 584, 3, 2, 2, 2, 584, 592, 3, 2, 2, 2, 585, 587, 7, 97, 2, 2, 586, 585, 3, 2, 2, 2, 587, 588, 3, 2, 2, 2, 588, 586, 3, 2, 2, 2, 588, 589, 3, 2, 2, 2, 589, 590, 3, 2, 2, 2, 590, 592, 5, 235, 118, 2, 591, 583, 3, 2, 2, 2, 591, 586, 3, 2, 2, 2, 592, 594, 3, 2, 2, 2, 593, 580, 3, 2, 2, 2, 593, 581, 3, 2, 2, 2, 594, 596, 3, 2, 2, 2, 595, 597, 9, 3, 2, 2, 596, 595, 3, 2, 2, 2, 596, 597, 3, 2, 2, 2, 597, 104, 3, 2, 2, 2, 598, 599, 7, 50, 2, 2, 599, 600, 9, 4, 2, 2, 600, 608, 9, 5, 2, 2, 601, 603, 9, 6, 2, 2, 602, 601, 3, 2, 2, 2, 603, 606, 3, 2, 2, 2, 604, 602, 3, 2, 2, 2, 604, 605, 3, 2, 2, 2, 605, 607, 3, 2, 2, 2, 606, 604, 3, 2, 2, 2, 607, 609, 9, 5, 2, 2, 608, 604, 3, 2, 2, 2, 608, 609, 3, 2, 2, 2, 609, 611, 3, 2, 2, 2, 610, 612, 9, 3, 2, 2, 611, 610, 3, 2, 2, 2, 611, 612, 3, 2, 2, 2, 612, 106, 3, 2, 2, 2, 613, 617, 7, 50, 2, 2, 614, 616, 7, 97, 2, 2, 615, 614, 3, 2, 2, 2, 616, 619, 3, 2, 2, 2, 617, 615, 3, 2, 2, 2, 617, 618, 3, 2, 2, 2, 618, 620, 3, 2, 2, 2, 619, 617, 3, 2, 2, 2, 620, 628, 9, 7, 2, 2, 621, 623, 9, 8, 2, 2, 622, 621, 3, 2, 2, 2, 623, 626, 3, 2, 2, 2, 624, 622, 3, 2, 2, 2, 624, 625, 3, 2, 2, 2, 625, 627, 3, 2, 2, 2, 626, 624, 3, 2, 2, 2, 627, 629, 9, 7, 2, 2, 628, 624, 3, 2, 2, 2, 628, 629, 3, 2, 2, 2, 629, 631, 3, 2, 2, 2, 630, 632, 9, 3, 2, 2, 631, 630, 3, 2, 2, 2, 631, 632, 3, 2, 2, 2, 632, 108, 3, 2, 2, 2, 633, 634, 7, 50, 2, 2, 634, 635, 9, 9, 2, 2, 635, 643, 9, 10, 2, 2, 636, 638, 9, 11, 2, 2, 637, 636, 3, 2, 2, 2, 638, 641, 3, 2, 2, 2, 639, 637, 3, 2, 2, 2, 639, 640, 3, 2, 2, 2, 640, 642, 3, 2, 2, 2, 641, 639, 3, 2, 2, 2, 642, 644, 9, 10, 2, 2, 643, 639, 3, 2, 2, 2, 643, 644, 3, 2, 2, 2, 644, 646, 3, 2, 2, 2, 645, 647, 9, 3, 2, 2, 646, 645, 3, 2, 2, 2, 646, 647, 3, 2, 2, 2, 647, 110, 3, 2, 2, 2, 648, 649, 5, 235, 118, 2, 649, 651, 7, 48, 2, 2, 650, 652, 5, 235, 118, 2, 651, 650, 3, 2, 2, 2, 651, 652, 3, 2, 2, 2, 652, 656, 3, 2, 2, 2, 653, 654, 7, 48, 2, 2, 654, 656, 5, 235, 118, 2, 655, 648, 3, 2, 2, 2, 655, 653, 3, 2, 2, 2, 656, 658, 3, 2, 2, 2, 657, 659, 5, 227, 114, 2, 658, 657, 3, 2, 2, 2, 658, 659, 3, 2, 2, 2, 659, 661, 3, 2, 2, 2, 660, 662, 9, 12, 2, 2, 661, 660, 3, 2, 2, 2, 661, 662, 3, 2, 2, 2, 662, 672, 3, 2, 2, 2, 663, 669, 5, 235, 118, 2, 664, 666, 5, 227, 114, 2, 665, 667, 9, 12, 2, 2, 666, 665, 3, 2, 2, 2, 666, 667, 3, 2, 2, 2, 667, 670, 3, 2, 2, 2, 668, 670, 9, 12, 2, 2, 669, 664, 3, 2, 2, 2, 669, 668, 3, 2, 2, 2, 670, 672, 3, 2, 2, 2, 671, 655, 3, 2, 2, 2, 671, 663, 3, 2, 2, 2, 672, 112, 3, 2, 2, 2, 673, 674, 7, 50, 2, 2, 674, 684, 9, 4, 2, 2, 675, 677, 5, 231, 116, 2, 676, 678, 7, 48, 2, 2, 677, 676, 3, 2, 2, 2, 677, 678, 3, 2, 2, 2, 678, 685, 3, 2, 2, 2, 679, 681, 5, 231, 116, 2, 680, 679, 3, 2, 2, 2, 680, 681, 3, 2, 2, 2, 681, 682, 3, 2, 2, 2, 682, 683, 7, 48, 2, 2, 683, 685, 5, 231, 116, 2, 684, 675, 3, 2, 2, 2, 684, 680, 3, 2, 2, 2, 685, 686, 3, 2, 2, 2, 686, 688, 9, 13, 2, 2, 687, 689, 9, 14, 2, 2, 688, 687, 3, 2, 2, 2, 688, 689, 3, 2, 2, 2, 689, 690, 3, 2, 2, 2, 690, 692, 5, 235, 118, 2, 691, 693, 9, 12, 2, 2, 692, 691, 3, 2, 2, 2, 692, 693, 3, 2, 2, 2, 693, 114, 3, 2, 2, 2, 694, 695, 7, 118, 2, 2, 695, 696, 7, 116, 2, 2, 696, 697, 7, 119, 2, 2, 697, 704, 7, 103, 2, 2, 698, 699, 7, 104, 2, 2, 699, 700, 7, 99, 2, 2, 700, 701, 7, 110, 2, 2, 701, 702, 7, 117, 2, 2, 702, 704, 7, 103, 2, 2, 703, 694, 3, 2, 2, 2, 703, 698, 3, 2, 2, 2, 704, 116, 3, 2, 2, 2, 705, 708, 7, 41, 2, 2, 706, 709, 10, 15, 2, 2, 707, 709, 5, 229, 115, 2, 708, 706, 3, 2, 2, 2, 708, 707, 3, 2, 2, 2, 709, 710, 3, 2, 2, 2, 710, 711, 7, 41, 2, 2, 711, 118, 3, 2, 2, 2, 712, 717, 7, 36, 2, 2, 713, 716, 10, 16, 2, 2, 714, 716, 5, 229, 115, 2, 715, 713, 3, 2, 2, 2, 715, 714, 3, 2, 2, 2, 716, 719, 3, 2, 2, 2, 717, 715, 3, 2, 2, 2, 717, 718, 3, 2, 2, 2, 718, 720, 3, 2, 2, 2, 719, 717, 3, 2, 2, 2, 720, 721, 7, 36, 2, 2, 721, 120, 3, 2, 2, 2, 722, 723, 7, 112, 2, 2, 723, 724, 7, 119, 2, 2, 724, 725, 7, 110, 2, 2, 725, 726, 7, 110, 2, 2, 726, 122, 3, 2, 2, 2, 727, 728, 7, 42, 2, 2, 728, 124, 3, 2, 2, 2, 729, 730, 7, 43, 2, 2, 730, 126, 3, 2, 2, 2, 731, 732, 7, 125, 2, 2, 732, 128, 3, 2, 2, 2, 733, 734, 7, 127, 2, 2, 734, 130, 3, 2, 2, 2, 735, 736, 7, 93, 2, 2, 736, 132, 3, 2, 2, 2, 737, 738, 7, 95, 2, 2, 738, 134, 3, 2, 2, 2, 739, 740, 7, 61, 2, 2, 740, 136, 3, 2, 2, 2, 741, 742, 7, 46, 2, 2, 742, 138, 3, 2, 2, 2, 743, 744, 7, 48, 2, 2, 744, 140, 3, 2, 2, 2, 745, 746, 7, 63, 2, 2, 746, 142, 3, 2, 2, 2, 747, 748, 7, 64, 2, 2, 748, 144, 3, 2, 2, 2, 749, 750, 7, 62, 2, 2, 750, 146, 3, 2, 2, 2, 751, 752, 7, 35, 2, 2, 752, 148, 3, 2, 2, 2, 753, 754, 7, 128, 2, 2, 754, 150, 3, 2, 2, 2, 755, 756, 7, 65, 2, 2, 756, 152, 3, 2, 2, 2, 757, 758, 7, 60, 2, 2, 758, 154, 3, 2, 2, 2, 759, 760, 7, 63, 2, 2, 760, 761, 7, 63, 2, 2, 761, 156, 3, 2, 2, 2, 762, 763, 7, 62, 2, 2, 763, 764, 7, 63, 2, 2, 764, 158, 3, 2, 2, 2, 765, 766, 7, 64, 2, 2, 766, 767, 7, 63, 2, 2, 767, 160, 3, 2, 2, 2, 768, 769, 7, 35, 2, 2, 769, 770, 7, 63, 2, 2, 770, 162, 3, 2, 2, 2, 771, 772, 7, 40, 2, 2, 772, 773, 7, 40, 2, 2, 773, 164, 3, 2, 2, 2, 774, 775, 7, 126, 2, 2, 775, 776, 7, 126, 2, 2, 776, 166, 3, 2, 2, 2, 777, 778, 7, 45, 2, 2, 778, 779, 7, 45, 2, 2, 779, 168, 3, 2, 2, 2, 780, 781, 7, 47, 2, 2, 781, 782, 7, 47, 2, 2, 782, 170, 3, 2, 2, 2, 783, 784, 7, 45, 2, 2, 784, 172, 3, 2, 2, 2, 785, 786, 7, 47, 2, 2, 786, 174, 3, 2, 2, 2, 787, 788, 7, 44, 2, 2, 788, 176, 3, 2, 2, 2, 789, 790, 7, 49, 2, 2, 790, 178, 3, 2, 2, 2, 791, 792, 7, 40, 2, 2, 792, 180, 3, 2, 2, 2, 793, 794, 7, 126, 2, 2, 794, 182, 3, 2, 2, 2, 795, 796, 7, 96, 2, 2, 796, 184, 3, 2, 2, 2, 797, 798, 7, 39, 2, 2, 798, 186, 3, 2, 2, 2, 799, 800, 7, 45, 2, 2, 800, 801, 7, 63, 2, 2, 801, 188, 3, 2, 2, 2, 802, 803, 7, 47, 2, 2, 803, 804, 7, 63, 2, 2, 804, 190, 3, 2, 2, 2, 805, 806, 7, 44, 2, 2, 806, 807, 7, 63, 2, 2, 807, 192, 3, 2, 2, 2, 808, 809, 7, 49, 2, 2, 809, 810, 7, 63, 2, 2, 810, 194, 3, 2, 2, 2, 811, 812, 7, 40, 2, 2, 812, 813, 7, 63, 2, 2, 813, 196, 3, 2, 2, 2, 814, 815, 7, 126, 2, 2, 815, 816, 7, 63, 2, 2, 816, 198, 3, 2, 2, 2, 817, 818, 7, 96, 2, 2, 818, 819, 7, 63, 2, 2, 819, 200, 3, 2, 2, 2, 820, 821, 7, 39, 2, 2, 821, 822, 7, 63, 2, 2, 822, 202, 3, 2, 2, 2, 823, 824, 7, 62, 2, 2, 824, 825, 7, 62, 2, 2, 825, 826, 7, 63, 2, 2, 826, 204, 3, 2, 2, 2, 827, 828, 7, 64, 2, 2, 828, 829, 7, 64, 2, 2, 829, 830, 7, 63, 2, 2, 830, 206, 3, 2, 2, 2, 831, 832, 7, 64, 2, 2, 832, 833, 7, 64, 2, 2, 833, 834, 7, 64, 2, 2, 834, 835, 7, 63, 2, 2, 835, 208, 3, 2, 2, 2, 836, 837, 7, 47, 2, 2, 837, 838, 7, 64, 2, 2, 838, 210, 3, 2, 2, 2, 839, 840, 7, 60, 2, 2, 840, 841, 7, 60, 2, 2, 841, 212, 3, 2, 2, 2, 842, 843, 7, 66, 2, 2, 843, 214, 3, 2, 2, 2, 844, 845, 7, 48, 2, 2, 845, 846, 7, 48, 2, 2, 846, 847, 7, 48, 2, 2, 847, 216, 3, 2, 2, 2, 848, 850, 9, 17, 2, 2, 849, 848, 3, 2, 2, 2, 850, 851, 3, 2, 2, 2, 851, 849, 3, 2, 2, 2, 851, 852, 3, 2, 2, 2, 852, 853, 3, 2, 2, 2, 853, 854, 8, 109, 2, 2, 854, 218, 3, 2, 2, 2, 855, 856, 7, 49, 2, 2, 856, 857, 7, 44, 2, 2, 857, 861, 3, 2, 2, 2, 858, 860, 11, 2, 2, 2, 859, 858, 3, 2, 2, 2, 860, 863, 3, 2, 2, 2, 861, 862, 3, 2, 2, 2, 861, 859, 3, 2, 2, 2, 862, 864, 3, 2, 2, 2, 863, 861, 3, 2, 2, 2, 864, 865, 7, 44, 2, 2, 865, 866, 7, 49, 2, 2, 866, 867, 3, 2, 2, 2, 867, 868, 8, 110, 2, 2, 868, 220, 3, 2, 2, 2, 869, 870, 7, 49, 2, 2, 870, 871, 7, 49, 2, 2, 871, 875, 3, 2, 2, 2, 872, 874, 10, 18, 2, 2, 873, 872, 3, 2, 2, 2, 874, 877, 3, 2, 2, 2, 875, 873, 3, 2, 2, 2, 875, 876, 3, 2, 2, 2, 876, 878, 3, 2, 2, 2, 877, 875, 3, 2, 2, 2, 878, 879, 8, 111, 2, 2, 879, 222, 3, 2, 2, 2, 880, 881, 7, 49, 2, 2, 881, 882, 7, 44, 2, 2, 882, 883, 7, 44, 2, 2, 883, 887, 3, 2, 2, 2, 884, 886, 11, 2, 2, 2, 885, 884, 3, 2, 2, 2, 886, 889, 3, 2, 2, 2, 887, 888, 3, 2, 2, 2, 887, 885, 3, 2, 2, 2, 888, 890, 3, 2, 2, 2, 889, 887, 3, 2, 2, 2, 890, 891, 7, 44, 2, 2, 891, 892, 7, 49, 2, 2, 892, 893, 3, 2, 2, 2, 893, 894, 8, 112, 2, 2, 894, 224, 3, 2, 2, 2, 895, 899, 5, 239, 120, 2, 896, 898, 5, 237, 119, 2, 897, 896, 3, 2, 2, 2, 898, 901, 3, 2, 2, 2, 899, 897, 3, 2, 2, 2, 899, 900, 3, 2, 2, 2, 900, 226, 3, 2, 2, 2, 901, 899, 3, 2, 2, 2, 902, 904, 9, 19, 2, 2, 903, 905, 9, 14, 2, 2, 904, 903, 3, 2, 2, 2, 904, 905, 3, 2, 2, 2, 905, 906, 3, 2, 2, 2, 906, 907, 5, 235, 118, 2, 907, 228, 3, 2, 2, 2, 908, 909, 7, 94, 2, 2, 909, 930, 9, 20, 2, 2, 910, 915, 7, 94, 2, 2, 911, 913, 9, 21, 2, 2, 912, 911, 3, 2, 2, 2, 912, 913, 3, 2, 2, 2, 913, 914, 3, 2, 2, 2, 914, 916, 9, 7, 2, 2, 915, 912, 3, 2, 2, 2, 915, 916, 3, 2, 2, 2, 916, 917, 3, 2, 2, 2, 917, 930, 9, 7, 2, 2, 918, 920, 7, 94, 2, 2, 919, 921, 7, 119, 2, 2, 920, 919, 3, 2, 2, 2, 921, 922, 3, 2, 2, 2, 922, 920, 3, 2, 2, 2, 922, 923, 3, 2, 2, 2, 923, 924, 3, 2, 2, 2, 924, 925, 5, 233, 117, 2, 925, 926, 5, 233, 117, 2, 926, 927, 5, 233, 117, 2, 927, 928, 5, 233, 117, 2, 928, 930, 3, 2, 2, 2, 929, 908, 3, 2, 2, 2, 929, 910, 3, 2, 2, 2, 929, 918, 3, 2, 2, 2, 930, 230, 3, 2, 2, 2, 931, 940, 5, 233, 117, 2, 932, 935, 5, 233, 117, 2, 933, 935, 7, 97, 2, 2, 934, 932, 3, 2, 2, 2, 934, 933, 3, 2, 2, 2, 935, 938, 3, 2, 2, 2, 936, 934, 3, 2, 2, 2, 936, 937, 3, 2, 2, 2, 937, 939, 3, 2, 2, 2, 938, 936, 3, 2, 2, 2, 939, 941, 5, 233, 117, 2, 940, 936, 3, 2, 2, 2, 940, 941, 3, 2, 2, 2, 941, 232, 3, 2, 2, 2, 942, 943, 9, 5, 2, 2, 943, 234, 3, 2, 2, 2, 944, 952, 9, 22, 2, 2, 945, 947, 9, 23, 2, 2, 946, 945, 3, 2, 2, 2, 947, 950, 3, 2, 2, 2, 948, 946, 3, 2, 2, 2, 948, 949, 3, 2, 2, 2, 949, 951, 3, 2, 2, 2, 950, 948, 3, 2, 2, 2, 951, 953, 9, 22, 2, 2, 952, 948, 3, 2, 2, 2, 952, 953, 3, 2, 2, 2, 953, 236, 3, 2, 2, 2, 954, 957, 5, 239, 120, 2, 955, 957, 9, 22, 2, 2, 956, 954, 3, 2, 2, 2, 956, 955, 3, 2, 2, 2, 957, 238, 3, 2, 2, 2, 958, 963, 9, 24, 2, 2, 959, 963, 10, 25, 2, 2, 960, 961, 9, 26, 2, 2, 961, 963, 9, 27, 2, 2, 962, 958, 3, 2, 2, 2, 962, 959, 3, 2, 2, 2, 962, 960, 3, 2, 2, 2, 963, 240, 3, 2, 2, 2, 51, 2, 583, 588, 591, 593, 596, 604, 608, 611, 617, 624, 628, 631, 639, 643, 646, 651, 655, 658, 661, 666, 669, 671, 677, 680, 684, 688, 692, 703, 708, 715, 717, 851, 861, 875, 887, 899, 904, 912, 915, 922, 929, 934, 936, 940, 948, 952, 956, 962, 3, 2, 3, 2] -------------------------------------------------------------------------------- /decaf2many/lang/JavaParserListener.py: -------------------------------------------------------------------------------- 1 | # Generated from JavaParser.g4 by ANTLR 4.7.2 2 | from antlr4 import * 3 | if __name__ is not None and "." in __name__: 4 | from .JavaParser import JavaParser 5 | else: 6 | from JavaParser import JavaParser 7 | 8 | # This class defines a complete listener for a parse tree produced by JavaParser. 9 | class JavaParserListener(ParseTreeListener): 10 | 11 | # Enter a parse tree produced by JavaParser#compilationUnit. 12 | def enterCompilationUnit(self, ctx:JavaParser.CompilationUnitContext): 13 | pass 14 | 15 | # Exit a parse tree produced by JavaParser#compilationUnit. 16 | def exitCompilationUnit(self, ctx:JavaParser.CompilationUnitContext): 17 | pass 18 | 19 | 20 | # Enter a parse tree produced by JavaParser#packageDeclaration. 21 | def enterPackageDeclaration(self, ctx:JavaParser.PackageDeclarationContext): 22 | pass 23 | 24 | # Exit a parse tree produced by JavaParser#packageDeclaration. 25 | def exitPackageDeclaration(self, ctx:JavaParser.PackageDeclarationContext): 26 | pass 27 | 28 | 29 | # Enter a parse tree produced by JavaParser#importDeclaration. 30 | def enterImportDeclaration(self, ctx:JavaParser.ImportDeclarationContext): 31 | pass 32 | 33 | # Exit a parse tree produced by JavaParser#importDeclaration. 34 | def exitImportDeclaration(self, ctx:JavaParser.ImportDeclarationContext): 35 | pass 36 | 37 | 38 | # Enter a parse tree produced by JavaParser#typeDeclaration. 39 | def enterTypeDeclaration(self, ctx:JavaParser.TypeDeclarationContext): 40 | pass 41 | 42 | # Exit a parse tree produced by JavaParser#typeDeclaration. 43 | def exitTypeDeclaration(self, ctx:JavaParser.TypeDeclarationContext): 44 | pass 45 | 46 | 47 | # Enter a parse tree produced by JavaParser#modifier. 48 | def enterModifier(self, ctx:JavaParser.ModifierContext): 49 | pass 50 | 51 | # Exit a parse tree produced by JavaParser#modifier. 52 | def exitModifier(self, ctx:JavaParser.ModifierContext): 53 | pass 54 | 55 | 56 | # Enter a parse tree produced by JavaParser#classOrInterfaceModifier. 57 | def enterClassOrInterfaceModifier(self, ctx:JavaParser.ClassOrInterfaceModifierContext): 58 | pass 59 | 60 | # Exit a parse tree produced by JavaParser#classOrInterfaceModifier. 61 | def exitClassOrInterfaceModifier(self, ctx:JavaParser.ClassOrInterfaceModifierContext): 62 | pass 63 | 64 | 65 | # Enter a parse tree produced by JavaParser#variableModifier. 66 | def enterVariableModifier(self, ctx:JavaParser.VariableModifierContext): 67 | pass 68 | 69 | # Exit a parse tree produced by JavaParser#variableModifier. 70 | def exitVariableModifier(self, ctx:JavaParser.VariableModifierContext): 71 | pass 72 | 73 | 74 | # Enter a parse tree produced by JavaParser#classDeclaration. 75 | def enterClassDeclaration(self, ctx:JavaParser.ClassDeclarationContext): 76 | pass 77 | 78 | # Exit a parse tree produced by JavaParser#classDeclaration. 79 | def exitClassDeclaration(self, ctx:JavaParser.ClassDeclarationContext): 80 | pass 81 | 82 | 83 | # Enter a parse tree produced by JavaParser#typeParameters. 84 | def enterTypeParameters(self, ctx:JavaParser.TypeParametersContext): 85 | pass 86 | 87 | # Exit a parse tree produced by JavaParser#typeParameters. 88 | def exitTypeParameters(self, ctx:JavaParser.TypeParametersContext): 89 | pass 90 | 91 | 92 | # Enter a parse tree produced by JavaParser#typeParameter. 93 | def enterTypeParameter(self, ctx:JavaParser.TypeParameterContext): 94 | pass 95 | 96 | # Exit a parse tree produced by JavaParser#typeParameter. 97 | def exitTypeParameter(self, ctx:JavaParser.TypeParameterContext): 98 | pass 99 | 100 | 101 | # Enter a parse tree produced by JavaParser#typeBound. 102 | def enterTypeBound(self, ctx:JavaParser.TypeBoundContext): 103 | pass 104 | 105 | # Exit a parse tree produced by JavaParser#typeBound. 106 | def exitTypeBound(self, ctx:JavaParser.TypeBoundContext): 107 | pass 108 | 109 | 110 | # Enter a parse tree produced by JavaParser#enumDeclaration. 111 | def enterEnumDeclaration(self, ctx:JavaParser.EnumDeclarationContext): 112 | pass 113 | 114 | # Exit a parse tree produced by JavaParser#enumDeclaration. 115 | def exitEnumDeclaration(self, ctx:JavaParser.EnumDeclarationContext): 116 | pass 117 | 118 | 119 | # Enter a parse tree produced by JavaParser#enumConstants. 120 | def enterEnumConstants(self, ctx:JavaParser.EnumConstantsContext): 121 | pass 122 | 123 | # Exit a parse tree produced by JavaParser#enumConstants. 124 | def exitEnumConstants(self, ctx:JavaParser.EnumConstantsContext): 125 | pass 126 | 127 | 128 | # Enter a parse tree produced by JavaParser#enumConstant. 129 | def enterEnumConstant(self, ctx:JavaParser.EnumConstantContext): 130 | pass 131 | 132 | # Exit a parse tree produced by JavaParser#enumConstant. 133 | def exitEnumConstant(self, ctx:JavaParser.EnumConstantContext): 134 | pass 135 | 136 | 137 | # Enter a parse tree produced by JavaParser#enumBodyDeclarations. 138 | def enterEnumBodyDeclarations(self, ctx:JavaParser.EnumBodyDeclarationsContext): 139 | pass 140 | 141 | # Exit a parse tree produced by JavaParser#enumBodyDeclarations. 142 | def exitEnumBodyDeclarations(self, ctx:JavaParser.EnumBodyDeclarationsContext): 143 | pass 144 | 145 | 146 | # Enter a parse tree produced by JavaParser#interfaceDeclaration. 147 | def enterInterfaceDeclaration(self, ctx:JavaParser.InterfaceDeclarationContext): 148 | pass 149 | 150 | # Exit a parse tree produced by JavaParser#interfaceDeclaration. 151 | def exitInterfaceDeclaration(self, ctx:JavaParser.InterfaceDeclarationContext): 152 | pass 153 | 154 | 155 | # Enter a parse tree produced by JavaParser#classBody. 156 | def enterClassBody(self, ctx:JavaParser.ClassBodyContext): 157 | pass 158 | 159 | # Exit a parse tree produced by JavaParser#classBody. 160 | def exitClassBody(self, ctx:JavaParser.ClassBodyContext): 161 | pass 162 | 163 | 164 | # Enter a parse tree produced by JavaParser#interfaceBody. 165 | def enterInterfaceBody(self, ctx:JavaParser.InterfaceBodyContext): 166 | pass 167 | 168 | # Exit a parse tree produced by JavaParser#interfaceBody. 169 | def exitInterfaceBody(self, ctx:JavaParser.InterfaceBodyContext): 170 | pass 171 | 172 | 173 | # Enter a parse tree produced by JavaParser#classBodyDeclaration. 174 | def enterClassBodyDeclaration(self, ctx:JavaParser.ClassBodyDeclarationContext): 175 | pass 176 | 177 | # Exit a parse tree produced by JavaParser#classBodyDeclaration. 178 | def exitClassBodyDeclaration(self, ctx:JavaParser.ClassBodyDeclarationContext): 179 | pass 180 | 181 | 182 | # Enter a parse tree produced by JavaParser#memberDeclaration. 183 | def enterMemberDeclaration(self, ctx:JavaParser.MemberDeclarationContext): 184 | pass 185 | 186 | # Exit a parse tree produced by JavaParser#memberDeclaration. 187 | def exitMemberDeclaration(self, ctx:JavaParser.MemberDeclarationContext): 188 | pass 189 | 190 | 191 | # Enter a parse tree produced by JavaParser#methodDeclaration. 192 | def enterMethodDeclaration(self, ctx:JavaParser.MethodDeclarationContext): 193 | pass 194 | 195 | # Exit a parse tree produced by JavaParser#methodDeclaration. 196 | def exitMethodDeclaration(self, ctx:JavaParser.MethodDeclarationContext): 197 | pass 198 | 199 | 200 | # Enter a parse tree produced by JavaParser#methodBody. 201 | def enterMethodBody(self, ctx:JavaParser.MethodBodyContext): 202 | pass 203 | 204 | # Exit a parse tree produced by JavaParser#methodBody. 205 | def exitMethodBody(self, ctx:JavaParser.MethodBodyContext): 206 | pass 207 | 208 | 209 | # Enter a parse tree produced by JavaParser#typeTypeOrVoid. 210 | def enterTypeTypeOrVoid(self, ctx:JavaParser.TypeTypeOrVoidContext): 211 | pass 212 | 213 | # Exit a parse tree produced by JavaParser#typeTypeOrVoid. 214 | def exitTypeTypeOrVoid(self, ctx:JavaParser.TypeTypeOrVoidContext): 215 | pass 216 | 217 | 218 | # Enter a parse tree produced by JavaParser#genericMethodDeclaration. 219 | def enterGenericMethodDeclaration(self, ctx:JavaParser.GenericMethodDeclarationContext): 220 | pass 221 | 222 | # Exit a parse tree produced by JavaParser#genericMethodDeclaration. 223 | def exitGenericMethodDeclaration(self, ctx:JavaParser.GenericMethodDeclarationContext): 224 | pass 225 | 226 | 227 | # Enter a parse tree produced by JavaParser#genericConstructorDeclaration. 228 | def enterGenericConstructorDeclaration(self, ctx:JavaParser.GenericConstructorDeclarationContext): 229 | pass 230 | 231 | # Exit a parse tree produced by JavaParser#genericConstructorDeclaration. 232 | def exitGenericConstructorDeclaration(self, ctx:JavaParser.GenericConstructorDeclarationContext): 233 | pass 234 | 235 | 236 | # Enter a parse tree produced by JavaParser#constructorDeclaration. 237 | def enterConstructorDeclaration(self, ctx:JavaParser.ConstructorDeclarationContext): 238 | pass 239 | 240 | # Exit a parse tree produced by JavaParser#constructorDeclaration. 241 | def exitConstructorDeclaration(self, ctx:JavaParser.ConstructorDeclarationContext): 242 | pass 243 | 244 | 245 | # Enter a parse tree produced by JavaParser#fieldDeclaration. 246 | def enterFieldDeclaration(self, ctx:JavaParser.FieldDeclarationContext): 247 | pass 248 | 249 | # Exit a parse tree produced by JavaParser#fieldDeclaration. 250 | def exitFieldDeclaration(self, ctx:JavaParser.FieldDeclarationContext): 251 | pass 252 | 253 | 254 | # Enter a parse tree produced by JavaParser#interfaceBodyDeclaration. 255 | def enterInterfaceBodyDeclaration(self, ctx:JavaParser.InterfaceBodyDeclarationContext): 256 | pass 257 | 258 | # Exit a parse tree produced by JavaParser#interfaceBodyDeclaration. 259 | def exitInterfaceBodyDeclaration(self, ctx:JavaParser.InterfaceBodyDeclarationContext): 260 | pass 261 | 262 | 263 | # Enter a parse tree produced by JavaParser#interfaceMemberDeclaration. 264 | def enterInterfaceMemberDeclaration(self, ctx:JavaParser.InterfaceMemberDeclarationContext): 265 | pass 266 | 267 | # Exit a parse tree produced by JavaParser#interfaceMemberDeclaration. 268 | def exitInterfaceMemberDeclaration(self, ctx:JavaParser.InterfaceMemberDeclarationContext): 269 | pass 270 | 271 | 272 | # Enter a parse tree produced by JavaParser#constDeclaration. 273 | def enterConstDeclaration(self, ctx:JavaParser.ConstDeclarationContext): 274 | pass 275 | 276 | # Exit a parse tree produced by JavaParser#constDeclaration. 277 | def exitConstDeclaration(self, ctx:JavaParser.ConstDeclarationContext): 278 | pass 279 | 280 | 281 | # Enter a parse tree produced by JavaParser#constantDeclarator. 282 | def enterConstantDeclarator(self, ctx:JavaParser.ConstantDeclaratorContext): 283 | pass 284 | 285 | # Exit a parse tree produced by JavaParser#constantDeclarator. 286 | def exitConstantDeclarator(self, ctx:JavaParser.ConstantDeclaratorContext): 287 | pass 288 | 289 | 290 | # Enter a parse tree produced by JavaParser#interfaceMethodDeclaration. 291 | def enterInterfaceMethodDeclaration(self, ctx:JavaParser.InterfaceMethodDeclarationContext): 292 | pass 293 | 294 | # Exit a parse tree produced by JavaParser#interfaceMethodDeclaration. 295 | def exitInterfaceMethodDeclaration(self, ctx:JavaParser.InterfaceMethodDeclarationContext): 296 | pass 297 | 298 | 299 | # Enter a parse tree produced by JavaParser#interfaceMethodModifier. 300 | def enterInterfaceMethodModifier(self, ctx:JavaParser.InterfaceMethodModifierContext): 301 | pass 302 | 303 | # Exit a parse tree produced by JavaParser#interfaceMethodModifier. 304 | def exitInterfaceMethodModifier(self, ctx:JavaParser.InterfaceMethodModifierContext): 305 | pass 306 | 307 | 308 | # Enter a parse tree produced by JavaParser#genericInterfaceMethodDeclaration. 309 | def enterGenericInterfaceMethodDeclaration(self, ctx:JavaParser.GenericInterfaceMethodDeclarationContext): 310 | pass 311 | 312 | # Exit a parse tree produced by JavaParser#genericInterfaceMethodDeclaration. 313 | def exitGenericInterfaceMethodDeclaration(self, ctx:JavaParser.GenericInterfaceMethodDeclarationContext): 314 | pass 315 | 316 | 317 | # Enter a parse tree produced by JavaParser#variableDeclarators. 318 | def enterVariableDeclarators(self, ctx:JavaParser.VariableDeclaratorsContext): 319 | pass 320 | 321 | # Exit a parse tree produced by JavaParser#variableDeclarators. 322 | def exitVariableDeclarators(self, ctx:JavaParser.VariableDeclaratorsContext): 323 | pass 324 | 325 | 326 | # Enter a parse tree produced by JavaParser#variableDeclarator. 327 | def enterVariableDeclarator(self, ctx:JavaParser.VariableDeclaratorContext): 328 | pass 329 | 330 | # Exit a parse tree produced by JavaParser#variableDeclarator. 331 | def exitVariableDeclarator(self, ctx:JavaParser.VariableDeclaratorContext): 332 | pass 333 | 334 | 335 | # Enter a parse tree produced by JavaParser#variableDeclaratorId. 336 | def enterVariableDeclaratorId(self, ctx:JavaParser.VariableDeclaratorIdContext): 337 | pass 338 | 339 | # Exit a parse tree produced by JavaParser#variableDeclaratorId. 340 | def exitVariableDeclaratorId(self, ctx:JavaParser.VariableDeclaratorIdContext): 341 | pass 342 | 343 | 344 | # Enter a parse tree produced by JavaParser#variableInitializer. 345 | def enterVariableInitializer(self, ctx:JavaParser.VariableInitializerContext): 346 | pass 347 | 348 | # Exit a parse tree produced by JavaParser#variableInitializer. 349 | def exitVariableInitializer(self, ctx:JavaParser.VariableInitializerContext): 350 | pass 351 | 352 | 353 | # Enter a parse tree produced by JavaParser#arrayInitializer. 354 | def enterArrayInitializer(self, ctx:JavaParser.ArrayInitializerContext): 355 | pass 356 | 357 | # Exit a parse tree produced by JavaParser#arrayInitializer. 358 | def exitArrayInitializer(self, ctx:JavaParser.ArrayInitializerContext): 359 | pass 360 | 361 | 362 | # Enter a parse tree produced by JavaParser#classOrInterfaceType. 363 | def enterClassOrInterfaceType(self, ctx:JavaParser.ClassOrInterfaceTypeContext): 364 | pass 365 | 366 | # Exit a parse tree produced by JavaParser#classOrInterfaceType. 367 | def exitClassOrInterfaceType(self, ctx:JavaParser.ClassOrInterfaceTypeContext): 368 | pass 369 | 370 | 371 | # Enter a parse tree produced by JavaParser#typeArgument. 372 | def enterTypeArgument(self, ctx:JavaParser.TypeArgumentContext): 373 | pass 374 | 375 | # Exit a parse tree produced by JavaParser#typeArgument. 376 | def exitTypeArgument(self, ctx:JavaParser.TypeArgumentContext): 377 | pass 378 | 379 | 380 | # Enter a parse tree produced by JavaParser#qualifiedNameList. 381 | def enterQualifiedNameList(self, ctx:JavaParser.QualifiedNameListContext): 382 | pass 383 | 384 | # Exit a parse tree produced by JavaParser#qualifiedNameList. 385 | def exitQualifiedNameList(self, ctx:JavaParser.QualifiedNameListContext): 386 | pass 387 | 388 | 389 | # Enter a parse tree produced by JavaParser#formalParameters. 390 | def enterFormalParameters(self, ctx:JavaParser.FormalParametersContext): 391 | pass 392 | 393 | # Exit a parse tree produced by JavaParser#formalParameters. 394 | def exitFormalParameters(self, ctx:JavaParser.FormalParametersContext): 395 | pass 396 | 397 | 398 | # Enter a parse tree produced by JavaParser#formalParameterList. 399 | def enterFormalParameterList(self, ctx:JavaParser.FormalParameterListContext): 400 | pass 401 | 402 | # Exit a parse tree produced by JavaParser#formalParameterList. 403 | def exitFormalParameterList(self, ctx:JavaParser.FormalParameterListContext): 404 | pass 405 | 406 | 407 | # Enter a parse tree produced by JavaParser#formalParameter. 408 | def enterFormalParameter(self, ctx:JavaParser.FormalParameterContext): 409 | pass 410 | 411 | # Exit a parse tree produced by JavaParser#formalParameter. 412 | def exitFormalParameter(self, ctx:JavaParser.FormalParameterContext): 413 | pass 414 | 415 | 416 | # Enter a parse tree produced by JavaParser#lastFormalParameter. 417 | def enterLastFormalParameter(self, ctx:JavaParser.LastFormalParameterContext): 418 | pass 419 | 420 | # Exit a parse tree produced by JavaParser#lastFormalParameter. 421 | def exitLastFormalParameter(self, ctx:JavaParser.LastFormalParameterContext): 422 | pass 423 | 424 | 425 | # Enter a parse tree produced by JavaParser#qualifiedName. 426 | def enterQualifiedName(self, ctx:JavaParser.QualifiedNameContext): 427 | pass 428 | 429 | # Exit a parse tree produced by JavaParser#qualifiedName. 430 | def exitQualifiedName(self, ctx:JavaParser.QualifiedNameContext): 431 | pass 432 | 433 | 434 | # Enter a parse tree produced by JavaParser#literal. 435 | def enterLiteral(self, ctx:JavaParser.LiteralContext): 436 | pass 437 | 438 | # Exit a parse tree produced by JavaParser#literal. 439 | def exitLiteral(self, ctx:JavaParser.LiteralContext): 440 | pass 441 | 442 | 443 | # Enter a parse tree produced by JavaParser#integerLiteral. 444 | def enterIntegerLiteral(self, ctx:JavaParser.IntegerLiteralContext): 445 | pass 446 | 447 | # Exit a parse tree produced by JavaParser#integerLiteral. 448 | def exitIntegerLiteral(self, ctx:JavaParser.IntegerLiteralContext): 449 | pass 450 | 451 | 452 | # Enter a parse tree produced by JavaParser#floatLiteral. 453 | def enterFloatLiteral(self, ctx:JavaParser.FloatLiteralContext): 454 | pass 455 | 456 | # Exit a parse tree produced by JavaParser#floatLiteral. 457 | def exitFloatLiteral(self, ctx:JavaParser.FloatLiteralContext): 458 | pass 459 | 460 | 461 | # Enter a parse tree produced by JavaParser#altAnnotationQualifiedName. 462 | def enterAltAnnotationQualifiedName(self, ctx:JavaParser.AltAnnotationQualifiedNameContext): 463 | pass 464 | 465 | # Exit a parse tree produced by JavaParser#altAnnotationQualifiedName. 466 | def exitAltAnnotationQualifiedName(self, ctx:JavaParser.AltAnnotationQualifiedNameContext): 467 | pass 468 | 469 | 470 | # Enter a parse tree produced by JavaParser#annotation. 471 | def enterAnnotation(self, ctx:JavaParser.AnnotationContext): 472 | pass 473 | 474 | # Exit a parse tree produced by JavaParser#annotation. 475 | def exitAnnotation(self, ctx:JavaParser.AnnotationContext): 476 | pass 477 | 478 | 479 | # Enter a parse tree produced by JavaParser#elementValuePairs. 480 | def enterElementValuePairs(self, ctx:JavaParser.ElementValuePairsContext): 481 | pass 482 | 483 | # Exit a parse tree produced by JavaParser#elementValuePairs. 484 | def exitElementValuePairs(self, ctx:JavaParser.ElementValuePairsContext): 485 | pass 486 | 487 | 488 | # Enter a parse tree produced by JavaParser#elementValuePair. 489 | def enterElementValuePair(self, ctx:JavaParser.ElementValuePairContext): 490 | pass 491 | 492 | # Exit a parse tree produced by JavaParser#elementValuePair. 493 | def exitElementValuePair(self, ctx:JavaParser.ElementValuePairContext): 494 | pass 495 | 496 | 497 | # Enter a parse tree produced by JavaParser#elementValue. 498 | def enterElementValue(self, ctx:JavaParser.ElementValueContext): 499 | pass 500 | 501 | # Exit a parse tree produced by JavaParser#elementValue. 502 | def exitElementValue(self, ctx:JavaParser.ElementValueContext): 503 | pass 504 | 505 | 506 | # Enter a parse tree produced by JavaParser#elementValueArrayInitializer. 507 | def enterElementValueArrayInitializer(self, ctx:JavaParser.ElementValueArrayInitializerContext): 508 | pass 509 | 510 | # Exit a parse tree produced by JavaParser#elementValueArrayInitializer. 511 | def exitElementValueArrayInitializer(self, ctx:JavaParser.ElementValueArrayInitializerContext): 512 | pass 513 | 514 | 515 | # Enter a parse tree produced by JavaParser#annotationTypeDeclaration. 516 | def enterAnnotationTypeDeclaration(self, ctx:JavaParser.AnnotationTypeDeclarationContext): 517 | pass 518 | 519 | # Exit a parse tree produced by JavaParser#annotationTypeDeclaration. 520 | def exitAnnotationTypeDeclaration(self, ctx:JavaParser.AnnotationTypeDeclarationContext): 521 | pass 522 | 523 | 524 | # Enter a parse tree produced by JavaParser#annotationTypeBody. 525 | def enterAnnotationTypeBody(self, ctx:JavaParser.AnnotationTypeBodyContext): 526 | pass 527 | 528 | # Exit a parse tree produced by JavaParser#annotationTypeBody. 529 | def exitAnnotationTypeBody(self, ctx:JavaParser.AnnotationTypeBodyContext): 530 | pass 531 | 532 | 533 | # Enter a parse tree produced by JavaParser#annotationTypeElementDeclaration. 534 | def enterAnnotationTypeElementDeclaration(self, ctx:JavaParser.AnnotationTypeElementDeclarationContext): 535 | pass 536 | 537 | # Exit a parse tree produced by JavaParser#annotationTypeElementDeclaration. 538 | def exitAnnotationTypeElementDeclaration(self, ctx:JavaParser.AnnotationTypeElementDeclarationContext): 539 | pass 540 | 541 | 542 | # Enter a parse tree produced by JavaParser#annotationTypeElementRest. 543 | def enterAnnotationTypeElementRest(self, ctx:JavaParser.AnnotationTypeElementRestContext): 544 | pass 545 | 546 | # Exit a parse tree produced by JavaParser#annotationTypeElementRest. 547 | def exitAnnotationTypeElementRest(self, ctx:JavaParser.AnnotationTypeElementRestContext): 548 | pass 549 | 550 | 551 | # Enter a parse tree produced by JavaParser#annotationMethodOrConstantRest. 552 | def enterAnnotationMethodOrConstantRest(self, ctx:JavaParser.AnnotationMethodOrConstantRestContext): 553 | pass 554 | 555 | # Exit a parse tree produced by JavaParser#annotationMethodOrConstantRest. 556 | def exitAnnotationMethodOrConstantRest(self, ctx:JavaParser.AnnotationMethodOrConstantRestContext): 557 | pass 558 | 559 | 560 | # Enter a parse tree produced by JavaParser#annotationMethodRest. 561 | def enterAnnotationMethodRest(self, ctx:JavaParser.AnnotationMethodRestContext): 562 | pass 563 | 564 | # Exit a parse tree produced by JavaParser#annotationMethodRest. 565 | def exitAnnotationMethodRest(self, ctx:JavaParser.AnnotationMethodRestContext): 566 | pass 567 | 568 | 569 | # Enter a parse tree produced by JavaParser#annotationConstantRest. 570 | def enterAnnotationConstantRest(self, ctx:JavaParser.AnnotationConstantRestContext): 571 | pass 572 | 573 | # Exit a parse tree produced by JavaParser#annotationConstantRest. 574 | def exitAnnotationConstantRest(self, ctx:JavaParser.AnnotationConstantRestContext): 575 | pass 576 | 577 | 578 | # Enter a parse tree produced by JavaParser#defaultValue. 579 | def enterDefaultValue(self, ctx:JavaParser.DefaultValueContext): 580 | pass 581 | 582 | # Exit a parse tree produced by JavaParser#defaultValue. 583 | def exitDefaultValue(self, ctx:JavaParser.DefaultValueContext): 584 | pass 585 | 586 | 587 | # Enter a parse tree produced by JavaParser#block. 588 | def enterBlock(self, ctx:JavaParser.BlockContext): 589 | pass 590 | 591 | # Exit a parse tree produced by JavaParser#block. 592 | def exitBlock(self, ctx:JavaParser.BlockContext): 593 | pass 594 | 595 | 596 | # Enter a parse tree produced by JavaParser#blockStatement. 597 | def enterBlockStatement(self, ctx:JavaParser.BlockStatementContext): 598 | pass 599 | 600 | # Exit a parse tree produced by JavaParser#blockStatement. 601 | def exitBlockStatement(self, ctx:JavaParser.BlockStatementContext): 602 | pass 603 | 604 | 605 | # Enter a parse tree produced by JavaParser#localVariableDeclaration. 606 | def enterLocalVariableDeclaration(self, ctx:JavaParser.LocalVariableDeclarationContext): 607 | pass 608 | 609 | # Exit a parse tree produced by JavaParser#localVariableDeclaration. 610 | def exitLocalVariableDeclaration(self, ctx:JavaParser.LocalVariableDeclarationContext): 611 | pass 612 | 613 | 614 | # Enter a parse tree produced by JavaParser#localTypeDeclaration. 615 | def enterLocalTypeDeclaration(self, ctx:JavaParser.LocalTypeDeclarationContext): 616 | pass 617 | 618 | # Exit a parse tree produced by JavaParser#localTypeDeclaration. 619 | def exitLocalTypeDeclaration(self, ctx:JavaParser.LocalTypeDeclarationContext): 620 | pass 621 | 622 | 623 | # Enter a parse tree produced by JavaParser#statement. 624 | def enterStatement(self, ctx:JavaParser.StatementContext): 625 | pass 626 | 627 | # Exit a parse tree produced by JavaParser#statement. 628 | def exitStatement(self, ctx:JavaParser.StatementContext): 629 | pass 630 | 631 | 632 | # Enter a parse tree produced by JavaParser#catchClause. 633 | def enterCatchClause(self, ctx:JavaParser.CatchClauseContext): 634 | pass 635 | 636 | # Exit a parse tree produced by JavaParser#catchClause. 637 | def exitCatchClause(self, ctx:JavaParser.CatchClauseContext): 638 | pass 639 | 640 | 641 | # Enter a parse tree produced by JavaParser#catchType. 642 | def enterCatchType(self, ctx:JavaParser.CatchTypeContext): 643 | pass 644 | 645 | # Exit a parse tree produced by JavaParser#catchType. 646 | def exitCatchType(self, ctx:JavaParser.CatchTypeContext): 647 | pass 648 | 649 | 650 | # Enter a parse tree produced by JavaParser#finallyBlock. 651 | def enterFinallyBlock(self, ctx:JavaParser.FinallyBlockContext): 652 | pass 653 | 654 | # Exit a parse tree produced by JavaParser#finallyBlock. 655 | def exitFinallyBlock(self, ctx:JavaParser.FinallyBlockContext): 656 | pass 657 | 658 | 659 | # Enter a parse tree produced by JavaParser#resourceSpecification. 660 | def enterResourceSpecification(self, ctx:JavaParser.ResourceSpecificationContext): 661 | pass 662 | 663 | # Exit a parse tree produced by JavaParser#resourceSpecification. 664 | def exitResourceSpecification(self, ctx:JavaParser.ResourceSpecificationContext): 665 | pass 666 | 667 | 668 | # Enter a parse tree produced by JavaParser#resources. 669 | def enterResources(self, ctx:JavaParser.ResourcesContext): 670 | pass 671 | 672 | # Exit a parse tree produced by JavaParser#resources. 673 | def exitResources(self, ctx:JavaParser.ResourcesContext): 674 | pass 675 | 676 | 677 | # Enter a parse tree produced by JavaParser#resource. 678 | def enterResource(self, ctx:JavaParser.ResourceContext): 679 | pass 680 | 681 | # Exit a parse tree produced by JavaParser#resource. 682 | def exitResource(self, ctx:JavaParser.ResourceContext): 683 | pass 684 | 685 | 686 | # Enter a parse tree produced by JavaParser#switchBlockStatementGroup. 687 | def enterSwitchBlockStatementGroup(self, ctx:JavaParser.SwitchBlockStatementGroupContext): 688 | pass 689 | 690 | # Exit a parse tree produced by JavaParser#switchBlockStatementGroup. 691 | def exitSwitchBlockStatementGroup(self, ctx:JavaParser.SwitchBlockStatementGroupContext): 692 | pass 693 | 694 | 695 | # Enter a parse tree produced by JavaParser#switchLabel. 696 | def enterSwitchLabel(self, ctx:JavaParser.SwitchLabelContext): 697 | pass 698 | 699 | # Exit a parse tree produced by JavaParser#switchLabel. 700 | def exitSwitchLabel(self, ctx:JavaParser.SwitchLabelContext): 701 | pass 702 | 703 | 704 | # Enter a parse tree produced by JavaParser#forControl. 705 | def enterForControl(self, ctx:JavaParser.ForControlContext): 706 | pass 707 | 708 | # Exit a parse tree produced by JavaParser#forControl. 709 | def exitForControl(self, ctx:JavaParser.ForControlContext): 710 | pass 711 | 712 | 713 | # Enter a parse tree produced by JavaParser#forInit. 714 | def enterForInit(self, ctx:JavaParser.ForInitContext): 715 | pass 716 | 717 | # Exit a parse tree produced by JavaParser#forInit. 718 | def exitForInit(self, ctx:JavaParser.ForInitContext): 719 | pass 720 | 721 | 722 | # Enter a parse tree produced by JavaParser#enhancedForControl. 723 | def enterEnhancedForControl(self, ctx:JavaParser.EnhancedForControlContext): 724 | pass 725 | 726 | # Exit a parse tree produced by JavaParser#enhancedForControl. 727 | def exitEnhancedForControl(self, ctx:JavaParser.EnhancedForControlContext): 728 | pass 729 | 730 | 731 | # Enter a parse tree produced by JavaParser#parExpression. 732 | def enterParExpression(self, ctx:JavaParser.ParExpressionContext): 733 | pass 734 | 735 | # Exit a parse tree produced by JavaParser#parExpression. 736 | def exitParExpression(self, ctx:JavaParser.ParExpressionContext): 737 | pass 738 | 739 | 740 | # Enter a parse tree produced by JavaParser#expressionList. 741 | def enterExpressionList(self, ctx:JavaParser.ExpressionListContext): 742 | pass 743 | 744 | # Exit a parse tree produced by JavaParser#expressionList. 745 | def exitExpressionList(self, ctx:JavaParser.ExpressionListContext): 746 | pass 747 | 748 | 749 | # Enter a parse tree produced by JavaParser#methodCall. 750 | def enterMethodCall(self, ctx:JavaParser.MethodCallContext): 751 | pass 752 | 753 | # Exit a parse tree produced by JavaParser#methodCall. 754 | def exitMethodCall(self, ctx:JavaParser.MethodCallContext): 755 | pass 756 | 757 | 758 | # Enter a parse tree produced by JavaParser#expression. 759 | def enterExpression(self, ctx:JavaParser.ExpressionContext): 760 | pass 761 | 762 | # Exit a parse tree produced by JavaParser#expression. 763 | def exitExpression(self, ctx:JavaParser.ExpressionContext): 764 | pass 765 | 766 | 767 | # Enter a parse tree produced by JavaParser#lambdaExpression. 768 | def enterLambdaExpression(self, ctx:JavaParser.LambdaExpressionContext): 769 | pass 770 | 771 | # Exit a parse tree produced by JavaParser#lambdaExpression. 772 | def exitLambdaExpression(self, ctx:JavaParser.LambdaExpressionContext): 773 | pass 774 | 775 | 776 | # Enter a parse tree produced by JavaParser#lambdaParameters. 777 | def enterLambdaParameters(self, ctx:JavaParser.LambdaParametersContext): 778 | pass 779 | 780 | # Exit a parse tree produced by JavaParser#lambdaParameters. 781 | def exitLambdaParameters(self, ctx:JavaParser.LambdaParametersContext): 782 | pass 783 | 784 | 785 | # Enter a parse tree produced by JavaParser#lambdaBody. 786 | def enterLambdaBody(self, ctx:JavaParser.LambdaBodyContext): 787 | pass 788 | 789 | # Exit a parse tree produced by JavaParser#lambdaBody. 790 | def exitLambdaBody(self, ctx:JavaParser.LambdaBodyContext): 791 | pass 792 | 793 | 794 | # Enter a parse tree produced by JavaParser#primary. 795 | def enterPrimary(self, ctx:JavaParser.PrimaryContext): 796 | pass 797 | 798 | # Exit a parse tree produced by JavaParser#primary. 799 | def exitPrimary(self, ctx:JavaParser.PrimaryContext): 800 | pass 801 | 802 | 803 | # Enter a parse tree produced by JavaParser#classType. 804 | def enterClassType(self, ctx:JavaParser.ClassTypeContext): 805 | pass 806 | 807 | # Exit a parse tree produced by JavaParser#classType. 808 | def exitClassType(self, ctx:JavaParser.ClassTypeContext): 809 | pass 810 | 811 | 812 | # Enter a parse tree produced by JavaParser#creator. 813 | def enterCreator(self, ctx:JavaParser.CreatorContext): 814 | pass 815 | 816 | # Exit a parse tree produced by JavaParser#creator. 817 | def exitCreator(self, ctx:JavaParser.CreatorContext): 818 | pass 819 | 820 | 821 | # Enter a parse tree produced by JavaParser#createdName. 822 | def enterCreatedName(self, ctx:JavaParser.CreatedNameContext): 823 | pass 824 | 825 | # Exit a parse tree produced by JavaParser#createdName. 826 | def exitCreatedName(self, ctx:JavaParser.CreatedNameContext): 827 | pass 828 | 829 | 830 | # Enter a parse tree produced by JavaParser#innerCreator. 831 | def enterInnerCreator(self, ctx:JavaParser.InnerCreatorContext): 832 | pass 833 | 834 | # Exit a parse tree produced by JavaParser#innerCreator. 835 | def exitInnerCreator(self, ctx:JavaParser.InnerCreatorContext): 836 | pass 837 | 838 | 839 | # Enter a parse tree produced by JavaParser#arrayCreatorRest. 840 | def enterArrayCreatorRest(self, ctx:JavaParser.ArrayCreatorRestContext): 841 | pass 842 | 843 | # Exit a parse tree produced by JavaParser#arrayCreatorRest. 844 | def exitArrayCreatorRest(self, ctx:JavaParser.ArrayCreatorRestContext): 845 | pass 846 | 847 | 848 | # Enter a parse tree produced by JavaParser#classCreatorRest. 849 | def enterClassCreatorRest(self, ctx:JavaParser.ClassCreatorRestContext): 850 | pass 851 | 852 | # Exit a parse tree produced by JavaParser#classCreatorRest. 853 | def exitClassCreatorRest(self, ctx:JavaParser.ClassCreatorRestContext): 854 | pass 855 | 856 | 857 | # Enter a parse tree produced by JavaParser#explicitGenericInvocation. 858 | def enterExplicitGenericInvocation(self, ctx:JavaParser.ExplicitGenericInvocationContext): 859 | pass 860 | 861 | # Exit a parse tree produced by JavaParser#explicitGenericInvocation. 862 | def exitExplicitGenericInvocation(self, ctx:JavaParser.ExplicitGenericInvocationContext): 863 | pass 864 | 865 | 866 | # Enter a parse tree produced by JavaParser#typeArgumentsOrDiamond. 867 | def enterTypeArgumentsOrDiamond(self, ctx:JavaParser.TypeArgumentsOrDiamondContext): 868 | pass 869 | 870 | # Exit a parse tree produced by JavaParser#typeArgumentsOrDiamond. 871 | def exitTypeArgumentsOrDiamond(self, ctx:JavaParser.TypeArgumentsOrDiamondContext): 872 | pass 873 | 874 | 875 | # Enter a parse tree produced by JavaParser#nonWildcardTypeArgumentsOrDiamond. 876 | def enterNonWildcardTypeArgumentsOrDiamond(self, ctx:JavaParser.NonWildcardTypeArgumentsOrDiamondContext): 877 | pass 878 | 879 | # Exit a parse tree produced by JavaParser#nonWildcardTypeArgumentsOrDiamond. 880 | def exitNonWildcardTypeArgumentsOrDiamond(self, ctx:JavaParser.NonWildcardTypeArgumentsOrDiamondContext): 881 | pass 882 | 883 | 884 | # Enter a parse tree produced by JavaParser#nonWildcardTypeArguments. 885 | def enterNonWildcardTypeArguments(self, ctx:JavaParser.NonWildcardTypeArgumentsContext): 886 | pass 887 | 888 | # Exit a parse tree produced by JavaParser#nonWildcardTypeArguments. 889 | def exitNonWildcardTypeArguments(self, ctx:JavaParser.NonWildcardTypeArgumentsContext): 890 | pass 891 | 892 | 893 | # Enter a parse tree produced by JavaParser#typeList. 894 | def enterTypeList(self, ctx:JavaParser.TypeListContext): 895 | pass 896 | 897 | # Exit a parse tree produced by JavaParser#typeList. 898 | def exitTypeList(self, ctx:JavaParser.TypeListContext): 899 | pass 900 | 901 | 902 | # Enter a parse tree produced by JavaParser#typeType. 903 | def enterTypeType(self, ctx:JavaParser.TypeTypeContext): 904 | pass 905 | 906 | # Exit a parse tree produced by JavaParser#typeType. 907 | def exitTypeType(self, ctx:JavaParser.TypeTypeContext): 908 | pass 909 | 910 | 911 | # Enter a parse tree produced by JavaParser#primitiveType. 912 | def enterPrimitiveType(self, ctx:JavaParser.PrimitiveTypeContext): 913 | pass 914 | 915 | # Exit a parse tree produced by JavaParser#primitiveType. 916 | def exitPrimitiveType(self, ctx:JavaParser.PrimitiveTypeContext): 917 | pass 918 | 919 | 920 | # Enter a parse tree produced by JavaParser#typeArguments. 921 | def enterTypeArguments(self, ctx:JavaParser.TypeArgumentsContext): 922 | pass 923 | 924 | # Exit a parse tree produced by JavaParser#typeArguments. 925 | def exitTypeArguments(self, ctx:JavaParser.TypeArgumentsContext): 926 | pass 927 | 928 | 929 | # Enter a parse tree produced by JavaParser#superSuffix. 930 | def enterSuperSuffix(self, ctx:JavaParser.SuperSuffixContext): 931 | pass 932 | 933 | # Exit a parse tree produced by JavaParser#superSuffix. 934 | def exitSuperSuffix(self, ctx:JavaParser.SuperSuffixContext): 935 | pass 936 | 937 | 938 | # Enter a parse tree produced by JavaParser#explicitGenericInvocationSuffix. 939 | def enterExplicitGenericInvocationSuffix(self, ctx:JavaParser.ExplicitGenericInvocationSuffixContext): 940 | pass 941 | 942 | # Exit a parse tree produced by JavaParser#explicitGenericInvocationSuffix. 943 | def exitExplicitGenericInvocationSuffix(self, ctx:JavaParser.ExplicitGenericInvocationSuffixContext): 944 | pass 945 | 946 | 947 | # Enter a parse tree produced by JavaParser#arguments. 948 | def enterArguments(self, ctx:JavaParser.ArgumentsContext): 949 | pass 950 | 951 | # Exit a parse tree produced by JavaParser#arguments. 952 | def exitArguments(self, ctx:JavaParser.ArgumentsContext): 953 | pass 954 | 955 | 956 | --------------------------------------------------------------------------------