diff --git a/.gitignore b/.gitignore index 32e3be424..977f3432c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,10 @@ __MACOSX .idea **/ebook **/bbs -.gitignore \ No newline at end of file +.gitignore +_static +_templates +*.swp +*.pyc +__pycache__ +thu_cst_cracker.egg-info diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..d0c3cbf10 --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/README.md b/README.md index 1e20e0686..4ab439423 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ [![](https://img.shields.io/github/issues-pr-closed-raw/PKUanonym/REKCARC-TSC-UHT.svg?style=flat)](https://github.com/PKUanonym/REKCARC-TSC-UHT/issues) ![](https://img.shields.io/github/repo-size/PKUanonym/REKCARC-TSC-UHT.svg?style=flat) +Web page: [REKCARC-TSC-UHT.readthedocs.io](https://REKCARC-TSC-UHT.readthedocs.io) + 受[浙江大学相关项目](https://github.com/QSCTech/zju-icicles)启发,创立了本项目。 由于本仓库未启用`git-lfs`,因此请不要上传单个超过100M的文件,否则commit无效。 @@ -14,7 +16,7 @@ 如果您是清华大学学生,可移步 https://git.tsinghua.edu.cn/pkuanonym/REKCARC-TSC-UHT 进行查看并且能节约不少流量。 -感谢对本项目贡献的同学:[Trinkle23897](https://github.com/trinkle23897)、[LJSthu](https://github.com/ljsthu)、[shyoshyo](https://github.com/shyoshyo)、[wuhaozhe](https://github.com/wuhaozhe)、[choumartin1234](https://github.com/choumartin1234)、[FztTony](https://github.com/FztTony/)、[VicaYang](https://github.com/VicaYang/)、[duzx16](https://github.com/duzx16/)、[zerotrac](https://github.com/zerotrac)、[gjz010](https://github.com/gjz010/)、[Recursion](https://github.com/RecursionSheep)、[linusboyle](https://github.com/linusboyle)、[namasikanam](https://github.com/namasikanam)、[JamesZhengYuyu](https://github.com/JamesZhengYuyu)、[zx1239856](https://github.com/zx1239856)、[yaoqs](https://github.com/yaoqs)、[heheda12345](https://github.com/heheda12345)、[MashPlant](https://github.com/MashPlant)、[lwpie](https://github.com/lwpie)、[cht33](https://github.com/cht33)、[chenweize1998](https://github.com/chenweize1998)、[will7101](https://github.com/will7101)、[UNIDY2002](https://github.com/UNIDY2002)……以及电脑前的您! +感谢对本项目贡献的同学:[Trinkle23897](https://github.com/trinkle23897)、[LJSthu](https://github.com/ljsthu)、[shyoshyo](https://github.com/shyoshyo)、[wuhaozhe](https://github.com/wuhaozhe)、[choumartin1234](https://github.com/choumartin1234)、[FztTony](https://github.com/FztTony/)、[VicaYang](https://github.com/VicaYang/)、[duzx16](https://github.com/duzx16/)、[zerotrac](https://github.com/zerotrac)、[gjz010](https://github.com/gjz010/)、[Recursion](https://github.com/RecursionSheep)、[linusboyle](https://github.com/linusboyle)、[namasikanam](https://github.com/namasikanam)、[JamesZhengYuyu](https://github.com/JamesZhengYuyu)、[zx1239856](https://github.com/zx1239856)、[yaoqs](https://github.com/yaoqs)、[heheda12345](https://github.com/heheda12345)、[MashPlant](https://github.com/MashPlant)、[lwpie](https://github.com/lwpie)、[cht33](https://github.com/cht33)、[chenweize1998](https://github.com/chenweize1998)、[will7101](https://github.com/will7101)、[UNIDY2002](https://github.com/UNIDY2002)、[yinhaoxuan](https://github.com/yinhaoxuan)、[zhengkw18](https://github.com/zhengkw18)、[rcy17](https://github.com/rcy17)、[prnake](https://github.com/prnake)、[qky18](https://github.com/qky18)……以及电脑前的您! ## 前言 diff --git a/make.bat b/make.bat new file mode 100644 index 000000000..6247f7e23 --- /dev/null +++ b/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/setup.py b/setup.py new file mode 100644 index 000000000..051eae56c --- /dev/null +++ b/setup.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 + +import os, subprocess +from setuptools import setup + +subprocess.check_call('python3 ./source/gen.py --root . --output source'.split()) + +setup( + name='thu-cst-cracker', + description='frontend generator', + install_requires=['sphinx-markdown-tables'], +) diff --git a/source/conf.py b/source/conf.py new file mode 100644 index 000000000..d29462ca4 --- /dev/null +++ b/source/conf.py @@ -0,0 +1,70 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- + +project = 'THU-CST-Cracker' +copyright = '2020, PKUanonym' +author = 'PKUanonym' + + +# -- General configuration --------------------------------------------------- +'''import recommonmark +from recommonmark.transform import AutoStructify + +# At the bottom of conf.py +def setup(app): + app.add_config_value('recommonmark_config', { + 'url_resolver': lambda url: github_doc_root + url, + 'auto_toc_tree_section': 'Contents', + }, True) + app.add_transform(AutoStructify) +'''# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = ['recommonmark', 'sphinx_markdown_tables'] +source_suffix = ['.rst', '.md'] +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'zh' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +import sphinx_rtd_theme +html_theme = "sphinx_rtd_theme" +html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] +master_doc = 'index' diff --git a/source/gen.py b/source/gen.py new file mode 100755 index 000000000..1b228d6c6 --- /dev/null +++ b/source/gen.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python3 + +import os, argparse +from os.path import sep + +EXCLUDE = ['.git', '.gitignore', 'LICENSE', 'Makefile', 'make.bat', 'setup.py', 'source', 'thu_cst_cracker.egg-info'] +README_MD = ['README.md', 'readme.md'] +EXT = '.md' +PREFIX = 'https://github.com/PKUanonym/REKCARC-TSC-UHT/blob/master/' +rst = '''Welcome to THU-CST-Cracker! +=========================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + TOC + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` +''' + +def name_filter(s): + return s.replace('_', '\\_') + +def url_filter(s, p): + c = 'tree' if os.path.isdir(s) else 'blob' + return PREFIX.replace('blob', c) + s.replace(p, sep.join(p.split(sep)[-2:])).replace('(', '%28').replace(')', '%29').replace(' ', '%20').replace(EXT, '%2e%6d%64') + +def get_all(d): + _all = [os.path.join(d, i) for i in os.listdir(d)] + files = [i for i in _all if os.path.isfile(i)] + dirs = [i for i in _all if os.path.isdir(i)] + files.sort() + dirs.sort() + return files, dirs + +def get_course(root, cur, depth=0, threshold=30): + files, dirs = get_all(cur) + file_num = 0 + md_dir, md_file = '', '' + for i in dirs: + d_md, d_num = get_course(root, i, depth + 1) + if depth >= 2 and d_num > threshold: + files.append(i) + print(depth, d_num, i) + else: + md_dir += f'{" " * depth}- [{name_filter(i.split(sep)[-1])}]({url_filter(i, root)})\n' + md_dir += d_md + file_num += d_num + files.sort() + for i in files: + file_num += 1 + if i.split(sep)[-1] in README_MD and depth == 0: + md_file = open(i).read().replace('#', '\t') + '\n\n' + md_file + else: + md_file += f'{" " * depth}- [{name_filter(i.split(sep)[-1])}]({url_filter(i, root)})\n' + md = md_file + md_dir + return md, file_num + +def get_semester(cur): + md = '' + files, dirs = get_all(cur) + for i in files: + if i.endswith(EXT): + md += f'{open(i).read()}\n\n' + for i in files: + if not i.endswith(EXT): + md += f'[{name_filter(i.split(sep)[-1])}]({url_filter(i, cur)})\n\n' + for i in dirs: + d_md, d_num = get_course(i, i) + md += f'## [{name_filter(i.split(sep)[-1])}]({url_filter(i, cur)})\n\n{d_md}\n\n' + return md + +def gen_md(d, n, m): + if 'README' not in n: + m = f'# {n.replace(EXT, "").split(sep)[-1]}\n\n{m}' + if not n.endswith(EXT): + n += EXT + print(d, n) + open(os.path.join(d, n), 'w').write(m) + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument("--root", type=str, default='REKCARC-TSC-UHT') + parser.add_argument("--output", type=str, default='.') + args = parser.parse_args() + files, dirs = get_all(args.root) + files = [i for i in files if i.split(sep)[-1] not in EXCLUDE] + dirs = [i for i in dirs if i.split(sep)[-1] not in EXCLUDE] + print(files) + print(dirs) + if not os.path.exists(args.output): + os.makedirs(args.output) + for i in files: + gen_md(args.output, i.replace(args.root, '.'), open(i).read()) + for i in dirs: + gen_md(args.output, i.replace(args.root, '.'), get_semester(i)) + _all = [i.replace(EXT, '').split(sep)[-1] for i in files + dirs] + rst = rst.replace('TOC', '\n '.join(_all)) + rst = rst.replace('二', '无').replace('三', '二').replace('无', '三') + open(os.path.join(args.output, 'index.rst'), 'w').write(rst) diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_1-Qt/exam/QTExam2019/~$Exam-2019.doc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_1-Qt/exam/QTExam2019/~$Exam-2019.doc" deleted file mode 100644 index 8d153d3cb..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_1-Qt/exam/QTExam2019/~$Exam-2019.doc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/add/__pycache__/__init__.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/add/__pycache__/__init__.cpython-35.pyc" deleted file mode 100644 index 092ddfee4..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/add/__pycache__/__init__.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/add/__pycache__/admin.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/add/__pycache__/admin.cpython-35.pyc" deleted file mode 100644 index ae5113ed6..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/add/__pycache__/admin.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/add/__pycache__/models.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/add/__pycache__/models.cpython-35.pyc" deleted file mode 100644 index 79c4f0c16..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/add/__pycache__/models.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/add/__pycache__/views.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/add/__pycache__/views.cpython-35.pyc" deleted file mode 100644 index 73a4d9d65..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/add/__pycache__/views.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/add/migrations/__pycache__/__init__.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/add/migrations/__pycache__/__init__.cpython-35.pyc" deleted file mode 100644 index 237a4d4f3..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/add/migrations/__pycache__/__init__.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/calc/__pycache__/__init__.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/calc/__pycache__/__init__.cpython-35.pyc" deleted file mode 100644 index 42fa9af7e..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/calc/__pycache__/__init__.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/calc/__pycache__/settings.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/calc/__pycache__/settings.cpython-35.pyc" deleted file mode 100644 index dc83ea4b5..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/calc/__pycache__/settings.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/calc/__pycache__/urls.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/calc/__pycache__/urls.cpython-35.pyc" deleted file mode 100644 index c2f8c9087..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/calc/__pycache__/urls.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/calc/__pycache__/wsgi.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/calc/__pycache__/wsgi.cpython-35.pyc" deleted file mode 100644 index d380724be..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2015/calc/calc/__pycache__/wsgi.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/mysite/__pycache__/__init__.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/mysite/__pycache__/__init__.cpython-35.pyc" deleted file mode 100644 index e8f015e2b..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/mysite/__pycache__/__init__.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/mysite/__pycache__/settings.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/mysite/__pycache__/settings.cpython-35.pyc" deleted file mode 100644 index f8381c01f..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/mysite/__pycache__/settings.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/mysite/__pycache__/urls.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/mysite/__pycache__/urls.cpython-35.pyc" deleted file mode 100644 index 9d612f496..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/mysite/__pycache__/urls.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/mysite/__pycache__/wsgi.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/mysite/__pycache__/wsgi.cpython-35.pyc" deleted file mode 100644 index a2184f080..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/mysite/__pycache__/wsgi.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/__init__.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/__init__.cpython-35.pyc" deleted file mode 100644 index 6e950745e..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/__init__.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/admin.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/admin.cpython-35.pyc" deleted file mode 100644 index 7a5436877..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/admin.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/apps.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/apps.cpython-35.pyc" deleted file mode 100644 index 0c1310836..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/apps.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/models.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/models.cpython-35.pyc" deleted file mode 100644 index 06b062aa9..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/models.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/urls.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/urls.cpython-35.pyc" deleted file mode 100644 index 6c1ba6ed1..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/urls.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/views.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/views.cpython-35.pyc" deleted file mode 100644 index 2b6ffbbf6..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/views.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/migrations/__pycache__/0001_initial.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/migrations/__pycache__/0001_initial.cpython-35.pyc" deleted file mode 100644 index 82e4f4541..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/migrations/__pycache__/0001_initial.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/migrations/__pycache__/0002_auto_20160909_1144.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/migrations/__pycache__/0002_auto_20160909_1144.cpython-35.pyc" deleted file mode 100644 index 874b889a1..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/migrations/__pycache__/0002_auto_20160909_1144.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/migrations/__pycache__/__init__.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/migrations/__pycache__/__init__.cpython-35.pyc" deleted file mode 100644 index dcab483f1..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/migrations/__pycache__/__init__.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/__init__.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/__init__.cpython-35.pyc" deleted file mode 100644 index 969d289cf..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/__init__.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/__init__.cpython-36.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/__init__.cpython-36.pyc" deleted file mode 100644 index 4438d4080..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/__init__.cpython-36.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/admin.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/admin.cpython-35.pyc" deleted file mode 100644 index ac38dbde5..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/admin.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/admin.cpython-36.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/admin.cpython-36.pyc" deleted file mode 100644 index 5666fb228..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/admin.cpython-36.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/models.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/models.cpython-35.pyc" deleted file mode 100644 index eb79d763c..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/models.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/models.cpython-36.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/models.cpython-36.pyc" deleted file mode 100644 index cf1322d2d..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/models.cpython-36.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/views.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/views.cpython-35.pyc" deleted file mode 100644 index 2669c51a0..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/views.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/views.cpython-36.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/views.cpython-36.pyc" deleted file mode 100644 index a20ad95b6..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/__pycache__/views.cpython-36.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/migrations/__pycache__/__init__.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/migrations/__pycache__/__init__.cpython-35.pyc" deleted file mode 100644 index 9cd1b90b7..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/migrations/__pycache__/__init__.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/migrations/__pycache__/__init__.cpython-36.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/migrations/__pycache__/__init__.cpython-36.pyc" deleted file mode 100644 index 12652f2eb..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/add/migrations/__pycache__/__init__.cpython-36.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/__init__.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/__init__.cpython-35.pyc" deleted file mode 100644 index 30ba37136..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/__init__.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/__init__.cpython-36.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/__init__.cpython-36.pyc" deleted file mode 100644 index d95174b0c..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/__init__.cpython-36.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/settings.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/settings.cpython-35.pyc" deleted file mode 100644 index 9a4708339..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/settings.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/settings.cpython-36.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/settings.cpython-36.pyc" deleted file mode 100644 index be433ad75..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/settings.cpython-36.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/urls.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/urls.cpython-35.pyc" deleted file mode 100644 index d64d0c0e8..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/urls.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/urls.cpython-36.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/urls.cpython-36.pyc" deleted file mode 100644 index 56d3650c5..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/urls.cpython-36.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/wsgi.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/wsgi.cpython-35.pyc" deleted file mode 100644 index 2c5e7cbda..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/wsgi.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/wsgi.cpython-36.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/wsgi.cpython-36.pyc" deleted file mode 100644 index abffe0fc2..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2017/3/calc/calc/__pycache__/wsgi.cpython-36.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2019/3/exam3/__pycache__/__init__.cpython-36.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2019/3/exam3/__pycache__/__init__.cpython-36.pyc" deleted file mode 100644 index cf19f0b01..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2019/3/exam3/__pycache__/__init__.cpython-36.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2019/3/exam3/__pycache__/settings.cpython-36.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2019/3/exam3/__pycache__/settings.cpython-36.pyc" deleted file mode 100644 index 141328aa5..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2019/3/exam3/__pycache__/settings.cpython-36.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2019/3/exam3/__pycache__/urls.cpython-36.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2019/3/exam3/__pycache__/urls.cpython-36.pyc" deleted file mode 100644 index be9cb32b9..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2019/3/exam3/__pycache__/urls.cpython-36.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2019/3/exam3/__pycache__/view.cpython-36.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2019/3/exam3/__pycache__/view.cpython-36.pyc" deleted file mode 100644 index dd3839184..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2019/3/exam3/__pycache__/view.cpython-36.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2019/3/exam3/__pycache__/wsgi.cpython-36.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2019/3/exam3/__pycache__/wsgi.cpython-36.pyc" deleted file mode 100644 index eab29ef12..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/exam/2019/3/exam3/__pycache__/wsgi.cpython-36.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/form/__pycache__/__init__.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/form/__pycache__/__init__.cpython-35.pyc" deleted file mode 100644 index 5a73e9323..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/form/__pycache__/__init__.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/form/__pycache__/admin.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/form/__pycache__/admin.cpython-35.pyc" deleted file mode 100644 index 39edaecb4..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/form/__pycache__/admin.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/form/__pycache__/models.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/form/__pycache__/models.cpython-35.pyc" deleted file mode 100644 index 8b635d062..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/form/__pycache__/models.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/form/__pycache__/urls.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/form/__pycache__/urls.cpython-35.pyc" deleted file mode 100644 index b14a0aad3..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/form/__pycache__/urls.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/form/__pycache__/views.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/form/__pycache__/views.cpython-35.pyc" deleted file mode 100644 index a8cff99ff..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/form/__pycache__/views.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/mysite/__pycache__/__init__.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/mysite/__pycache__/__init__.cpython-35.pyc" deleted file mode 100644 index 622fc953e..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/mysite/__pycache__/__init__.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/mysite/__pycache__/settings.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/mysite/__pycache__/settings.cpython-35.pyc" deleted file mode 100644 index 349658c8f..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/mysite/__pycache__/settings.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/mysite/__pycache__/urls.cpython-35.pyc" "b/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/mysite/__pycache__/urls.cpython-35.pyc" deleted file mode 100644 index 4061cd58e..000000000 Binary files "a/\345\244\247\344\270\200\345\260\217\345\255\246\346\234\237/Week_3-Python/hw/2016/lzl/mysite/__pycache__/urls.cpython-35.pyc" and /dev/null differ diff --git "a/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2015_\345\210\230\346\231\272\345\263\260_PA/938508712_3_decaf_PA2.zip" "b/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2015_\345\210\230\346\231\272\345\263\260_PA/938508712_3_decaf_PA2.zip" deleted file mode 100644 index 6db401a6a..000000000 Binary files "a/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2015_\345\210\230\346\231\272\345\263\260_PA/938508712_3_decaf_PA2.zip" and /dev/null differ diff --git "a/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2015_\345\210\230\346\231\272\345\263\260_PA/Lex&yacc/Bison Manual.pdf" "b/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2015_\345\210\230\346\231\272\345\263\260_PA/Lex&yacc/Bison Manual.pdf" deleted file mode 100644 index f82e16769..000000000 Binary files "a/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2015_\345\210\230\346\231\272\345\263\260_PA/Lex&yacc/Bison Manual.pdf" and /dev/null differ diff --git "a/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2015_\345\210\230\346\231\272\345\263\260_PA/Lex&yacc/Compiler Construction Using Flex and Bison.pdf" "b/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2015_\345\210\230\346\231\272\345\263\260_PA/Lex&yacc/Compiler Construction Using Flex and Bison.pdf" deleted file mode 100644 index 4db9778bc..000000000 Binary files "a/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2015_\345\210\230\346\231\272\345\263\260_PA/Lex&yacc/Compiler Construction Using Flex and Bison.pdf" and /dev/null differ diff --git "a/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2015_\345\210\230\346\231\272\345\263\260_PA/Lex&yacc/Flex Manual.pdf" "b/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2015_\345\210\230\346\231\272\345\263\260_PA/Lex&yacc/Flex Manual.pdf" deleted file mode 100644 index 66f4612a5..000000000 Binary files "a/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2015_\345\210\230\346\231\272\345\263\260_PA/Lex&yacc/Flex Manual.pdf" and /dev/null differ diff --git "a/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2015_\345\210\230\346\231\272\345\263\260_PA/Lex&yacc/JFlex Manual.pdf" "b/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2015_\345\210\230\346\231\272\345\263\260_PA/Lex&yacc/JFlex Manual.pdf" deleted file mode 100644 index 5bdc065fd..000000000 Binary files "a/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2015_\345\210\230\346\231\272\345\263\260_PA/Lex&yacc/JFlex Manual.pdf" and /dev/null differ diff --git "a/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2015_\345\210\230\346\231\272\345\263\260_PA/Lex&yacc/Lex and Yacc_868506244.rar" "b/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2015_\345\210\230\346\231\272\345\263\260_PA/Lex&yacc/Lex and Yacc_868506244.rar" deleted file mode 100644 index 0fa1dc956..000000000 Binary files "a/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2015_\345\210\230\346\231\272\345\263\260_PA/Lex&yacc/Lex and Yacc_868506244.rar" and /dev/null differ diff --git "a/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2015_\345\210\230\346\231\272\345\263\260_PA/Lex&yacc/YACC--Yet Another Compiler-Compiler(\344\270\255\346\226\207\347\211\210).html" "b/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2015_\345\210\230\346\231\272\345\263\260_PA/Lex&yacc/YACC--Yet Another Compiler-Compiler(\344\270\255\346\226\207\347\211\210).html" deleted file mode 100644 index 8515288dc..000000000 --- "a/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2015_\345\210\230\346\231\272\345\263\260_PA/Lex&yacc/YACC--Yet Another Compiler-Compiler(\344\270\255\346\226\207\347\211\210).html" +++ /dev/null @@ -1,1908 +0,0 @@ - - -
- - - - - - - -
- Bell Laboratories
- Murray Hill
룺ʿ
- -- -- -- -
-߶IJκε߶IJӵκȨҲκκ
-ԭģhttp://cm.bell-labs.com/7thEdMan/vol2/yacc.bunժҪ
- -ͨijֽṹʵϣΪÿҪļһܵԿôӣһеôҵǣͨʩġʹõģڼǵЧԡ
- -Yacc ṩһͨù롣Yacc û涨ĽṹͬʶÿֽṹʱõĴ롣Yacc Ĺ涨תɲ봦һ̴̣ûӦеĶǷʵġ
- -Yacc ɵ̵ûṩһһĿ(item)ԣûԵַķʽԸ߲㹹ֺķʽ 涨롣ͨûṩ̻Դõעͺ()ԼЩ͵Υķ涨
- -Yacc ÿֲ C дɵġܵĹ涨ǷdzһԵ: ȥ LALR(1) ķ
- -CAPLPascalRATFOR ȱ֮⣬Yacc ڷdzԣһŰԡһЩԡһĵϵͳһ Fortran ϵͳ
- -
July 31,1978
- -Yacc ṩһͨùڼʩӽṹYacc û봦Ĺ涨ṹĹʶЩʱõĴ룬һͲ̡Yacc һ봦(parser)ûṩĵͲ(ʷ(analyzer))ѡ ȡĿ(Ǻ(token))ݽķṹ֯ЩǺţʶЩеijһʱŵΪṩĽ -û룻ֵʹֵ
- -Yacc C[1] ԵһֲдɵģҶҲһʹ C ԡ⣬Yacc ĺܶԼ C ԡ
- -涨һķÿһĽṹһ֡磬ķ
- - date : month_name day ',' year ;
-
-datemonth_nameday year ʾ봦ȤЩṹmonth_nameday -year طġ,Χڵ֮Уⰵʾ˶Ϊ(literal)ֵġðźͷֺֻdz䵱еıţԿû塣ԣȷ
- - July 4, 1776
-
-ƥ
- -봦һҪɴʷû̶ȡʶͲṹЩǺŴﵽʷԭʷʶĽṹս(terminal symbol)ʶĽṹս(nonterminal -symbol)Ϊ˱սͨƺΪǺš
- -ʹôʷʹķ֮൱ɹ۵Ļء磬
- - month_name : 'J' 'a' 'n' ;
month_name : 'F' 'e' 'b' ;
. . .
month_name : 'D' 'e' 'c' ;
-
-ӡķֻҪʶĸ month_name һսֵͲ˷ʱͿռ䣬ʹӵóԽ Yacc Ĵͨģʷʶ·֣ؼ -month_name һָʾ£month_name һǺš
- -ַ,ҲͨʷݣҲǺš
- -涨ļǷdzġӹ
- - date : month '/' day '/' year ;
-
-- -
7 / 4 / 1776
-
-Ϊ
- - July 4, 1776
-
-ͬ֡ڶ£¹ϵͳУСŬͻִĺСΣԡ
- -ȡе 涨Щͬɨһ磻ԣֻdzֵļ˶ȡ㲻ݵĿԣͨԿٵķ -ݡΪ涨һṩĴݵ룬֮봦
- -һЩ£Yacc ڸijһ涨ʱɽ磬涨ìܣҪ Yacc ṩĸǿʶơǰʾƴͨʹʷǿдijЩķ Yacc ܴпܵĹ涨˳ͬϵͳȽϣ⣬Yacc ڴĹ쾭ҲദġһЩûǵȷЧ Yacc 涨¶˳ڵĸƴ
- -Yacc ײѾط[2, 3, 4]ˡYacc ѾڴʵӦй㷺ʹˣ lint[5]ֲ C [6]һŰѧϵͳ[7]
- -½ Yacc 涨Ļ̣ 1 ķ 2 ЩûṩĶ 3 ʷ 4 IJ 5 -Yacc пӹ涨ɽĸԭͶԴҪЩʲô 6 ʽв(operator)ȼ(precedence)ļơ 7 ۴ 8 Yacc ɵĽIJ 9 ڸ涨ʽЧʵһЩ顣 10 һЩ⣬ 11 ڸл¼ A һӣ¼ B -Yacc ܽᡣ¼ C ʹ Yacc ijЩһӣ¼ D ͬ Yacc ϰ汾ʷԶṩIJٻԾֵ֧Ļƺ -
- -ֳνǼǺŻս֮һYacc ͬҪǺ֡⣬ڵ 3 ۵ԭҪѴʷΪ涨ļһ֣ͬҲõijԣÿ涨ļ: (ķ)ͳʹ˫ذٷֺ%% ָΡ(ٷֺ% Yacc 涨һת(escape)ַ)
- -仰˵Ĺ涨ļ
- -
%%
%%
-
-οΪա⣬ʡ˳Σڶ %% Ҳʡԣ
- -ԣСĺϷ Yacc 涨
- - %%
-
-˲ַֻ֮ܳ⣬հסtab ͻбԡעͿԳǺϷκεطDZΧ /* . . . */ Уͬ C -PL/I һ
- -һķɡķ¸ʽ:
- - A : BODY ;
-
-A ʾһս֣ BODY -һеֺ֡ðźͷֺ Yacc š
- -ֿⳤȣĸ.»_ͲͷɡִдСдĸķʹõֿԴǺŻս
- -ɰΧڵ'еַɡͬ C һб\תַʶ C ת塣
- - '\n'
'\r' س
'\'' ``'''
'\\' б ``\''
'\t' tab
'\b' backspace
'\f' form feed
'\xxx' ``xxx'' ˽
-
-һЩԭNUL ַ('\0' - 0)ķвӦʹá
- -һЩķֶͬˣʹ|дֶˡ⣬ڹĩ˵ķֺ֮ǰȥԸ Yacc ķ
- - A : B C D ;
A : E F ;
A : G ;
-
-дΪ
- - A : B C D
| E F
| G
;
-
-ķֶͬ˵ķһDZģʹӿɶڸı䡣
- -һսƥַԵķʽָʾ:
- - empty : ;
-
-Ǻŵֱ뱻ľд
- - %token name1 name2 . . .
-
-(۲μ½ 35 6)ٶûжÿֶǷսÿսһֶ˳֡
- -зսУһʼŵرҪʶʼţŴķһĽṹȱʡģڹʹʼΪһķʹ %start ؼʽʼַǿܵģʵҪ:
- - %start symbol
-
-ͨ(endmarker)Ǻֱ֪ͨǵļǺγͬʼƥһṹڼ֮صĵߡκмǣһ
- -ʵʱؽûṩĴʷĹμĵ 3 ڡͨǴij൱Ե I/O ״̬ļ¼
- -ÿķûԹ봦ÿʶʱеĶЩԷֵԻôǰ涯صֵ⣬ʷԷؼǺŵֵҪĻ
- -C 䣬ͬӳⲿͱָΪΧڻ{}еһ䡣磬
- - A : '(' B ')'
{ hello( 1, "abc" ); }
-
-- -
XXX : YYY ZZZ
{ printf("a message\n");
flag = 25; }
-
-Ǵжķ
- -Ϊ˱ڶͽ֮ͨţԶҪĸĶʹԪ$Ϊ Yacc һźš
- -Ҫֵͨα(pseudo-variable)$$Ϊijֵ磬κµֵ 1 Ķ
- - { $$ = 1; }
-
-Ҫǰ涯ʹʷķֵʹα $1$2. . .ἰǹֶ˵IJ(component)ķֵǴҶȡġԣ -
- - A : B C D ;
-
-磬 $2 ӵ C صֵ $3 D صֵ
- -Ϊһӣǹ
- - expr : '(' expr ')' ;
-
-صֵͨԲе expr ֵָʾΪ
- - expr : '(' expr ')' { $$ = $2 ; }
-
-ȱʡģֵеһԪ($1)ֵԣʽķ
- - A : B ;
-
-ҪʽĶ
- -УжڹĩˡʱҪһȫ֮ǰÿȨYacc ڹмͬĩһдٶ(ԭ)һֵĶͨƽĻƷεģԷ涯ķֵԣ
- - A : B
{ $$ = 1; }
C
{ x = $2; y = $3; }
;
-
-Ч x Ϊ 1 y Ϊ C صֵ
- -Yacc ͨһµķս֣Ͱƥ䵽ַһ¹սһĶڲͨʶӵĹĶYacc ʵ϶ԴͬдΪ:
- - $ACT : /* empty */
{ $$ = 1; }
;
A : B $ACT C
{ x = $2; y = $3; }
;
-
-ںܶӦУֱӵתڴйһһݽṹ֮ǰӦñ任첢άҪụ̃́رڹ졣磬ٶдһ C node
- - node( L, n1, n2 )
-
-бǩ L ͺڵ n1 n2 һڵ㣬½ڵڹ涨пͨṩ¶:
- - expr : expr '+' expr
{ $$ = node( '+', $1, $3 ); }
-
-ûԶ嶯ʹõͶԳУΧڱ%{%}֮䡣ЩͶȫǿԱʹʷ֪磬
- - %{ int variable = 0; %}
-
-ԷõУʹ variable жǿԷʵġYacc ֻʹyyʼ֣ûӦʹ֡
- -ЩУб: ͵ֵۿ½ 10 -ҵ
- -ûṩһʷȡѼǺ(ֵҪĻ)ﵽʷʹ yylex ֵĺ һļǺűţʾȡļǺŵࡣǺŹһֵӦⲿ yylval
- -ΪʹͨŵԷʹʷڼǺűϴһ¡ſ Yacc ûѡ£ʹ C Ե# defineʷʹ÷Щš磬ٶ Yacc 涨ļѾǺ DIGITʷزֿܿ:
- - yylex(){
extern int yylval;
int c;
. . .
c = getchar();
. . .
switch( c ) {
. . .
case '0':
case '1':
. . .
case '9':
yylval = c-'0';
return( DIGIT );
. . .
}
. . .
-
-ͼǷһ DIGIT Ǻűţ͵ֵֵһֵʷλڹ涨ļijΣʶ DIGIT ΪǺ DIGIT ļǺűš
- -ֻƵġĵĴʷΨһȱķҪʹκ C ԻбĻļǺ֣磬ʹüǺ if while һᵼ±ʷʱϾѡǺ error Ӧʹ(μ½ 7)
- -ͬǺűſ Yacc ûѡȱʡ£ Yacc ѡַȱʡǺűڱַеֵַָ -257 ʼļǺűš
- -ҪһǺűŸһǺ()мǺŻֵĵһγʱֱӸһǸΪֵֻļǺűšֻͨƶֱֺǵȱʡ塣мǺűŶDzͬǺҪġ
- -ʷԭDZмǺű 0 ǺűŲûض壻ԣдʷڵǵʱӦ 0 ΪǺűš
- -ʷһõĹ Mike Lesk[8] -Lex Щʷ Yacc ЭЩʷĹ涨ʹʽķ Lex ɷdzӵĴʷһЩ( FORTRAN)ӦκۿܣĴʷֹ
- -Yacc ѹ涨ļת C ݸĹ涨롣ӹ涨ת㷨ǸӵģͲ(Ϣμ)ǣԼˣιģܲϸģʹ崦ø⡣
- -Yacc ṩĽɴһջ״̬Զɡȡͼס(ǰ(lookahead)Ǻ)һǺšǰ״̬ջ״̬Զ״̬һСǩ(label)ʱ״̬ 0 £ջֻ״̬ 0ûжȡǰǺš
- -ֻܻĸƽ(shift)Լ(reduce)ܺʹƶ¹:
- -- -- -1. ĵǰ״̬ǷҪһǰǺӦʲôҪûжȡ yylex һǺš
- -2. ʹõǰ״̬ͳǰǺ(ҪĻ)һ״̬ܵ״̬ѹջУջе͵³ǰǺű
- -
ƽǽĶƽʱһǰǺš磬״̬ 56 ôһ:
- - IF shift 34
-
-˵״̬ 56 £ǰַ IFǰ״̬(56)ջбѹȥ״̬ 34 Ϊǰ״̬(ջ)ǰַ
- -ԼֹջƵڽѾһķֶ˵ʱԼʵģѾһʵ (instance)ֶ滻ֶˡпҪοǰǺǷԼͨҪʵϣȱʡ(ʾΪ.) һԼ
- -Լ뵥ķķҲСһЩ
- - . reduce 18
-
-ἰķ 18
- - IF shift 34
-
-ἰ״̬ 34
- -ٶҪԼĹ
- - A : x y z ;
-
-Լֶ˷(symbol)( A)ֶ˷ŵĿ( 3)ҪԼȴջе״̬(һģ״̬Ŀڹֶ˷ŵĿ)ЧϣЩ״̬ʶʶ xy z ʱѹջеģκôڵЩ״̬֮ʼ֮ǰڱ¶(uncovered)״̬¡ʹ¶״̬ڹֶ˵ķţʵЧϵƽ -Aһ״̬ѹջУڴֶ˷źͼǺŵͨƽ֮һҪת(goto)رǣƽǰǺţתӰꣶ״̬һĿ:
- - A goto 20
-
-״̬ 20 ѹջУΪǰ״̬
- -ЧϣԼڽӲջе״̬Դ˻ص״μֶ˵Ǹ״̬תͬѾڴʱֶֶΪգջе״̬: ¶״̬ʵϾǵǰ״̬
- -ԼûṩĶֵĴҲǺҪġһԼʱڵջ֮ǰִṩĴ롣˳״̬ջ֮⣬һջУдӴʷЩصֵڷƽʱⲿ yylval Ƶֵջϡڴû뷵֮ɹԼתʱⲿ yyval Ƶֵջϡα $1$2 ἰľֵջ
- -ڸϷdzָܶʾѾ鿴˲涨ƥ䡣ֻڳǰǺǽǵʱָ֣ʾ ɹĹһ棬ʾټݹ涨״ѾǺţ볬ǰǺһ𣬲ѭºϷ -κζһԻָ״̬¿ʼ: (ڴ)ڵ 7
- -Ǹӵʱ! й涨
- - %token DING DONG DELL
%%
rhyme : sound place
;
sound : DING DONG
;
place : DELL
;
-
-ʹ -v ѡ Yacc ʱһ y.output ļԽɶӦķ -y.output ļ(ȥ˽βһЩͳ):
- - state 0
$accept : _rhyme $end
DING shift 3
. error
rhyme goto 1
sound goto 2
state 1
$accept : rhyme_$end
$end accept
. error
state 2
rhyme : sound_place
DELL shift 5
. error
place goto 4
state 3
sound : DING_DONG
DONG shift 6
. error
state 4
rhyme : sound place_ (1)
. reduce 1
state 5
place : DELL_ (3)
. reduce 3
state 6
sound : DING DONG_ (2)
. reduce 2
-
-ע⣬ÿ״̬ĸ֮⣬ÿ״̬лжڴеĽʹ -_ ַָʾÿмʲôʲôδ֡ٶ
- - DING DONG DELL
-
-ٽڴڼIJнġ
- -ǰ״̬ 0Ҫ״̬ 0 ܻõĶԶ˵һǺ DINGΪǰǺš״̬ 0 ¶ԼǺ DING Ķshift 3״̬ 3 ѹջУǰǺű״̬ 3 Ϊǰ״̬һǺ DONGΪǰǺš״̬ 3 ¶ԼǺ DONG Ķshift 6״̬ 6 ѹջУǰǺűջڰ 03 6 ״̬ 6 £òοǰǺţ 2 Լ
- - sound : DING DONG
-
-ֶšԴջе״̬ 6 3¶״̬ 0״̬ 0 Ҷ sound ת
- - sound goto 2
-
-״̬ 2 ѹУΪǰ״̬
- -״̬ 2 £ȡһǺ DELLshift 5״̬ 5 ѹջУջ 02 5ǰǺű״̬ 5 £ΨһĶǰ 3 ԼֶһţԴջеһ״̬ 5¶״̬ 2״̬ 2 ¶Թ 3 ֶ place ת״̬ -4ջ 02 4״̬ 4 £ΨһĶǰ -1 Լ 1 ֶţԴջе״̬ٴα¶״̬ 0״̬ 0 £ rhyme һת·״̬ 1״̬ 1 £ȡ룬˽ǣ y.output $endָʾ״̬ 1 ڼʱĶǽܣɹĽ˽
- -߿ܼе֪Բȷַ DING DONG DONGDING DONGDING DONG DELL DELL ȵʱιжʱ䣬ڸӵгʱͿˡ -
- -ijЩַֻʽ죬ķġ磬ķ
- - expr : expr '-' expr
-
-DZʽһȻķʽʽһмķһžγʽҵǣķûȫĹ涨иķʽ磬 -
- - expr - expr - expr
-
-뱻Ϊ
- - ( expr - expr ) - expr
-
-- -
expr - ( expr - expr )
-
-(һ(association)ڶҽ)
- -Yacc Խʱ塣ڸʱԵн
- - expr - expr - expr
-
-ڶ expr ʱѾ:
- - expr - expr
-
-ƥķֶˡͨӦԼ룻Ӧ֮뱻Լ expr(ֶ)ԽŶȡ:
- - - expr
-
-ٴιԼЧDzϽ͡
- -ɹѡģڽ
- - expr - expr
-
-ӳӦùȡֱ
- - expr - expr - expr
-
-ԽҵӦùǹԼ expr
- - expr - expr
-
-ٴιԼЧDzҽϽ͡ԣȡ
- - expr - expr
-
-ֺϷ飬һƽһιԼ֮ƽ/ԼͻҲܷѡϷԼ飻Լ/ԼͻעԶʲôƽ/ƽͻ
- -ƽ/ԼԼ/ԼͻʱYacc ȻɽͨҪѡطѡЧ֮һɵġһ״ξĹȥ
- -Yacc ȱʡĵȥ:
- -- -- -1. ƽ/ԼͻУȱʡƽ
- -2. ڹԼ/ԼͻУȱʡǹԼ(˳)ȵķ
- -
1 ʾֻҪѡƳٹԼƽ 2 ûԽµΪķdzֲڵĿƣǹԼ/ԼͻӦܵı⡣
- -ͻԭеĴҲΪķһµġҪ Yacc ܹĸӸӵĽʹڹڵĶҲܵ³ͻڽȷʶĸ֮ǰĻЩ£ȥӦDzʵģ²ȷĽΪˣYacc DZ 1 2 ƽ/ԼԼ/ԼͻĿ
- -һ˵ֻҪпӦȥȷĽпдķʹͬûгͻΪˣǰĽΪͻǵľдЩȻģɸĽ Yacc ʹгͻ»ɽ
- -ȥһǣ漰if-then-elseıԵһƬ:
- - stat : IF '(' cond ')' stat
| IF '(' cond ')' stat ELSE stat
;
-
-ЩУIF ELSE ǼǺţcond ()ʽķսţ stat ķսšһ-if ڶ if-else
- -γһ幹죬Ϊʽ
- - IF ( C1 ) IF ( C2 ) S1 ELSE S2
-
-ַʽ:
- - IF ( C1 ) {
IF ( C2 ) S1
}
ELSE S2
-
-- -
IF ( C1 ) {
IF ( C2 ) S1
ELSE S2
}
-
-ڶǶԶĽ͡ÿ ELSE ǰû ELSE IF ϡУǽ -
- - IF ( C1 ) IF ( C2 ) S1
-
-ڲ鿴 ELSE ״-if Լõ
- - IF ( C1 ) stat
-
-Ŷȡµ룬
- - ELSE S2
-
-if-else Լ
- - IF ( C1 ) stat ELSE S2
-
-ϵĵһ
- -һ棬ELSE Աƽȡ S2Ű
- - IF ( C1 ) IF ( C2 ) S1 ELSE S2
-
-沿ְ if-else Լõ
- - IF ( C1 ) stat
-
--if ԼϵĵڶͨҪġ
- -һЧ - ƽ/ԼͻӦȥ 1 ߽ƽҪϡ
- -ƽ/Լͻֻضĵǰ ELSEضѾʱ -
- - IF ( C1 ) IF ( C2 ) S1
-
-¡һ˵кֳܶͻÿͬһźһǰʹý״̬Щǰ롣
- -ͨ(-v)ѡļ Yacc ijͻϢġ磬Ӧͻ:
- - 23: shift/reduce conflict (shift 45, reduce 18) on ELSE
state 23
stat : IF ( cond ) stat_ (18)
stat : IF ( cond ) stat_ELSE stat
ELSE shift 45
. reduce 18
-
-һͻ״̬šͨ״̬״̬лԾķͽ»߱dzķѾIJ֡У״̬ 23 нѾӦ
- - IF ( cond ) stat
-
-չʾڴʱԾķֿܵ顣 -ELSEƽ״̬ 45״̬ 45 һ -
- - stat : IF ( cond ) stat ELSE_stat
-
-Ϊ״̬ ELSE Ѿƽص״̬ 23 У.һɹѡĶûȷἰԣ£Ų ELSEķ 18 Լ:
- - stat : IF '(' cond ')' stat
-
-ٴעshift֮ἰ״̬Լἰķš -y.output ļУڿԱԼЩ֮ӡڶ״̬УпܴڹԼȱʡδƽ/ԼͻûԲ鿴 ȱʡǷʡļ£ûҪ֪︲ǵĸĽΪ졣£Բο[2, 3, 4]ѯؼҲǺʵġ
- -һֳ£ͻĹDzֵģⷢڷʽСʽжʹõĹòȼ (notion)ͬҽ(associativity)ϢȻʹôʵȥķĽʹ -ķĽٺдǶҪжԪһԪдʽķ
- - expr : expr OP expr
-
-- -
expr : UNARY expr
-
-⽨һdzķкܶͻΪȥûָвȼճǿȣͶԪĽԡϢ㹻 Yacc ЩͻʵҪȼͽԵĽ
- -аȼͽԸӵǺϡڿʼ Yacc ؼ: -%left%right %nonassocżǺбļǺŶͬһеļǺŶٶͬȼͽԣЩаȼճǿȴг -
- - %left '+' '-'
%left '*' '/'
-
-ĸ()ȼͽԡӷͼϵģбǺźбܸ͵ȼǶϵġʹùؼ %right ҽϲʹùؼ %nonassoc ϵIJ Fortran .LT.ԣ
- - A .LT. B .LT. C
-
-Fortran ǷǷģֲ Yacc ùؼ %nonassoc ΪЩΪӣ -
- - %right '='
%left '+' '-'
%left '*' '/'
%%
expr : expr '=' expr
| expr '+' expr
| expr '-' expr
| expr '*' expr
| expr '/' expr
| NAME
;
-
-- -
a = b = c*d - e - f*g
-
-Ϊ:
- - a = ( b = ( ((c*d)-e) - (f*g) ) )
-
-ʹƵʱһԪһһȼʱһԪͶԪͬķֱʾвͬȼһһԪͶԪ-һԪԸͬ˷ͬĽǿȣߣԪбȳ˷͵Ľǿȡؼ %prec ıضķȼ%prec ֱӳķ֮ڶķֺ֮ǰһǺֻ֡ķȼļǺֵֻȼ磬ҪʹһԪ˷ͬȼ:
- - %left '+' '-'
%left '*' '/'
%%
expr : expr '+' expr
| expr '-' expr
| expr '*' expr
| expr '/' expr
| '-' expr %prec '*'
| NAME
;
-
-%left%right %nonassoc ļǺŲҪ %token ͬ
- -Yacc ʹȼͽͻȥʽϣ:
- -- -- -1. ΪЩǺż¼ȼͽԡ
- -2. ȼͽÿķļǺŻֵȼͽԡʹ %prec 죬ȱʡһЩķû֮ȼͽԡ
- -3. йԼ/Լͻʱƽ/ԼͻŻķ֮һûȼͽԵʱʹ½ڿʼȥͻ
- -4. ƽ/Լͻķ֮ȼͽԣڹŸȼĶ(ƽԼ)ķʽͻȼͬʹýԣϰʾԼҽϰʾƽϰʾ -
- -
ȼijͻ Yacc ƽ/ԼͻСζȼ涨еĴķеĴȼóֱص̬ȣԱϵʽʹǣֱijЩ顣жʵǷʱ y.output ļǷdzõġ
- -һdzѵܶ⡣磬ҵһʱܱջؽ洢ɾķűĿ͵͵ÿɽһ
- -ҵһʱֹͣдǺܱܣɨҵһǸõġһ֮ʹ⡣µij㷨漰ַжһЩǺţͳԵԼ
- -Ϊ ûijЩƣYacc ṩһ൱һԵǺerror˴ֿķУЧϣԤڵĴλ áջֱǺerrorϷһ״̬űֵͬǺerrorǵǰǰǺһĶǰǺŽ -ΪļǺšûָĴڼʱֹͣ
- -Ϊ˷ֹ(cascade)ĴϢڼһ֮ڴ״ֱ̬ɹĶȡƽǺšڽѾڴ״̬µʱһϢҰɾǺš -
- -ΪһӣʽĹ
- - stat : error
-
-Чϣζʱм䡣ȷеģǰɨ裬ҿܺϷһ -ǺţеһϿʼֵܳıĿʼһʧܵĿʼڱڶʵûд
- -ЩĴʹöЩԳ³ʼջطűռȡ
- -ĴǷdzһģڿơЩ
- - stat : error ';'
-
-һʱ䣬һ;֮һ;֮ǰмǺŶƽڼ;ʱԼ֮κ
- -һʽڽʽӦУҪһ֮¼һСһֿܵĴ
- - input : error '\n' { printf( "Reenter last line: " ); } input
{ $$ = $4; }
-
-ַʽһDZڵѣڳѾڴ֮ȷ֮ͬǰȷĴǺš¼ǰǺ -ɾЩļǺţϢԵDzɽܵġΪˣʹһֻǿƽŴѾȫˡ
- - yyerrok ;
-
-һ÷Ϊ״̬ӿдΪõ
- - input : error '\n'
{ yyerrok;
printf( "Reenter last line: " ); }
input
{ $$ = $4; }
;
-
-ͬἰһerror֮ļǺ˴ǺšʱDzǡģ磬ԼеҵָȷλõĹ£ǰijǰǺšڶ -
- - yyclearin ;
-
-Ч磬ٶڴ֮ĶҪûṩijָӵ̣ͬǰһЧĿʼڵ֮yylex صһǺŴŻһϷĵһǺţɵķǷǺű뱻Ĺ
- - stat : error
{ resynch();
yyerrok ;
yyclearin ; }
;
-
-ɷЩǴֲڵģӺܶмЧĻָ⣬ûԻÿȨȥͨĴö
- -û Yacc 涨ʱڶϵͳļǽ -y.tab.c һ C ļ(ΪļϵͳڲͬװпDzͬ)Yacc ɵĺ -yyparseֵĺڵõʱظĵûṩĴʷ yylex(μ½ 3)ǺšգҪôǼһ(ûдǿܵ) yyparse ֵ 1ҪôʷؽǼǺŲҽܡ£yyparse ֵ 0
- -ûΪṩضĻһij磬ͬÿ C һ뱻õ main()յ yyparse⣬ yyerror һڼʱӡһϢ
- -ûijʽṩ̡Ϊ˼ʹ Yacc Ŭṩ˴ȱʡ汾 main yyerror һ⡣ϵͳģںܶϵͳʹõװ -ly ⡣ԴչʾЩȱʡ:
- - main(){
return( yyparse() );
}
-
-- -
# include <stdio.h>
yyerror(s) char *s; {
fprintf( stderr, "%s\n", s );
}
-
-yyerror IJǰϢַַͨsyntax error һӦÿҪõϢͨһӡⲿ yychar ڼʱǰǺŵıţԸõкôΪ -main (Ҫȵ)ʱûṩġYacc ֻСĿĿڽá
- -ⲿ yydebug ͨΪ 0ΪֵĶһѾĸźͽʲôۡڲϵͳͨʹõϵͳ -
- -ڰЧġڱĺĹ涨ĻӵʾСڶٵĶ
- -ṩʵʶĹһɶĹ涨ļѵġʽʾ鹦 Brian Kernighan -
- -- -- -a. ΪǺʹȫĴдĸΪսʹȫСдĸбʱ֪˭Ĺʧ
- -b. ķͶڷֿϡκһԶҪıһ
- -c. ֶͬ˵йһֶֻһΣкĹһܿʼ
- -d. ֻڴиֶ˵һĹ֮һֺţѷֺŷõС¹
- -e. tab ͣ壬 tab ͣ塣
- -
ڸ¼ A еʽдɣеҲ(ڿռĵط)ûʽϵԼǣĵʹڶԿɼġ
- -Yacc ʹõ㷨νݹķ: ʽĹ
- - name : name rest_of_rule ;
-
-дкб涨ʱֹ:
- - list : item
| list ',' item
;
-
-- -
seq : item
| seq item
;
-
-ÿ£һֻԵһĿԼڶԵڶĿԼ
- -ʹҵݹ
- - seq : item
| item seq
;
-
-ĿļԼصǣǷdzУڲջΣաԣֻҪϺûӦʹݹ顣
- -ԪصǷκֵÿǵģУдпչй涨:
- - seq : /* empty */
| seq item
;
-
-һΣһڶһĿ֮ǰԼһΣŵڶΪÿĿԼһΡоǿ˵һԡǣҪ Yacc ȥǸоͿܷͻʱûм㹻Ķȥ֪! -
- -һЩʷġ磬ʷͨҪɾհףڱõַеĿհײɾеֿ¼뵽űУʽеֲ¼롣
- -״һַʽǽһȫֱ־(flag)ʷ磬 0 0 ɵһ:
- - %{
int dflag;
%}
... other declarations ...
%%
prog : decls stats
;
decls : /* empty */
{ dflag = 1; }
| decls declaration
;
stats : /* empty */
{ dflag = 0; }
| stats statement
;
... other rules ...
-
-־ dflag ڶʱ 0ڶʱ 1ڵһеһǺų⡣ ǺűڽԶ϶ѾѾʼ֮ǰںܶ£һļǺⲻӰʷɨ衣
- -ʽܾϸкij̶ȡijЩѵķѣʽ
- -һЩûʹͨifΪǩ֣÷Щڱз÷ͻĻ Yacc ĿôǷdzѵģʷϢifʵǹؼ֣ǸʵDZʹǰһСĻƣûijԣѵġ
- -кüЩĽС۳֮ǰؼñ˵ֹ֮֡ƫǿķϵɡ
- -Yacc һЩ
- -Ĵͽܶڶʹú YYACCEPT -YYERROR ģ⡣YYACCEPT yyparse -ֵ 0YYERROR ½ֵͬǰһ yyerrorͷʹЩģǻصĽ
- -õǰĹĶֵֻƼͨĶȫͬʹøһֵԪţֿ 0
- - sent : adj noun verb adj noun
{ look at the sentence . . . }
;
adj : THE { $$ = THE; }
| YOUNG { $$ = YOUNG; }
. . .
;
noun : DOG
{ $$ = DOG; }
| CRONE
{ if( $0 == YOUNG ){
printf( "what?\n" );
}
$$ = CRONE;
}
;
. . .
-
-ڽ CRONE ĶУǰƽļǺŲ YOUNG ļ顣Եģֻ֪ noun ʲôʱǿܵġŲͬѰ֯ɫȻʱֻʡȥ鷳رҪĽṹųһЩϵʱ -
- -ȱʡģʹʷصֵYacc ֧͵ֵṹ⣬Yacc ͣȷϳԱ֣ԽĽϸͼ顣Yacc -ֵջ(μ½ 4)ΪҪֵ͵ϡûϣϳԱֵֹÿǺźͷսϡͨ $$ $n ֵʱYacc -ԶIJȷϳԱ֣Բת⣬ͼ Lint[5] ԽķӦǷdzƽġ -
- -ַʽṩͻơȣһַʽϣûΪرǴʷ֪ϳԱ֡ΣһַʽϳԱֹǺźͷսϡһֻ Yacc ͵Щټֵ͡
- -Ҫϣûа:
- - %union {
body of union ...
}
-
-Yacc ֵջⲿ -yylval yyval еϵ͡ʹ --d ѡ YaccƵ y.tab.h ļСѡһģҲͷļʹ typedef YYSTYPE ȥʾϡԣͷļ¶:
- - typedef union {
body of union ...
} YYSTYPE;
-
-ͷļͨʹ %{ %} С
- -һ YYSTYPEϳԱֹսͷսϡʹù
- - < name >
-
-ָʾһϳԱ֡Źؼ %token%left%right -%nonassoc ֮һϳԱֹгļǺϡд
- - %left <optype> '+' '-'
-
-¶ǺŷֵκöǩϳԱ optypeʹһƵĹؼ %type ϳԱֹսϡԣд
- - %type <nodetype> expr stat
-
-ԲһЩЩDzֵġڹڲһصֵû͡Ƶģĵֵ( $0 - μǰС)û Yacc ֪͵ķʽ£ͨڵһ $ ֮ŵ < > ֮ϳԱ֣ʩһ͡÷һ -
- - rule : aaa { $<intval>$ = 3; } bbb
{ fun( $<intval>2, $<other>0 ); }
;
-
-κٳ֡
- -ڸ¼ C иһ涨Сеʩʹ֮ǰDz: -رǣʹ %type ͻῪֻơʹǵʱһַdzϸļ鼶磬ʹ $n $$ ûж͵һЩᱻϳЩʩûбʹ Yacc ֵջ int ͣʷͬġ
- -Yacc ں̶ܴϹ鹦ûд̼ԵľףǶٶһ̽УʹҳԽҵı⣬ԽҵյIJԸ ѧҵķʽ飬Ұǵķʽ飻ʱǶԵġB. W. KernighanP. J. PlaugerS. I. FeldmanC. ImagnaM. E. Lesk A. Snyder ڵǰ Yacc 汾ܷijЩǵ뷨C. B. Haley ˴㷨D. M. RitchieB. W. Kernighan M. O. Harris ҰѱĵӢġҪرл Al AhoΪɽȤĶᵽºĬǰ -
- -1. B. W. Kernighan and D. M. Ritchie, The C Programming -Language, Prentice-Hall, Englewood Cliffs, New Jersey, 1978.
- -2. A. V. Aho and S. C. Johnson, "LR Parsing," -Comp. Surveys, vol. 6, no. 2, pp. 99-124, June 1974.
- -3. A. V. Aho, S. C. Johnson, and J. D. Ullman, -"Deterministic Parsing of Ambiguous Grammars," Comm. Assoc. Comp. -Mach., vol. 18, no. 8, pp. 441-452, August 1975.
- -4. A. V. Aho and J. D. Ullman, Principles of Compiler -Design, Addison-Wesley, Reading, Mass., 1977.
- -5. S. C. Johnson, "Lint, a C Program Checker," -Comp. Sci. Tech. Rep. No. 65, 1978 .]. updated version TM 78-1273-3
- -6. S. C. Johnson, "A Portable Compiler: Theory and -Practice," Proc. 5th ACM Symp. on Principles of Programming Languages, pp. -97-104, January 1978.
- -7. B. W. Kernighan and L. L. Cherry, "A System for -Typesetting Mathematics," Comm. Assoc. Comp. Mach., vol. 18, pp. 151-157, -Bell Laboratories, Murray Hill, New Jersey, March 1975 .].
- -8. M. E. Lesk, "Lex - A Lexical Analyzer -Generator," Comp. Sci. Tech. Rep. No. 39, Bell Laboratories, Murray Hill, -New Jersey, October 1975 .].
- -ӸǶһС Yacc 涨 26 ĴǩΪazʽIJ +-*/%(ģ)&(λ)|(λ)ֵıʽǸֵӡֵӡͬ C һ 0()ʼٶΪ˽ƣٶΪʮơ
- -Ϊ Yacc 涨һӣչʾʹȼ壬ʾ˼ĴҪĹȼǴʷαȶӦöҪɵģһнһСעķʽȡʮƺͰ˽ɴʷɡ -
- -%{
# include <stdio.h>
# include <ctype.h>
int regs[26];
int base;
%}
%start list
%token DIGIT LETTER
%left '|'
%left '&'
%left '+' '-'
%left '*' '/' '%'
%left UMINUS /* supplies precedence for unary minus */
%% /* beginning of rules section */
list : /* empty */
| list stat '\n'
| list error '\n'
{ yyerrok; }
;
stat : expr
{ printf( "%d\n", $1 ); }
| LETTER '=' expr
{ regs[$1] = $3; }
;
expr : '(' expr ')'
{ $$ = $2; }
| expr '+' expr
{ $$ = $1 + $3; }
| expr '-' expr
{ $$ = $1 - $3; }
| expr '*' expr
{ $$ = $1 * $3; }
| expr '/' expr
{ $$ = $1 / $3; }
| expr '%' expr
{ $$ = $1 % $3; }
| expr '&' expr
{ $$ = $1 & $3; }
| expr '|' expr
{ $$ = $1 | $3; }
| '-' expr %prec UMINUS
{ $$ = - $2; }
| LETTER
{ $$ = regs[$1]; }
| number
;
number : DIGIT
{ $$ = $1; base = ($1==0) ? 8 : 10; }
| number DIGIT
{ $$ = base * $1 + $2; }
;
%% /* start of programs */
yylex() { /* lexical analysis routine */
/* returns LETTER for a lower case letter, yylval = 0 through 25 */
/* return DIGIT for a digit, yylval = 0 through 9 */
/* all other characters are returned immediately */
int c;
while( (c=getchar()) == ' ' ) {/* skip blanks */ }
/* c is now nonblank */
if( islower( c ) ) {
yylval = c - 'a';
return ( LETTER );
}
if( isdigit( c ) ) {
yylval = c - '0';
return( DIGIT );
}
return( c );
}
-
-¼ Yacc 涨 Yacc صΪ̣Yacc 涨Ϊ LR(2) ķ涨ȻģճԵIJֳڹм˱ʶһʱʶһðţһĿʼ -ǵǰֻǶ˶ʱʵֵʱʷڼʶ֮ǰ鿴һǺ(հסСע -)ǷðšǣؼǺ C_IDENTIFIER IDENTIFIER(õַ)ҲΪ IDENTIFIER C_IDENTIFIER Ľɫ
- - /* grammar for the input to Yacc */
/* basic entities */
%token IDENTIFIER /* includes identifiers and literals */
%token C_IDENTIFIER /* identifier (but not literal) followed by colon */
%token NUMBER /* [0-9]+ */
/* reserved words: %type => TYPE, %left => LEFT, etc. */
%token LEFT RIGHT NONASSOC TOKEN PREC TYPE START UNION
%token MARK /* the %% mark */
%token LCURL /* the %{ mark */
%token RCURL /* the %} mark */
/* ascii character literals stand for themselves */
%start spec
%%
spec : defs MARK rules tail
;
tail : MARK { In this action, eat up the rest of the file }
| /* empty: the second MARK is optional */
;
defs : /* empty */
| defs def
;
def : START IDENTIFIER
| UNION { Copy union definition to output }
| LCURL { Copy C code to output file } RCURL
| ndefs rword tag nlist
;
rword : TOKEN
| LEFT
| RIGHT
| NONASSOC
| TYPE
;
tag : /* empty: union tag is optional */
| '<' IDENTIFIER '>'
;
nlist : nmno
| nlist nmno
| nlist ',' nmno
;
nmno : IDENTIFIER /* NOTE: literal illegal with %type */
| IDENTIFIER NUMBER /* NOTE: illegal with %type */
;
/* rules section */
rules : C_IDENTIFIER rbody prec
| rules rule
;
rule : C_IDENTIFIER rbody prec
| '|' rbody prec
;
rbody : /* empty */
| rbody IDENTIFIER
| rbody act
;
act : '{' { Copy action, translate $$, etc. } '}'
;
prec : /* empty */
| PREC IDENTIFIER
| PREC IDENTIFIER act
| prec ';'
;
-
-¼ʹڵ 10 ۵ĸķӡĸ¼ A ṩ⸡㳣 -+-*/һԪ - = (ֵ)дaz 26 ⣬䣬дΪ -
- - ( x , y )
-
-x Сڵ yʹôAZ 26 ֵ÷ڸ¼ Aֵֵӡʽӡ()ֵ
- -̽ Yacc C һЩȤʾΪɴ洢Ϊ˫ȵҶ˵ֵɵĽṹͨʹ -typedef ṹһ INTERVALYacc -ֵջ(бֵ)עȫЩǿҵܹ C Ըֵṹϡʵϣܶදͬĵ÷ؽṹĺ
- -ֵעĻʹ YYERROR Ĵ״: 0 䣬Դ䡣ЧϣYacc ĴЩе²ֵġ
- -ֵջ͵ĻϣķչʾȤãнʽ(DZ)עҪһֵԶΪ䡣ͨ Yacc ķʱ´ijͻ: 18 ƽ/Լ 26 Լ/Լͻ鿴оܼ:
- - 2.5 + ( 3.5 - 4. )
-
-- -
2.5 + ( 3.5 , 4. )
-
-עڵڶ 2.5 ҪһֵʽУʵDz֪һֱ,ʱ2.5 Ѿˣܻȥı뷨һģҪǰ鿴ĿļǺǷһת䡣ͨÿԪֵʹ -: (operand)DZʱһֵʱһڵڶ£Ҳһ䣬ԽԶӦת -ܣкܶӦҲԲתͻͨڹ涨ļгĹַʽ£ڱֱֵʽıֵ ֱDZ뱻ǿƳΪķϽͻ
- -͵ַʽǷdzнģǺһԵġкֱܶʽͶֻ֣ҪĹĿϷԵͻĿϷԡ -ԣнģڸıԻаϢΪֵһ֡ΪķһǸʵõġ
- -˵һ´ʷΨһѰǸ㳣Ĵáʹ -C atof ַ˫ֵʵתʷһͨķǷǷһǺΪӦڽеһ -
- -%{
# include <stdio.h>
# include <ctype.h>
typedef struct interval {
double lo, hi;
} INTERVAL;
INTERVAL vmul(), vdiv();
double atof();
double dreg[ 26 ];
INTERVAL vreg[ 26 ];
%}
%start lines
%union {
int ival;
double dval;
INTERVAL vval;
}
%token <ival> DREG VREG /* indices into dreg, vreg arrays */
%token <dval> CONST /* floating point constant */
%type <dval> dexp /* expression */
%type <vval> vexp /* interval expression */
/* precedence information about the operators */
%left '+' '-'
%left '*' '/'
%left UMINUS /* precedence for unary minus */
%%
lines : /* empty */
| lines line
;
line : dexp '\n'
{ printf( "%15.8f\n", $1 ); }
| vexp '\n'
{ printf( "(%15.8f , %15.8f )\n", $1.lo, $1.hi ); }
| DREG '=' dexp '\n'
{ dreg[$1] = $3; }
| VREG '=' vexp '\n'
{ vreg[$1] = $3; }
| error '\n'
{ yyerrok; }
;
dexp : CONST
| DREG
{ $$ = dreg[$1]; }
| dexp '+' dexp
{ $$ = $1 + $3; }
| dexp '-' dexp
{ $$ = $1 - $3; }
| dexp '*' dexp
{ $$ = $1 * $3; }
| dexp '/' dexp
{ $$ = $1 / $3; }
| '-' dexp %prec UMINUS
{ $$ = - $2; }
| '(' dexp ')'
{ $$ = $2; }
;
vexp : dexp
{ $$.hi = $$.lo = $1; }
| '(' dexp ',' dexp ')'
{
$$.lo = $2;
$$.hi = $4;
if( $$.lo > $$.hi ){
printf( "interval out of order\n" );
YYERROR;
}
}
| VREG
{ $$ = vreg[$1]; }
| vexp '+' vexp
{ $$.hi = $1.hi + $3.hi;
$$.lo = $1.lo + $3.lo; }
| dexp '+' vexp
{ $$.hi = $1 + $3.hi;
$$.lo = $1 + $3.lo; }
| vexp '-' vexp
{ $$.hi = $1.hi - $3.lo;
$$.lo = $1.lo - $3.hi; }
| dexp '-' vexp
{ $$.hi = $1 - $3.lo;
$$.lo = $1 - $3.hi; }
| vexp '*' vexp
{ $$ = vmul( $1.lo, $1.hi, $3 ); }
| dexp '*' vexp
{ $$ = vmul( $1, $1, $3 ); }
| vexp '/' vexp
{ if( dcheck( $3 ) ) YYERROR;
$$ = vdiv( $1.lo, $1.hi, $3 ); }
| dexp '/' vexp
{ if( dcheck( $3 ) ) YYERROR;
$$ = vdiv( $1, $1, $3 ); }
| '-' vexp %prec UMINUS
{ $$.hi = -$2.lo; $$.lo = -$2.hi; }
| '(' vexp ')'
{ $$ = $2; }
;
%%
# define BSZ 50 /* buffer size for floating point numbers */
/* lexical analysis */
yylex(){
register c;
while( (c=getchar()) == ' ' ){ /* skip over blanks */ }
if( isupper( c ) ){
yylval.ival = c - 'A';
return( VREG );
}
if( islower( c ) ){
yylval.ival = c - 'a';
return( DREG );
}
if( isdigit( c ) || c=='.' ){
/* gobble up digits, points, exponents */
char buf[BSZ+1], *cp = buf;
int dot = 0, exp = 0;
for( ; (cp-buf)<BSZ ; ++cp,c=getchar() ){
*cp = c;
if( isdigit( c ) ) continue;
if( c == '.' ){
if( dot++ || exp ) return( '.' ); /* will cause syntax error */
continue;
}
if( c == 'e' ){
if( exp++ ) return( 'e' ); /* will cause syntax error */
continue;
}
/* end of number */
break;
}
*cp = '\0';
if( (cp-buf) >= BSZ ) printf( "constant too long: truncated\n" );
else ungetc( c, stdin ); /* push back last char read */
yylval.dval = atof( buf );
return( CONST );
}
return( c );
}
INTERVAL hilo( a, b, c, d ) double a, b, c, d; {
/* returns the smallest interval containing a, b, c, and d */
/* used by *, / routines */
INTERVAL v;
if( a>b ) { v.hi = a; v.lo = b; }
else { v.hi = b; v.lo = a; }
if( c>d ) {
if( c>v.hi ) v.hi = c;
if( d<v.lo ) v.lo = d;
}
else {
if( d>v.hi ) v.hi = d;
if( c<v.lo ) v.lo = c;
}
return( v );
}
INTERVAL vmul( a, b, v ) double a, b; INTERVAL v; {
return( hilo( a*v.hi, a*v.lo, b*v.hi, b*v.lo ) );
}
dcheck( v ) INTERVAL v; {
if( v.hi >= 0. && v.lo <= 0. ){
printf( "divisor interval contains 0.\n" );
return( 1 );
}
return( 0 );
}
INTERVAL vdiv( a, b, v ) double a, b; INTERVAL v; {
return( hilo( a/v.hi, a/v.lo, b/v.hi, b/v.lo ) );
}
-
-¼漰ΪʷԶֵֺ֧ͬڸԭʹá
- -- -- -1. Ҳ˫"硣
- -2. ҲԶһַַĸ֡ _ֵͱţͬûаΧһҵֵֵ
- -ֵַʹ˲Ϥ Yacc ˣΪʾ Yacc ʵϴʷĹ
- -3. % ϷĶλãб\Ҳáرǣ\\ ͬ %%\left ͬ %left ȵȡ
- -4. һЩͬ:
- -- -- -%< ͬ %left
- -
-%> ͬ %right
-%binary %2 ͬ %nonassoc
-%0 %term ͬ %token
-%= ͬ %prec5. Ҳʽ
- -={ . . . }
- -һһ C Ҳȥ
- -6. %{ -%} ֮ C ߳ڹεͷ֣ͬһ
- -
Modifier and Type | -Constant Field | -Value | -
---|---|---|
-
-private static final java.lang.String |
-mainClassName |
-"Main" |
-
-
-private static final java.lang.String |
-mainFuncName |
-"main" |
-
Modifier and Type | -Constant Field | -Value | -
---|---|---|
-
-public static final java.lang.String |
-ARRAY_INDEX_OUT_OF_BOUND |
-"Decaf runtime error: Array subscript out of bounds\n" |
-
-
-public static final java.lang.String |
-CLASS_CAST_ERROR1 |
-"Decaf runtime error: " |
-
-
-public static final java.lang.String |
-CLASS_CAST_ERROR2 |
-" cannot be cast to " |
-
-
-public static final java.lang.String |
-CLASS_CAST_ERROR3 |
-"\n" |
-
-
-public static final java.lang.String |
-NEGATIVE_ARR_SIZE |
-"Decaf runtime error: Cannot create negative-sized array\n" |
-
Modifier and Type | -Constant Field | -Value | -
---|---|---|
-
-public static final int |
-S |
-1 |
-
-
-public static final int |
-YYEOF |
--1 |
-
-
-public static final int |
-YYINITIAL |
-0 |
-
-
-private static final java.lang.String |
-ZZ_ACTION_PACKED_0 |
-"\u0002\u0000\u0001\u0001\u0002\u0002\u0001\u0003\u0001\u0004\u0001\u0003\u0006\u0005\u0001\u0002\r\u0004\u0002\u0001\u0001\u0006\u0001\u0007\u0002\b\u0001\t\u0001\u0007\u0002\u0000\u0001\n\u0001\u000b\u0001\f\u0001\r\u0002\u0004\u0001\u000e\u0010\u0004\u0001\u000f\u0001\u0010\u0001\u0011\u0001\u0012\u0001\u0013\u0001\u0014\u0001\u0003\u0001\u0004\u0001\u0015\u0001\u0004\u0001\u0016\f\u0004\u0001\u0017\u0003\u0004\u0001\u0018\u0001\u0004\u0001\u0019\u0001\u001a\u0001\u001b\u0001\u001c\u0004\u0004\u0001\u001d\u0007\u0004\u0001\u001e\u0004\u0004\u0001\u001f\u0001 \u0001!\u0001\"\u0003\u0004\u0001#\u0001$\u0001%\u0004\u0004\u0001&\u0004\u0004\u0001\'\u0002\u0004\u0001(\u0001\u0004\u0001)" |
-
-
-private static final int |
-ZZ_BUFFERSIZE |
-16384 |
-
-
-private static final java.lang.String |
-ZZ_CMAP_PACKED |
-"\t\u0000\u0001\u000f\u0001\u0002\u0002\u0000\u0001\u0001\u0012\u0000\u0001\u000f\u0001\u000e\u0001*\u0002\u0000\u0001\t\u0001(\u0001\u0000\u0001\t\u0001\t\u0001\t\u0001\t\u0001\t\u0001\t\u0001\t\u0001\n\u0001\u0005\t\u0003\u0001\u0000\u0001\t\u0001\f\u0001\u000b\u0001\r\u0002\u0000\u0006\u0004\u0002\u0007\u0001&\u0002\u0007\u0001\'\u0003\u0007\u0001$\u0001\u0007\u0001%\u0005\u0007\u0001\u0006\u0002\u0007\u0001\t\u0001+\u0001\t\u0001\u0000\u0001\b\u0001\u0000\u0001\u001f\u0001\u0016\u0001\u001e\u0001\u0013\u0001\u001b\u0001\"\u0001\u001a\u0001!\u0001\u0012\u0001\u0007\u0001#\u0001\u0017\u0001\u0007\u0001\u0014\u0001\u0011\u0002\u0007\u0001\u0019\u0001\u0018\u0001\u0015\u0001\u001d\u0001\u0010\u0001\u001c\u0001 \u0002\u0007\u0001\t\u0001)\u0001\t\uff82\u0000" |
-
-
-private static final int |
-ZZ_NO_MATCH |
-1 |
-
-
-private static final int |
-ZZ_PUSHBACK_2BIG |
-2 |
-
-
-private static final int |
-ZZ_UNKNOWN_ERROR |
-0 |
-
Modifier and Type | -Constant Field | -Value | -
---|---|---|
-
-public static final short |
-AND |
-277 |
-
-
-public static final short |
-BOOL |
-258 |
-
-
-public static final short |
-BREAK |
-270 |
-
-
-public static final short |
-CLASS |
-261 |
-
-
-public static final short |
-ELSE |
-268 |
-
-
-public static final short |
-EMPTY |
-286 |
-
-
-public static final short |
-EQUAL |
-283 |
-
-
-public static final short |
-EXTENDS |
-263 |
-
-
-public static final short |
-FOR |
-266 |
-
-
-public static final short |
-GREATER_EQUAL |
-282 |
-
-
-public static final short |
-IDENTIFIER |
-276 |
-
-
-public static final short |
-IF |
-267 |
-
-
-public static final short |
-INSTANCEOF |
-280 |
-
-
-public static final short |
-INT |
-259 |
-
-
-public static final short |
-LESS_EQUAL |
-281 |
-
-
-public static final short |
-LITERAL |
-275 |
-
-
-public static final short |
-NEW |
-271 |
-
-
-public static final short |
-NOT_EQUAL |
-284 |
-
-
-public static final short |
-NULL |
-262 |
-
-
-public static final short |
-OR |
-278 |
-
-
-public static final short |
-PRINT |
-272 |
-
-
-public static final short |
-READ_INTEGER |
-273 |
-
-
-public static final short |
-READ_LINE |
-274 |
-
-
-public static final short |
-RETURN |
-269 |
-
-
-public static final short |
-STATIC |
-279 |
-
-
-public static final short |
-STRING |
-260 |
-
-
-public static final short |
-THIS |
-264 |
-
-
-public static final short |
-UMINUS |
-285 |
-
-
-public static final short |
-VOID |
-257 |
-
-
-public static final short |
-WHILE |
-265 |
-
-
-public static final short |
-YYERRCODE |
-256 |
-
-
-static final short |
-YYFINAL |
-2 |
-
-
-static final short |
-YYMAXTOKEN |
-286 |
-
-
-static final int |
-YYSTACKSIZE |
-500 |
-
-
-static final int |
-YYTABLESIZE |
-1031 |
-
Modifier and Type | -Constant Field | -Value | -
---|---|---|
-
-public static final int |
-AND |
-52 |
-
-
-public static final int |
-APPLY |
-25 |
-
-
-public static final int |
-ASSERT |
-24 |
-
-
-public static final int |
-ASSIGN |
-29 |
-
-
-public static final int |
-BITAND |
-55 |
-
-
-public static final int |
-BITOR |
-53 |
-
-
-public static final int |
-BITXOR |
-54 |
-
-
-public static final int |
-BLOCK |
-7 |
-
-
-public static final int |
-BOOL |
-2 |
-
-
-public static final int |
-BREAK |
-20 |
-
-
-public static final int |
-CALLEXPR |
-71 |
-
-
-public static final int |
-CASE |
-13 |
-
-
-public static final int |
-CATCH |
-16 |
-
-
-public static final int |
-CLASSDEF |
-3 |
-
-
-public static final int |
-COMPL |
-45 |
-
-
-public static final int |
-CONDEXPR |
-17 |
-
-
-public static final int |
-CONTINUE |
-21 |
-
-
-public static final int |
-DIV |
-68 |
-
-
-public static final int |
-DOLOOP |
-8 |
-
-
-public static final int |
-EQ |
-56 |
-
-
-public static final int |
-ERRONEOUS |
-41 |
-
-
-public static final int |
-EXEC |
-19 |
-
-
-public static final int |
-FORLOOP |
-10 |
-
-
-public static final int |
-GE |
-61 |
-
-
-public static final int |
-GT |
-59 |
-
-
-public static final int |
-IDENT |
-34 |
-
-
-public static final int |
-IF |
-18 |
-
-
-public static final int |
-IMPORT |
-2 |
-
-
-public static final int |
-INDEXED |
-32 |
-
-
-public static final int |
-INT |
-1 |
-
-
-public static final int |
-LABELLED |
-11 |
-
-
-public static final int |
-LE |
-60 |
-
-
-public static final int |
-LITERAL |
-35 |
-
-
-public static final int |
-LT |
-58 |
-
-
-public static final int |
-METHODDEF |
-4 |
-
-
-public static final int |
-MINUS |
-66 |
-
-
-public static final int |
-MOD |
-69 |
-
-
-public static final int |
-MUL |
-67 |
-
-
-public static final int |
-NE |
-57 |
-
-
-public static final int |
-NEG |
-43 |
-
-
-public static final int |
-NEWARRAY |
-27 |
-
-
-public static final int |
-NEWCLASS |
-26 |
-
-
-public static final int |
-NOT |
-44 |
-
-
-public static final int |
-NULL |
-70 |
-
-
-public static final int |
-NULLCHK |
-50 |
-
-
-public static final int |
-OR |
-51 |
-
-
-public static final int |
-PARENS |
-28 |
-
-
-public static final int |
-PLUS |
-65 |
-
-
-public static final int |
-POS |
-42 |
-
-
-public static final int |
-POSTDEC |
-49 |
-
-
-public static final int |
-POSTINC |
-48 |
-
-
-public static final int |
-PREDEC |
-47 |
-
-
-public static final int |
-PREINC |
-46 |
-
-
-public static final int |
-PRINT |
-75 |
-
-
-public static final int |
-READINTEXPR |
-73 |
-
-
-public static final int |
-READLINEEXPR |
-74 |
-
-
-public static final int |
-RETURN |
-22 |
-
-
-public static final int |
-SELECT |
-33 |
-
-
-public static final int |
-SKIP |
-6 |
-
-
-public static final int |
-SL |
-62 |
-
-
-public static final int |
-SR |
-63 |
-
-
-public static final int |
-STRING |
-3 |
-
-
-public static final int |
-SWITCH |
-12 |
-
-
-public static final int |
-SYNCHRONIZED |
-14 |
-
-
-public static final int |
-THISEXPR |
-72 |
-
-
-public static final int |
-THROW |
-23 |
-
-
-public static final int |
-TOPLEVEL |
-1 |
-
-
-public static final int |
-TRY |
-15 |
-
-
-public static final int |
-TYPEAPPLY |
-39 |
-
-
-public static final int |
-TYPEARRAY |
-38 |
-
-
-public static final int |
-TYPECAST |
-30 |
-
-
-public static final int |
-TYPECLASS |
-37 |
-
-
-public static final int |
-TYPEIDENT |
-36 |
-
-
-public static final int |
-TYPEPARAMETER |
-40 |
-
-
-public static final int |
-TYPETEST |
-31 |
-
-
-public static final int |
-USR |
-64 |
-
-
-public static final int |
-VARDEF |
-5 |
-
-
-public static final int |
-VOID |
-0 |
-
-
-public static final int |
-WHILELOOP |
-9 |
-
public final class Driver
-extends java.lang.Object
-Modifier and Type | -Field and Description | -
---|---|
private static Driver |
-driver |
-
private java.util.List<DecafError> |
-errors |
-
private Lexer |
-lexer |
-
private Option |
-option |
-
private Parser |
-parser |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-checkPoint() |
-
private void |
-compile() |
-
static Driver |
-getDriver() |
-
Option |
-getOption() |
-
private void |
-init() |
-
void |
-issueError(DecafError error) |
-
static void |
-main(java.lang.String[] args) |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private static Driver driver-
private java.util.List<DecafError> errors-
private Lexer lexer-
private Option option-
private Parser parser-
public void checkPoint()-
private void compile()-
public static Driver getDriver()-
public Option getOption()-
private void init()-
public void issueError(DecafError error)-
public static void main(java.lang.String[] args) - throws java.io.IOException-
java.io.IOException
Modifier and Type | -Field and Description | -
---|---|
private int |
-column
-该符号第一个字符所在的列号
- |
-
private int |
-line
-该符号第一个字符所在的行号
- |
-
static Location |
-NO_LOCATION |
-
Constructor and Description | -
---|
Location(int lin,
- int col)
-构造一个位置记录
- |
-
Modifier and Type | -Method and Description | -
---|---|
int |
-compareTo(Location o) |
-
java.lang.String |
-toString()
-转换成(x,y)形式的字符串
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private int column-
private int line-
public static final Location NO_LOCATION-
public static enum Option.Level -extends java.lang.Enum<Option.Level>-
Enum Constant and Description | -
---|
LEVEL0 |
-
LEVEL1 |
-
LEVEL2 |
-
LEVEL3 |
-
LEVEL4 |
-
Modifier and Type | -Method and Description | -
---|---|
static Option.Level |
-valueOf(java.lang.String name)
-Returns the enum constant of this type with the specified name.
- |
-
static Option.Level[] |
-values()
-Returns an array containing the constants of this enum type, in
-the order they are declared.
- |
-
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getClass, notify, notifyAll, wait, wait, wait
public static final Option.Level LEVEL0-
public static final Option.Level LEVEL1-
public static final Option.Level LEVEL2-
public static final Option.Level LEVEL3-
public static final Option.Level LEVEL4-
public static Option.Level valueOf(java.lang.String name)-
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static Option.Level[] values()-
-for (Option.Level c : Option.Level.values()) - System.out.println(c); -
public final class Option
-extends java.lang.Object
-Modifier and Type | -Class and Description | -
---|---|
static class |
-Option.Level |
-
Modifier and Type | -Field and Description | -
---|---|
private java.lang.String |
-dstFileName |
-
private java.io.PrintStream |
-err |
-
private java.io.InputStream |
-input |
-
private Option.Level |
-level |
-
private static java.lang.String |
-mainClassName |
-
private static java.lang.String |
-mainFuncName |
-
private java.io.PrintStream |
-output |
-
private java.lang.String |
-srcFileName |
-
Constructor and Description | -
---|
Option(java.lang.String[] args) |
-
Modifier and Type | -Method and Description | -
---|---|
java.lang.String |
-getDstFileName() |
-
java.io.PrintStream |
-getErr() |
-
java.io.InputStream |
-getInput() |
-
Option.Level |
-getLevel() |
-
java.lang.String |
-getMainClassName() |
-
java.lang.String |
-getMainFuncName() |
-
java.io.PrintStream |
-getOutput() |
-
java.lang.String |
-getSrcFileName() |
-
private java.lang.String |
-usage() |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private java.lang.String dstFileName-
private java.io.PrintStream err-
private java.io.InputStream input-
private Option.Level level-
private static final java.lang.String mainClassName-
private static final java.lang.String mainFuncName-
private java.io.PrintStream output-
private java.lang.String srcFileName-
public java.lang.String getDstFileName()-
public java.io.PrintStream getErr()-
public java.io.InputStream getInput()-
public Option.Level getLevel()-
public java.lang.String getMainClassName()-
public java.lang.String getMainFuncName()-
public java.io.PrintStream getOutput()-
public java.lang.String getSrcFileName()-
private java.lang.String usage()-
Package | -Description | -
---|---|
decaf | -- |
decaf.error | -- |
decaf.frontend | -- |
decaf.tree | -- |
Modifier and Type | -Field and Description | -
---|---|
static Location |
-Location.NO_LOCATION |
-
Modifier and Type | -Method and Description | -
---|---|
int |
-Location.compareTo(Location o) |
-
Modifier and Type | -Field and Description | -
---|---|
private Location |
-DeclConflictError.earlier |
-
protected Location |
-DecafError.location
-编译错误所在的位置
- |
-
Modifier and Type | -Method and Description | -
---|---|
Location |
-DecafError.getLocation() |
-
Constructor and Description | -
---|
BadArgCountError(Location location,
- java.lang.String method,
- int expect,
- int count) |
-
BadArgTypeError(Location location,
- int count,
- java.lang.String given,
- java.lang.String expect) |
-
BadArrElementError(Location location) |
-
BadInheritanceError(Location location) |
-
BadLengthArgError(Location location,
- int count) |
-
BadLengthError(Location location) |
-
BadNewArrayLength(Location location) |
-
BadOverrideError(Location location,
- java.lang.String funcName,
- java.lang.String parentName) |
-
BadPrintArgError(Location location,
- java.lang.String count,
- java.lang.String type) |
-
BadReturnTypeError(Location location,
- java.lang.String expect,
- java.lang.String given) |
-
BadTestExpr(Location location) |
-
BadVarTypeError(Location location,
- java.lang.String name) |
-
BreakOutOfLoopError(Location location) |
-
ClassNotFoundError(Location location,
- java.lang.String name) |
-
DecafError(Location location) |
-
DeclConflictError(Location location,
- java.lang.String name,
- Location earlier) |
-
FieldNotAccessError(Location location,
- java.lang.String name,
- java.lang.String owner) |
-
FieldNotFoundError(Location location,
- java.lang.String name,
- java.lang.String owner) |
-
IncompatBinOpError(Location location,
- java.lang.String left,
- java.lang.String op,
- java.lang.String right) |
-
IncompatUnOpError(Location location,
- java.lang.String op,
- java.lang.String expr) |
-
IntTooLargeError(Location location,
- java.lang.String val) |
-
MsgError(Location location,
- java.lang.String msg) |
-
NewlineInStrError(Location location,
- java.lang.String str) |
-
NotArrayError(Location location) |
-
NotClassError(java.lang.String type,
- Location location) |
-
NotClassFieldError(Location location,
- java.lang.String name,
- java.lang.String owner) |
-
NotClassMethodError(Location location,
- java.lang.String name,
- java.lang.String owner) |
-
OverridingVarError(Location location,
- java.lang.String name) |
-
RefNonStaticError(Location location,
- java.lang.String from,
- java.lang.String ref) |
-
SubNotIntError(Location location) |
-
ThisInStaticFuncError(Location location) |
-
UndeclVarError(Location location,
- java.lang.String name) |
-
UnrecogCharError(Location location,
- char c) |
-
UntermStrError(Location location,
- java.lang.String str) |
-
Modifier and Type | -Field and Description | -
---|---|
Location |
-SemValue.loc |
-
private Location |
-Lexer.sloc |
-
Modifier and Type | -Method and Description | -
---|---|
Location |
-Lexer.getLocation() |
-
(package private) abstract Location |
-BaseLexer.getLocation() |
-
Modifier and Type | -Method and Description | -
---|---|
protected void |
-BaseLexer.setSemantic(Location where,
- SemValue v) |
-
protected int |
-BaseLexer.StringConst(java.lang.String sval,
- Location loc) |
-
Modifier and Type | -Field and Description | -
---|---|
Location |
-Tree.loc |
-
Modifier and Type | -Method and Description | -
---|---|
Location |
-Tree.getLocation() |
-
Constructor and Description | -
---|
Apply(Tree.Expr receiver,
- java.lang.String method,
- java.util.List<Tree.Expr> actuals,
- Location loc) |
-
Assign(Tree.LValue left,
- Tree.Expr expr,
- Location loc) |
-
Binary(int kind,
- Tree.Expr left,
- Tree.Expr right,
- Location loc) |
-
Block(java.util.List<Tree> block,
- Location loc) |
-
Break(Location loc) |
-
CallExpr(Tree.Expr receiver,
- java.lang.String method,
- java.util.List<Tree.Expr> actuals,
- Location loc) |
-
ClassDef(java.lang.String name,
- java.lang.String parent,
- java.util.List<Tree> fields,
- Location loc) |
-
Exec(Tree.Expr expr,
- Location loc) |
-
Expr(int tag,
- Location loc) |
-
ForLoop(Tree init,
- Tree.Expr condition,
- Tree update,
- Tree loopBody,
- Location loc) |
-
Ident(Tree.Expr owner,
- java.lang.String name,
- Location loc) |
-
If(Tree.Expr condition,
- Tree trueBranch,
- Tree falseBranch,
- Location loc) |
-
Indexed(Tree.Expr array,
- Tree.Expr index,
- Location loc) |
-
Literal(int typeTag,
- java.lang.Object value,
- Location loc) |
-
LValue(int tag,
- Location loc) |
-
MethodDef(boolean statik,
- java.lang.String name,
- Tree.TypeLiteral returnType,
- java.util.List<Tree.VarDef> formals,
- Tree.Block body,
- Location loc) |
-
NewArray(Tree.TypeLiteral elementType,
- Tree.Expr length,
- Location loc) |
-
NewClass(java.lang.String className,
- Location loc) |
-
Null(Location loc) |
-
Print(java.util.List<Tree.Expr> exprs,
- Location loc) |
-
ReadIntExpr(Location loc) |
-
ReadLineExpr(Location loc) |
-
Return(Tree.Expr expr,
- Location loc) |
-
Skip(Location loc) |
-
ThisExpr(Location loc) |
-
TopLevel(java.util.List<Tree.ClassDef> classes,
- Location loc) |
-
Tree(int tag,
- Location loc)
-Initialize tree with given tag.
- |
-
TypeArray(Tree.TypeLiteral elementType,
- Location loc) |
-
TypeCast(java.lang.String className,
- Tree.Expr expr,
- Location loc) |
-
TypeClass(java.lang.String name,
- Location loc) |
-
TypeIdent(int typeTag,
- Location loc) |
-
TypeLiteral(int tag,
- Location loc) |
-
TypeTest(Tree.Expr instance,
- java.lang.String className,
- Location loc) |
-
Unary(int kind,
- Tree.Expr expr,
- Location loc) |
-
VarDef(java.lang.String name,
- Tree.TypeLiteral type,
- Location loc) |
-
WhileLoop(Tree.Expr condition,
- Tree loopBody,
- Location loc) |
-
Package | -Description | -
---|---|
decaf | -- |
Modifier and Type | -Field and Description | -
---|---|
private Option.Level |
-Option.level |
-
Modifier and Type | -Method and Description | -
---|---|
Option.Level |
-Option.getLevel() |
-
static Option.Level |
-Option.Level.valueOf(java.lang.String name)
-Returns the enum constant of this type with the specified name.
- |
-
static Option.Level[] |
-Option.Level.values()
-Returns an array containing the constants of this enum type, in
-the order they are declared.
- |
-
public class BadArgCountError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private int |
-count |
-
private int |
-expect |
-
private java.lang.String |
-method |
-
location
Constructor and Description | -
---|
BadArgCountError(Location location,
- java.lang.String method,
- int expect,
- int count) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private int count-
private int expect-
private java.lang.String method-
public BadArgCountError(Location location, - java.lang.String method, - int expect, - int count)-
protected java.lang.String getErrMsg()-
getErrMsg
in class DecafError
public class BadArgTypeError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private int |
-count |
-
private java.lang.String |
-expect |
-
private java.lang.String |
-given |
-
location
Constructor and Description | -
---|
BadArgTypeError(Location location,
- int count,
- java.lang.String given,
- java.lang.String expect) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private int count-
private java.lang.String expect-
private java.lang.String given-
public BadArgTypeError(Location location, - int count, - java.lang.String given, - java.lang.String expect)-
protected java.lang.String getErrMsg()-
getErrMsg
in class DecafError
public class BadArrElementError -extends DecafError-
location
Constructor and Description | -
---|
BadArrElementError(Location location) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public class BadInheritanceError -extends DecafError-
location
Constructor and Description | -
---|
BadInheritanceError(Location location) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public class BadLengthArgError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private int |
-count |
-
location
Constructor and Description | -
---|
BadLengthArgError(Location location,
- int count) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public class BadLengthError -extends DecafError-
location
Constructor and Description | -
---|
BadLengthError(Location location) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public class BadNewArrayLength -extends DecafError-
location
Constructor and Description | -
---|
BadNewArrayLength(Location location) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public class BadOverrideError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private java.lang.String |
-funcName |
-
private java.lang.String |
-parentName |
-
location
Constructor and Description | -
---|
BadOverrideError(Location location,
- java.lang.String funcName,
- java.lang.String parentName) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private java.lang.String funcName-
private java.lang.String parentName-
public BadOverrideError(Location location, - java.lang.String funcName, - java.lang.String parentName)-
protected java.lang.String getErrMsg()-
getErrMsg
in class DecafError
public class BadPrintArgError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private java.lang.String |
-count |
-
private java.lang.String |
-type |
-
location
Constructor and Description | -
---|
BadPrintArgError(Location location,
- java.lang.String count,
- java.lang.String type) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private java.lang.String count-
private java.lang.String type-
public BadPrintArgError(Location location, - java.lang.String count, - java.lang.String type)-
protected java.lang.String getErrMsg()-
getErrMsg
in class DecafError
public class BadReturnTypeError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private java.lang.String |
-expect |
-
private java.lang.String |
-given |
-
location
Constructor and Description | -
---|
BadReturnTypeError(Location location,
- java.lang.String expect,
- java.lang.String given) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private java.lang.String expect-
private java.lang.String given-
public BadReturnTypeError(Location location, - java.lang.String expect, - java.lang.String given)-
protected java.lang.String getErrMsg()-
getErrMsg
in class DecafError
public class BadTestExpr -extends DecafError-
location
Constructor and Description | -
---|
BadTestExpr(Location location) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public class BadVarTypeError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private java.lang.String |
-name |
-
location
Constructor and Description | -
---|
BadVarTypeError(Location location,
- java.lang.String name) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public BadVarTypeError(Location location, - java.lang.String name)-
protected java.lang.String getErrMsg()-
getErrMsg
in class DecafError
public class BreakOutOfLoopError -extends DecafError-
location
Constructor and Description | -
---|
BreakOutOfLoopError(Location location) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public class ClassNotFoundError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private java.lang.String |
-name |
-
location
Constructor and Description | -
---|
ClassNotFoundError(Location location,
- java.lang.String name) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public ClassNotFoundError(Location location, - java.lang.String name)-
protected java.lang.String getErrMsg()-
getErrMsg
in class DecafError
public abstract class DecafError
-extends java.lang.Object
-Modifier and Type | -Field and Description | -
---|---|
protected Location |
-location
-编译错误所在的位置
- |
-
Constructor and Description | -
---|
DecafError(Location location) |
-
Modifier and Type | -Method and Description | -
---|---|
protected abstract java.lang.String |
-getErrMsg() |
-
Location |
-getLocation() |
-
java.lang.String |
-toString()
-返回包含位置信息在内的完整错误信息
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
protected abstract java.lang.String getErrMsg()-
public Location getLocation()-
public java.lang.String toString()-
toString
in class java.lang.Object
public class DeclConflictError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private Location |
-earlier |
-
private java.lang.String |
-name |
-
location
Constructor and Description | -
---|
DeclConflictError(Location location,
- java.lang.String name,
- Location earlier) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private Location earlier-
private java.lang.String name-
protected java.lang.String getErrMsg()-
getErrMsg
in class DecafError
public class FieldNotAccessError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private java.lang.String |
-name |
-
private java.lang.String |
-owner |
-
location
Constructor and Description | -
---|
FieldNotAccessError(Location location,
- java.lang.String name,
- java.lang.String owner) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private java.lang.String name-
private java.lang.String owner-
public FieldNotAccessError(Location location, - java.lang.String name, - java.lang.String owner)-
protected java.lang.String getErrMsg()-
getErrMsg
in class DecafError
public class FieldNotFoundError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private java.lang.String |
-name |
-
private java.lang.String |
-owner |
-
location
Constructor and Description | -
---|
FieldNotFoundError(Location location,
- java.lang.String name,
- java.lang.String owner) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private java.lang.String name-
private java.lang.String owner-
public FieldNotFoundError(Location location, - java.lang.String name, - java.lang.String owner)-
protected java.lang.String getErrMsg()-
getErrMsg
in class DecafError
public class IncompatBinOpError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private java.lang.String |
-left |
-
private java.lang.String |
-op |
-
private java.lang.String |
-right |
-
location
Constructor and Description | -
---|
IncompatBinOpError(Location location,
- java.lang.String left,
- java.lang.String op,
- java.lang.String right) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private java.lang.String left-
private java.lang.String op-
private java.lang.String right-
public IncompatBinOpError(Location location, - java.lang.String left, - java.lang.String op, - java.lang.String right)-
protected java.lang.String getErrMsg()-
getErrMsg
in class DecafError
public class IncompatUnOpError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private java.lang.String |
-expr |
-
private java.lang.String |
-op |
-
location
Constructor and Description | -
---|
IncompatUnOpError(Location location,
- java.lang.String op,
- java.lang.String expr) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private java.lang.String expr-
private java.lang.String op-
public IncompatUnOpError(Location location, - java.lang.String op, - java.lang.String expr)-
protected java.lang.String getErrMsg()-
getErrMsg
in class DecafError
public class IntTooLargeError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private java.lang.String |
-val |
-
location
Constructor and Description | -
---|
IntTooLargeError(Location location,
- java.lang.String val) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public IntTooLargeError(Location location, - java.lang.String val)-
protected java.lang.String getErrMsg()-
getErrMsg
in class DecafError
public class MsgError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private java.lang.String |
-msg |
-
location
Constructor and Description | -
---|
MsgError(Location location,
- java.lang.String msg) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public class NewlineInStrError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private java.lang.String |
-str |
-
location
Constructor and Description | -
---|
NewlineInStrError(Location location,
- java.lang.String str) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public NewlineInStrError(Location location, - java.lang.String str)-
protected java.lang.String getErrMsg()-
getErrMsg
in class DecafError
public class NoMainClassError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private java.lang.String |
-name |
-
location
Constructor and Description | -
---|
NoMainClassError(java.lang.String name) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public class NotArrayError -extends DecafError-
location
Constructor and Description | -
---|
NotArrayError(Location location) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public class NotClassError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private java.lang.String |
-type |
-
location
Constructor and Description | -
---|
NotClassError(java.lang.String type,
- Location location) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public NotClassError(java.lang.String type, - Location location)-
protected java.lang.String getErrMsg()-
getErrMsg
in class DecafError
public class NotClassFieldError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private java.lang.String |
-name |
-
private java.lang.String |
-owner |
-
location
Constructor and Description | -
---|
NotClassFieldError(Location location,
- java.lang.String name,
- java.lang.String owner) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private java.lang.String name-
private java.lang.String owner-
public NotClassFieldError(Location location, - java.lang.String name, - java.lang.String owner)-
protected java.lang.String getErrMsg()-
getErrMsg
in class DecafError
public class NotClassMethodError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private java.lang.String |
-name |
-
private java.lang.String |
-owner |
-
location
Constructor and Description | -
---|
NotClassMethodError(Location location,
- java.lang.String name,
- java.lang.String owner) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private java.lang.String name-
private java.lang.String owner-
public NotClassMethodError(Location location, - java.lang.String name, - java.lang.String owner)-
protected java.lang.String getErrMsg()-
getErrMsg
in class DecafError
public class OverridingVarError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private java.lang.String |
-name |
-
location
Constructor and Description | -
---|
OverridingVarError(Location location,
- java.lang.String name) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public OverridingVarError(Location location, - java.lang.String name)-
protected java.lang.String getErrMsg()-
getErrMsg
in class DecafError
public class RefNonStaticError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private java.lang.String |
-from |
-
private java.lang.String |
-ref |
-
location
Constructor and Description | -
---|
RefNonStaticError(Location location,
- java.lang.String from,
- java.lang.String ref) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private java.lang.String from-
private java.lang.String ref-
public RefNonStaticError(Location location, - java.lang.String from, - java.lang.String ref)-
protected java.lang.String getErrMsg()-
getErrMsg
in class DecafError
public final class RuntimeError
-extends java.lang.Object
-Modifier and Type | -Field and Description | -
---|---|
static java.lang.String |
-ARRAY_INDEX_OUT_OF_BOUND |
-
static java.lang.String |
-CLASS_CAST_ERROR1 |
-
static java.lang.String |
-CLASS_CAST_ERROR2 |
-
static java.lang.String |
-CLASS_CAST_ERROR3 |
-
static java.lang.String |
-NEGATIVE_ARR_SIZE |
-
Modifier | -Constructor and Description | -
---|---|
private |
-RuntimeError() |
-
public static final java.lang.String ARRAY_INDEX_OUT_OF_BOUND-
public static final java.lang.String CLASS_CAST_ERROR1-
public static final java.lang.String CLASS_CAST_ERROR2-
public static final java.lang.String CLASS_CAST_ERROR3-
public static final java.lang.String NEGATIVE_ARR_SIZE-
public class SubNotIntError -extends DecafError-
location
Constructor and Description | -
---|
SubNotIntError(Location location) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public class ThisInStaticFuncError -extends DecafError-
location
Constructor and Description | -
---|
ThisInStaticFuncError(Location location) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public class UndeclVarError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private java.lang.String |
-name |
-
location
Constructor and Description | -
---|
UndeclVarError(Location location,
- java.lang.String name) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public UndeclVarError(Location location, - java.lang.String name)-
protected java.lang.String getErrMsg()-
getErrMsg
in class DecafError
public class UnrecogCharError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private char |
-c |
-
location
Constructor and Description | -
---|
UnrecogCharError(Location location,
- char c) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public class UntermStrError -extends DecafError-
Modifier and Type | -Field and Description | -
---|---|
private java.lang.String |
-str |
-
location
Constructor and Description | -
---|
UntermStrError(Location location,
- java.lang.String str) |
-
Modifier and Type | -Method and Description | -
---|---|
protected java.lang.String |
-getErrMsg() |
-
getLocation, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public UntermStrError(Location location, - java.lang.String str)-
protected java.lang.String getErrMsg()-
getErrMsg
in class DecafError
Package | -Description | -
---|---|
decaf | -- |
decaf.error | -- |
decaf.frontend | -- |
Modifier and Type | -Field and Description | -
---|---|
private java.util.List<DecafError> |
-Driver.errors |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-Driver.issueError(DecafError error) |
-
Modifier and Type | -Class and Description | -
---|---|
class |
-BadArgCountError
-example:function 'gotoMars' expects 1 argument(s) but 3 given
-- PA2 |
-
class |
-BadArgTypeError
-example:incompatible argument 3: int given, bool expected
-- 3表示发生错误的是第三个参数 - PA2 |
-
class |
-BadArrElementError
-example:array base type must be non-void type
-- PA2 |
-
class |
-BadInheritanceError
-example:illegal class inheritance (should be a cyclic)
-- PA2 |
-
class |
-BadLengthArgError
-example:function 'length' expects 0 argument(s) but 2 given
-- PA2 |
-
class |
-BadLengthError
-example:'length' can only be applied to arrays
-- PA2 |
-
class |
-BadNewArrayLength
-example:new array length must be an integer
-- PA2 |
-
class |
-BadOverrideError
-example:overriding method 'tooold' doesn't match the type signature in class
- 'duckyaya'
-- PA2 |
-
class |
-BadPrintArgError
-example:incompatible argument 3: int[] given, int/bool/string expected
-- 3表示发生错误的是第三个参数 - PA2 |
-
class |
-BadReturnTypeError
-example:incompatible return: int[] given, int expected
-- PA2 |
-
class |
-BadTestExpr
-example:test expression must have bool type
-- PA2 |
-
class |
-BadVarTypeError
-example:cannot declare identifier 'boost' as void type
-- PA2 |
-
class |
-BreakOutOfLoopError
-example:'break' is only allowed inside a loop
-- PA2 |
-
class |
-ClassNotFoundError
-example:class 'zig' not found
-- PA2 |
-
class |
-DeclConflictError
-example:declaration of 'abcde' here conflicts with earlier declaration at (3,2)
-- PA2 |
-
class |
-FieldNotAccessError
-example:field 'homework' of 'Others' not accessible here
-- PA2 |
-
class |
-FieldNotFoundError
-example:field 'money' not found in 'Student'
-- PA2 |
-
class |
-IncompatBinOpError
-example:incompatible operands: int + bool
-- PA2 |
-
class |
-IncompatUnOpError
-example:incompatible operand: - int[]
-- PA2 |
-
class |
-IntTooLargeError
-example:integer literal 112233445566778899 is too large
-- PA1 |
-
class |
-MsgError
-仅供Parser的yyerror函数使用
- |
-
class |
-NewlineInStrError
-example:illegal newline in string constant "this is stri"
-- PA1 |
-
class |
-NoMainClassError
-example:no legal Main class named 'Main' was found
-- PA2 |
-
class |
-NotArrayError
-example:[] can only be applied to arrays
-- PA2 |
-
class |
-NotClassError
-string is not a class type.
- |
-
class |
-NotClassFieldError
-example:cannot access field 'homework' from 'Others'
-- 指通过类名来访问类成员,Others是类名 - example:cannot access field 'homework' from 'int[]' - 指通过非类成员变量来访问类成员,int[]是该变量的类型名字 - PA2 |
-
class |
-NotClassMethodError
-example:'orz' is not a method in class 'Person'
-- PA2 |
-
class |
-OverridingVarError
-example:overriding variable is not allowed for var 'kittyboy'
-- PA2 |
-
class |
-RefNonStaticError
-can not reference a non-static field 'kylin' from static method from 'dove'
- PA2
- |
-
class |
-SubNotIntError
-example:array subscript must be an integer
-- PA2 |
-
class |
-ThisInStaticFuncError
-can not use this in static function
- PA2
- |
-
class |
-UndeclVarError
-example:undeclared variable 'python'
-- PA2 |
-
class |
-UnrecogCharError
-example:unrecognized char: '@'
-- PA1 |
-
class |
-UntermStrError
-example:unterminated string constant: "this is str"
-- PA1 |
-
Modifier and Type | -Method and Description | -
---|---|
protected void |
-BaseParser.issueError(DecafError error) |
-
protected void |
-BaseLexer.issueError(DecafError error) |
-
Class | -Description | -
---|---|
BadArgCountError | -
- example:function 'gotoMars' expects 1 argument(s) but 3 given
-- PA2 |
-
BadArgTypeError | -
- example:incompatible argument 3: int given, bool expected
-- 3表示发生错误的是第三个参数 - PA2 |
-
BadArrElementError | -
- example:array base type must be non-void type
-- PA2 |
-
BadInheritanceError | -
- example:illegal class inheritance (should be a cyclic)
-- PA2 |
-
BadLengthArgError | -
- example:function 'length' expects 0 argument(s) but 2 given
-- PA2 |
-
BadLengthError | -
- example:'length' can only be applied to arrays
-- PA2 |
-
BadNewArrayLength | -
- example:new array length must be an integer
-- PA2 |
-
BadOverrideError | -
- example:overriding method 'tooold' doesn't match the type signature in class
- 'duckyaya'
-- PA2 |
-
BadPrintArgError | -
- example:incompatible argument 3: int[] given, int/bool/string expected
-- 3表示发生错误的是第三个参数 - PA2 |
-
BadReturnTypeError | -
- example:incompatible return: int[] given, int expected
-- PA2 |
-
BadTestExpr | -
- example:test expression must have bool type
-- PA2 |
-
BadVarTypeError | -
- example:cannot declare identifier 'boost' as void type
-- PA2 |
-
BreakOutOfLoopError | -
- example:'break' is only allowed inside a loop
-- PA2 |
-
ClassNotFoundError | -
- example:class 'zig' not found
-- PA2 |
-
DecafError | -
- decaf中所有编译错误的基类
- |
-
DeclConflictError | -
- example:declaration of 'abcde' here conflicts with earlier declaration at (3,2)
-- PA2 |
-
FieldNotAccessError | -
- example:field 'homework' of 'Others' not accessible here
-- PA2 |
-
FieldNotFoundError | -
- example:field 'money' not found in 'Student'
-- PA2 |
-
IncompatBinOpError | -
- example:incompatible operands: int + bool
-- PA2 |
-
IncompatUnOpError | -
- example:incompatible operand: - int[]
-- PA2 |
-
IntTooLargeError | -
- example:integer literal 112233445566778899 is too large
-- PA1 |
-
MsgError | -
- 仅供Parser的yyerror函数使用
- |
-
NewlineInStrError | -
- example:illegal newline in string constant "this is stri"
-- PA1 |
-
NoMainClassError | -
- example:no legal Main class named 'Main' was found
-- PA2 |
-
NotArrayError | -
- example:[] can only be applied to arrays
-- PA2 |
-
NotClassError | -
- string is not a class type.
- |
-
NotClassFieldError | -
- example:cannot access field 'homework' from 'Others'
-- 指通过类名来访问类成员,Others是类名 - example:cannot access field 'homework' from 'int[]' - 指通过非类成员变量来访问类成员,int[]是该变量的类型名字 - PA2 |
-
NotClassMethodError | -
- example:'orz' is not a method in class 'Person'
-- PA2 |
-
OverridingVarError | -
- example:overriding variable is not allowed for var 'kittyboy'
-- PA2 |
-
RefNonStaticError | -
- can not reference a non-static field 'kylin' from static method from 'dove'
- PA2
- |
-
RuntimeError | -
- 运行期的错误
- |
-
SubNotIntError | -
- example:array subscript must be an integer
-- PA2 |
-
ThisInStaticFuncError | -
- can not use this in static function
- PA2
- |
-
UndeclVarError | -
- example:undeclared variable 'python'
-- PA2 |
-
UnrecogCharError | -
- example:unrecognized char: '@'
-- PA1 |
-
UntermStrError | -
- example:unterminated string constant: "this is str"
-- PA1 |
-
Package | -Description | -
---|---|
decaf | -- |
decaf.error | -- |
decaf.frontend | -- |
Class and Description | -
---|
DecafError
- decaf中所有编译错误的基类
- |
-
Class and Description | -
---|
DecafError
- decaf中所有编译错误的基类
- |
-
Class and Description | -
---|
DecafError
- decaf中所有编译错误的基类
- |
-
public abstract class BaseLexer
-extends java.lang.Object
-Modifier and Type | -Field and Description | -
---|---|
private Parser |
-parser |
-
Modifier and Type | -Method and Description | -
---|---|
protected int |
-boolConst(boolean bval) |
-
void |
-diagnose() |
-
(package private) abstract Location |
-getLocation() |
-
protected int |
-identifier(java.lang.String name) |
-
protected int |
-intConst(java.lang.String ival) |
-
protected void |
-issueError(DecafError error) |
-
protected int |
-keyword(int code) |
-
protected int |
-operator(int code) |
-
void |
-setParser(Parser parser) |
-
protected void |
-setSemantic(Location where,
- SemValue v) |
-
protected int |
-StringConst(java.lang.String sval,
- Location loc) |
-
(package private) abstract int |
-yylex() |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected int boolConst(boolean bval)-
public void diagnose() - throws java.io.IOException-
java.io.IOException
abstract Location getLocation()-
protected int identifier(java.lang.String name)-
protected int intConst(java.lang.String ival)-
protected void issueError(DecafError error)-
protected int keyword(int code)-
protected int operator(int code)-
public void setParser(Parser parser)-
protected int StringConst(java.lang.String sval, - Location loc)-
abstract int yylex() - throws java.io.IOException-
java.io.IOException
public abstract class BaseParser
-extends java.lang.Object
-Modifier and Type | -Field and Description | -
---|---|
private Lexer |
-lexer |
-
protected Tree.TopLevel |
-tree |
-
Constructor and Description | -
---|
BaseParser() |
-
Modifier and Type | -Method and Description | -
---|---|
Tree.TopLevel |
-getTree() |
-
protected void |
-issueError(DecafError error) |
-
static java.lang.String |
-opStr(int opCode)
-获得操作符的字符串表示
- |
-
Tree.TopLevel |
-parseFile() |
-
void |
-setLexer(Lexer lexer) |
-
(package private) void |
-yyerror(java.lang.String msg) |
-
(package private) int |
-yylex() |
-
(package private) abstract int |
-yyparse() |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private Lexer lexer-
protected Tree.TopLevel tree-
public Tree.TopLevel getTree()-
protected void issueError(DecafError error)-
public static java.lang.String opStr(int opCode)-
opCode
- 操作符的符号码public Tree.TopLevel parseFile()-
public void setLexer(Lexer lexer)-
void yyerror(java.lang.String msg)-
int yylex()-
abstract int yyparse()-
Modifier and Type | -Field and Description | -
---|---|
private java.lang.StringBuilder |
-buffer |
-
static int |
-S
-lexical states
- |
-
private Location |
-sloc |
-
private int |
-yychar
-the number of characters up to the start of the matched text
- |
-
private int |
-yycolumn
-the number of characters from the last newline up to the start of the
- matched text
- |
-
static int |
-YYEOF
-This character denotes the end of file
- |
-
static int |
-YYINITIAL |
-
private int |
-yyline
-number of newlines encountered up to the start of the matched text
- |
-
private static int[] |
-ZZ_ACTION
-Translates DFA states to action switch labels.
- |
-
private static java.lang.String |
-ZZ_ACTION_PACKED_0 |
-
private static int |
-ZZ_BUFFERSIZE
-initial size of the lookahead buffer
- |
-
private static char[] |
-ZZ_CMAP
-Translates characters to character classes
- |
-
private static java.lang.String |
-ZZ_CMAP_PACKED
-Translates characters to character classes
- |
-
private static java.lang.String[] |
-ZZ_ERROR_MSG |
-
private static int |
-ZZ_NO_MATCH |
-
private static int |
-ZZ_PUSHBACK_2BIG |
-
private static int |
-ZZ_UNKNOWN_ERROR |
-
private boolean |
-zzAtBOL
-zzAtBOL == true <=> the scanner is currently at the beginning of a line
- |
-
private boolean |
-zzAtEOF
-zzAtEOF == true <=> the scanner is at the EOF
- |
-
private char[] |
-zzBuffer
-this buffer contains the current text to be matched and is
- the source of the yytext() string
- |
-
private int |
-zzCurrentPos
-the current text position in the buffer
- |
-
private int |
-zzEndRead
-endRead marks the last character in the buffer, that has been read
- from input
- |
-
private boolean |
-zzEOFDone
-denotes if the user-EOF-code has already been executed
- |
-
private int |
-zzLexicalState
-the current lexical state
- |
-
private int |
-zzMarkedPos
-the textposition at the last accepting state
- |
-
private int |
-zzPushbackPos
-the textposition at the last state to be included in yytext
- |
-
private java.io.Reader |
-zzReader
-the input device
- |
-
private int |
-zzStartRead
-startRead marks the beginning of the yytext() string in the buffer
- |
-
private int |
-zzState
-the current state of the DFA
- |
-
Constructor and Description | -
---|
Lexer(java.io.InputStream in)
-Creates a new scanner.
- |
-
Lexer(java.io.Reader in)
-Creates a new scanner
- There is also a java.io.InputStream version of this constructor.
- |
-
Modifier and Type | -Method and Description | -
---|---|
Location |
-getLocation() |
-
void |
-yybegin(int newState)
-Enters a new lexical state
- |
-
char |
-yycharat(int pos)
-Returns the character at position pos from the
- matched text.
- |
-
void |
-yyclose()
-Closes the input stream.
- |
-
int |
-yylength()
-Returns the length of the matched text region.
- |
-
int |
-yylex()
-Resumes scanning until the next regular expression is matched,
- the end of input is encountered or an I/O-Error occurs.
- |
-
void |
-yypushback(int number)
-Pushes the specified amount of characters back into the input stream.
- |
-
void |
-yyreset(java.io.Reader reader)
-Resets the scanner to read from a new input stream.
- |
-
int |
-yystate()
-Returns the current lexical state.
- |
-
java.lang.String |
-yytext()
-Returns the text matched by the current regular expression.
- |
-
private void |
-zzDoEOF()
-Contains user EOF-code, which will be executed exactly once,
- when the end of file is reached
- |
-
private boolean |
-zzRefill()
-Refills the input buffer.
- |
-
private void |
-zzScanError(int errorCode)
-Reports an error that occured while scanning.
- |
-
private static int[] |
-zzUnpackAction() |
-
private static int |
-zzUnpackAction(java.lang.String packed,
- int offset,
- int[] result) |
-
private static char[] |
-zzUnpackCMap(java.lang.String packed)
-Unpacks the compressed character translation table.
- |
-
boolConst, diagnose, identifier, intConst, issueError, keyword, operator, setParser, setSemantic, StringConst
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private java.lang.StringBuilder buffer-
public static final int S-
private Location sloc-
private int yychar-
private int yycolumn-
public static final int YYEOF-
public static final int YYINITIAL-
private int yyline-
private static final int[] ZZ_ACTION-
private static final java.lang.String ZZ_ACTION_PACKED_0-
private static final int ZZ_BUFFERSIZE-
private static final char[] ZZ_CMAP-
private static final java.lang.String ZZ_CMAP_PACKED-
private static final java.lang.String[] ZZ_ERROR_MSG-
private static final int ZZ_NO_MATCH-
private static final int ZZ_PUSHBACK_2BIG-
private static final int ZZ_UNKNOWN_ERROR-
private boolean zzAtBOL-
private boolean zzAtEOF-
private char[] zzBuffer-
private int zzCurrentPos-
private int zzEndRead-
private boolean zzEOFDone-
private int zzLexicalState-
private int zzMarkedPos-
private int zzPushbackPos-
private java.io.Reader zzReader-
private int zzStartRead-
private int zzState-
public Lexer(java.io.InputStream in)-
in
- the java.io.Inputstream to read input from.public Lexer(java.io.Reader in)-
in
- the java.io.Reader to read input from.public Location getLocation()-
getLocation
in class BaseLexer
public final void yybegin(int newState)-
newState
- the new lexical statepublic final char yycharat(int pos)-
pos
- the position of the character to fetch.
- A value from 0 to yylength()-1.public final void yyclose() - throws java.io.IOException-
java.io.IOException
public final int yylength()-
public int yylex() - throws java.io.IOException-
public void yypushback(int number)-
number
- the number of characters to be read again.
- This number must not be greater than yylength()!public final void yyreset(java.io.Reader reader)-
reader
- the new input streampublic final int yystate()-
public final java.lang.String yytext()-
private void zzDoEOF() - throws java.io.IOException-
java.io.IOException
private boolean zzRefill() - throws java.io.IOException-
false
, iff there was new input.java.io.IOException
- if any I/O-Error occursprivate void zzScanError(int errorCode)-
errorCode
- the code of the errormessage to displayprivate static int[] zzUnpackAction()-
private static int zzUnpackAction(java.lang.String packed, - int offset, - int[] result)-
private static char[] zzUnpackCMap(java.lang.String packed)-
packed
- the packed character translation tablepublic class Parser -extends BaseParser -implements ReduceListener-
Modifier and Type | -Field and Description | -
---|---|
static short |
-AND |
-
static short |
-BOOL |
-
static short |
-BREAK |
-
static short |
-CLASS |
-
static short |
-ELSE |
-
static short |
-EMPTY |
-
static short |
-EQUAL |
-
static short |
-EXTENDS |
-
static short |
-FOR |
-
static short |
-GREATER_EQUAL |
-
static short |
-IDENTIFIER |
-
static short |
-IF |
-
static short |
-INSTANCEOF |
-
static short |
-INT |
-
static short |
-LESS_EQUAL |
-
static short |
-LITERAL |
-
static short |
-NEW |
-
static short |
-NOT_EQUAL |
-
static short |
-NULL |
-
static short |
-OR |
-
static short |
-PRINT |
-
static short |
-READ_INTEGER |
-
static short |
-READ_LINE |
-
(package private) ReduceListener |
-reduceListener |
-
static short |
-RETURN |
-
(package private) int |
-statemax |
-
(package private) int |
-stateptr |
-
(package private) int |
-stateptrmax |
-
(package private) int[] |
-statestk |
-
static short |
-STATIC |
-
static short |
-STRING |
-
static short |
-THIS |
-
static short |
-UMINUS |
-
(package private) int |
-valptr |
-
(package private) SemValue[] |
-valstk |
-
static short |
-VOID |
-
static short |
-WHILE |
-
(package private) int |
-yychar |
-
(package private) static short[] |
-yycheck |
-
(package private) boolean |
-yydebug |
-
(package private) static short[] |
-yydefred |
-
(package private) static short[] |
-yydgoto |
-
static short |
-YYERRCODE |
-
(package private) int |
-yyerrflag |
-
(package private) static short |
-YYFINAL |
-
(package private) static short[] |
-yygindex |
-
(package private) static short[] |
-yylen |
-
(package private) static short[] |
-yylhs |
-
(package private) SemValue |
-yylval |
-
(package private) int |
-yym |
-
(package private) static short |
-YYMAXTOKEN |
-
(package private) int |
-yyn |
-
(package private) static java.lang.String[] |
-yyname |
-
(package private) int |
-yynerrs |
-
(package private) static short[] |
-yyrindex |
-
(package private) static java.lang.String[] |
-yyrule |
-
(package private) java.lang.String |
-yys |
-
(package private) static short[] |
-yysindex |
-
(package private) static int |
-YYSTACKSIZE |
-
(package private) int |
-yystate |
-
(package private) static short[] |
-yytable |
-
(package private) static int |
-YYTABLESIZE |
-
(package private) java.lang.String |
-yytext |
-
(package private) SemValue |
-yyval |
-
tree
Modifier and Type | -Method and Description | -
---|---|
(package private) void |
-addReduceListener(ReduceListener l) |
-
(package private) void |
-debug(java.lang.String msg) |
-
void |
-diagnose() |
-
(package private) void |
-dump_stacks(int count) |
-
(package private) boolean |
-init_stacks() |
-
boolean |
-onReduce(java.lang.String rule)
-打印当前归约所用的语法规则
-- 请勿修改。 |
-
(package private) void |
-state_drop(int cnt) |
-
(package private) int |
-state_peek(int relative) |
-
(package private) int |
-state_pop() |
-
(package private) void |
-state_push(int state) |
-
(package private) void |
-val_drop(int cnt) |
-
(package private) void |
-val_init() |
-
(package private) SemValue |
-val_peek(int relative) |
-
(package private) SemValue |
-val_pop() |
-
(package private) void |
-val_push(SemValue val) |
-
(package private) static void |
-yycheck() |
-
(package private) void |
-yyclearin() |
-
(package private) void |
-yyerrok() |
-
(package private) void |
-yylexdebug(int state,
- int ch) |
-
(package private) int |
-yyparse() |
-
(package private) static void |
-yytable() |
-
getTree, issueError, opStr, parseFile, setLexer, yyerror, yylex
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final short AND-
public static final short BOOL-
public static final short BREAK-
public static final short CLASS-
public static final short ELSE-
public static final short EMPTY-
public static final short EQUAL-
public static final short EXTENDS-
public static final short FOR-
public static final short GREATER_EQUAL-
public static final short IDENTIFIER-
public static final short IF-
public static final short INSTANCEOF-
public static final short INT-
public static final short LESS_EQUAL-
public static final short LITERAL-
public static final short NEW-
public static final short NOT_EQUAL-
public static final short NULL-
public static final short OR-
public static final short PRINT-
public static final short READ_INTEGER-
public static final short READ_LINE-
ReduceListener reduceListener-
public static final short RETURN-
int statemax-
int stateptr-
int stateptrmax-
int[] statestk-
public static final short STATIC-
public static final short STRING-
public static final short THIS-
public static final short UMINUS-
int valptr-
SemValue[] valstk-
public static final short VOID-
public static final short WHILE-
int yychar-
static short[] yycheck-
boolean yydebug-
static final short[] yydefred-
static final short[] yydgoto-
public static final short YYERRCODE-
int yyerrflag-
static final short YYFINAL-
static final short[] yygindex-
static final short[] yylen-
static final short[] yylhs-
SemValue yylval-
int yym-
static final short YYMAXTOKEN-
int yyn-
static final java.lang.String[] yyname-
int yynerrs-
static final short[] yyrindex-
static final java.lang.String[] yyrule-
java.lang.String yys-
static final short[] yysindex-
static final int YYSTACKSIZE-
int yystate-
static short[] yytable-
static final int YYTABLESIZE-
java.lang.String yytext-
SemValue yyval-
void addReduceListener(ReduceListener l)-
void debug(java.lang.String msg)-
public void diagnose()-
void dump_stacks(int count)-
final boolean init_stacks()-
public boolean onReduce(java.lang.String rule)-
onReduce
in interface ReduceListener
final void state_drop(int cnt)-
final int state_peek(int relative)-
final int state_pop()-
final void state_push(int state)-
final void val_drop(int cnt)-
final void val_init()-
final SemValue val_peek(int relative)-
final SemValue val_pop()-
final void val_push(SemValue val)-
static void yycheck()-
void yyclearin()-
void yyerrok()-
void yylexdebug(int state, - int ch)-
int yyparse()-
yyparse
in class BaseParser
static void yytable()-
public class ParserHelper -extends Parser-
AND, BOOL, BREAK, CLASS, ELSE, EMPTY, EQUAL, EXTENDS, FOR, GREATER_EQUAL, IDENTIFIER, IF, INSTANCEOF, INT, LESS_EQUAL, LITERAL, NEW, NOT_EQUAL, NULL, OR, PRINT, READ_INTEGER, READ_LINE, reduceListener, RETURN, statemax, stateptr, stateptrmax, statestk, STATIC, STRING, THIS, UMINUS, valptr, valstk, VOID, WHILE, yychar, yycheck, yydebug, yydefred, yydgoto, YYERRCODE, yyerrflag, YYFINAL, yygindex, yylen, yylhs, yylval, yym, YYMAXTOKEN, yyn, yyname, yynerrs, yyrindex, yyrule, yys, yysindex, YYSTACKSIZE, yystate, yytable, YYTABLESIZE, yytext, yyval
tree
Constructor and Description | -
---|
ParserHelper() |
-
Modifier and Type | -Method and Description | -
---|---|
(package private) void |
-UserAction(SemValue $$,
- SemValue $1,
- SemValue $2,
- SemValue $3,
- SemValue $4,
- SemValue $5,
- SemValue $6)
-辅助模版(切勿直接调用)
- |
-
addReduceListener, debug, diagnose, dump_stacks, init_stacks, onReduce, state_drop, state_peek, state_pop, state_push, val_drop, val_init, val_peek, val_pop, val_push, yycheck, yyclearin, yyerrok, yylexdebug, yyparse, yytable
getTree, issueError, opStr, parseFile, setLexer, yyerror, yylex
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
void UserAction(SemValue $$, - SemValue $1, - SemValue $2, - SemValue $3, - SemValue $4, - SemValue $5, - SemValue $6)-
$$
- 对应 YACC 语义动作中的 $$$1
- 对应 YACC 语义动作中的 $1$2
- 对应 YACC 语义动作中的 $2$3
- 对应 YACC 语义动作中的 $3$4
- 对应 YACC 语义动作中的 $4$5
- 对应 YACC 语义动作中的 $5$6
- 对应 YACC 语义动作中的 $6interface ReduceListener
-Modifier and Type | -Method and Description | -
---|---|
boolean |
-onReduce(java.lang.String rule) |
-
public class SemValue
-extends java.lang.Object
-Modifier and Type | -Field and Description | -
---|---|
Tree.ClassDef |
-cdef |
-
java.util.List<Tree.ClassDef> |
-clist |
-
int |
-code |
-
java.util.List<Tree.Expr> |
-elist |
-
Tree.Expr |
-expr |
-
Tree.MethodDef |
-fdef |
-
java.util.List<Tree> |
-flist
-field list
- |
-
java.lang.String |
-ident |
-
java.lang.Object |
-literal |
-
Location |
-loc |
-
Tree.LValue |
-lvalue |
-
Tree.TopLevel |
-prog |
-
java.util.List<Tree> |
-slist
-statement list
- |
-
Tree |
-stmt |
-
Tree.TypeLiteral |
-type |
-
int |
-typeTag |
-
Tree.VarDef |
-vdef |
-
java.util.List<Tree.VarDef> |
-vlist |
-
Modifier and Type | -Method and Description | -
---|---|
static SemValue |
-createIdentifier(java.lang.String name)
-创建一个标识符的语义值
- |
-
static SemValue |
-createKeyword(int code)
-创建一个关键字的语义值
- |
-
static SemValue |
-createLiteral(int tag,
- java.lang.Object value)
-创建一个常量的语义值
- |
-
static SemValue |
-createOperator(int code)
-创建一个操作符的语义值
- |
-
java.lang.String |
-toString()
-获取这个语义值的字符串表示
-- - 我们建议你在构造词法分析器之前先阅读一下这个函数。 |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public Tree.ClassDef cdef-
public java.util.List<Tree.ClassDef> clist-
public int code-
public java.util.List<Tree.Expr> elist-
public Tree.Expr expr-
public Tree.MethodDef fdef-
public java.util.List<Tree> flist-
public java.lang.String ident-
public java.lang.Object literal-
public Location loc-
public Tree.LValue lvalue-
public Tree.TopLevel prog-
public java.util.List<Tree> slist-
public Tree stmt-
public Tree.TypeLiteral type-
public int typeTag-
public Tree.VarDef vdef-
public java.util.List<Tree.VarDef> vlist-
public static SemValue createIdentifier(java.lang.String name)-
name
- 标识符的名字public static SemValue createKeyword(int code)-
code
- 关键字的代表码public static SemValue createLiteral(int tag, - java.lang.Object value)-
value
- 常量的值public static SemValue createOperator(int code)-
code
- 操作符的代表码public java.lang.String toString()-
toString
in class java.lang.Object
Package | -Description | -
---|---|
decaf.frontend | -- |
Modifier and Type | -Class and Description | -
---|---|
class |
-Lexer
-This class is a scanner generated by
- JFlex 1.4.1
- on 16-10-10 下午7:05 from the specification file
- src/decaf/frontend/Lexer.l
- |
-
Package | -Description | -
---|---|
decaf.frontend | -- |
Modifier and Type | -Class and Description | -
---|---|
class |
-Parser |
-
class |
-ParserHelper |
-
Package | -Description | -
---|---|
decaf | -- |
decaf.frontend | -- |
Modifier and Type | -Field and Description | -
---|---|
private Lexer |
-Driver.lexer |
-
Modifier and Type | -Field and Description | -
---|---|
private Lexer |
-BaseParser.lexer |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-BaseParser.setLexer(Lexer lexer) |
-
Package | -Description | -
---|---|
decaf | -- |
decaf.frontend | -- |
Modifier and Type | -Field and Description | -
---|---|
private Parser |
-Driver.parser |
-
Modifier and Type | -Class and Description | -
---|---|
class |
-ParserHelper |
-
Modifier and Type | -Field and Description | -
---|---|
private Parser |
-BaseLexer.parser |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-BaseLexer.setParser(Parser parser) |
-
Package | -Description | -
---|---|
decaf.frontend | -- |
Modifier and Type | -Class and Description | -
---|---|
class |
-Parser |
-
class |
-ParserHelper |
-
Modifier and Type | -Field and Description | -
---|---|
(package private) ReduceListener |
-Parser.reduceListener |
-
Modifier and Type | -Method and Description | -
---|---|
(package private) void |
-Parser.addReduceListener(ReduceListener l) |
-
Package | -Description | -
---|---|
decaf.frontend | -- |
Modifier and Type | -Field and Description | -
---|---|
(package private) SemValue[] |
-Parser.valstk |
-
(package private) SemValue |
-Parser.yylval |
-
(package private) SemValue |
-Parser.yyval |
-
Modifier and Type | -Method and Description | -
---|---|
static SemValue |
-SemValue.createIdentifier(java.lang.String name)
-创建一个标识符的语义值
- |
-
static SemValue |
-SemValue.createKeyword(int code)
-创建一个关键字的语义值
- |
-
static SemValue |
-SemValue.createLiteral(int tag,
- java.lang.Object value)
-创建一个常量的语义值
- |
-
static SemValue |
-SemValue.createOperator(int code)
-创建一个操作符的语义值
- |
-
(package private) SemValue |
-Parser.val_peek(int relative) |
-
(package private) SemValue |
-Parser.val_pop() |
-
Modifier and Type | -Method and Description | -
---|---|
protected void |
-BaseLexer.setSemantic(Location where,
- SemValue v) |
-
(package private) void |
-ParserHelper.UserAction(SemValue $$,
- SemValue $1,
- SemValue $2,
- SemValue $3,
- SemValue $4,
- SemValue $5,
- SemValue $6)
-辅助模版(切勿直接调用)
- |
-
(package private) void |
-Parser.val_push(SemValue val) |
-
Interface | -Description | -
---|---|
ReduceListener | -- |
Class | -Description | -
---|---|
BaseLexer | -- |
BaseParser | -- |
Lexer | -
- This class is a scanner generated by
- JFlex 1.4.1
- on 16-10-10 下午7:05 from the specification file
- src/decaf/frontend/Lexer.l
- |
-
Parser | -- |
ParserHelper | -- |
SemValue | -- |
Package | -Description | -
---|---|
decaf | -- |
decaf.frontend | -- |
Class and Description | -
---|
Lexer
- This class is a scanner generated by
- JFlex 1.4.1
- on 16-10-10 下午7:05 from the specification file
- src/decaf/frontend/Lexer.l
- |
-
Parser | -
Class and Description | -
---|
BaseLexer | -
BaseParser | -
Lexer
- This class is a scanner generated by
- JFlex 1.4.1
- on 16-10-10 下午7:05 from the specification file
- src/decaf/frontend/Lexer.l
- |
-
Parser | -
ReduceListener | -
SemValue | -
Class | -Description | -
---|---|
Driver | -- |
Location | -
- 语法符号在源代码中的位置
- |
-
Option | -- |
Enum | -Description | -
---|---|
Option.Level | -- |
Package | -Description | -
---|---|
decaf | -- |
decaf.error | -- |
decaf.frontend | -- |
decaf.tree | -- |
Class and Description | -
---|
Driver | -
Location
- 语法符号在源代码中的位置
- |
-
Option | -
Option.Level | -
Class and Description | -
---|
Location
- 语法符号在源代码中的位置
- |
-
Class and Description | -
---|
Location
- 语法符号在源代码中的位置
- |
-
Class and Description | -
---|
Location
- 语法符号在源代码中的位置
- |
-
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
java.util.List<Tree.Expr> |
-actuals |
-
java.lang.String |
-method |
-
Tree.Expr |
-receiver |
-
isClass, usedForRef
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
Apply(Tree.Expr receiver,
- java.lang.String method,
- java.util.List<Tree.Expr> actuals,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public java.util.List<Tree.Expr> actuals-
public java.lang.String method-
public Tree.Expr receiver-
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
Tree.Expr |
-expr |
-
Tree.LValue |
-left |
-
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
Assign(Tree.LValue left,
- Tree.Expr expr,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Tree.Expr expr-
public Tree.LValue left-
public Assign(Tree.LValue left, - Tree.Expr expr, - Location loc)-
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
Tree.Expr |
-left |
-
Tree.Expr |
-right |
-
isClass, usedForRef
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
Binary(int kind,
- Tree.Expr left,
- Tree.Expr right,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor visitor)
-Visit this tree with a given visitor.
- |
-
private void |
-binaryOperatorPrintTo(IndentPrintWriter pw,
- java.lang.String op) |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Tree.Expr left-
public Tree.Expr right-
public void accept(Tree.Visitor visitor)-
Tree
private void binaryOperatorPrintTo(IndentPrintWriter pw, - java.lang.String op)-
public void printTo(IndentPrintWriter pw)- -
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
java.util.List<Tree> |
-block |
-
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
Block(java.util.List<Tree> block,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
Break(Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
java.util.List<Tree.Expr> |
-actuals |
-
boolean |
-isArrayLength |
-
java.lang.String |
-method |
-
Tree.Expr |
-receiver |
-
isClass, usedForRef
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
CallExpr(Tree.Expr receiver,
- java.lang.String method,
- java.util.List<Tree.Expr> actuals,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor visitor)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public java.util.List<Tree.Expr> actuals-
public boolean isArrayLength-
public java.lang.String method-
public Tree.Expr receiver-
public void accept(Tree.Visitor visitor)-
Tree
public void printTo(IndentPrintWriter pw)- -
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
java.util.List<Tree> |
-fields |
-
java.lang.String |
-name |
-
java.lang.String |
-parent |
-
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
ClassDef(java.lang.String name,
- java.lang.String parent,
- java.util.List<Tree> fields,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public java.util.List<Tree> fields-
public java.lang.String name-
public java.lang.String parent-
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
Tree.Expr |
-expr |
-
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
Exec(Tree.Expr expr,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
public abstract static class Tree.Expr -extends Tree-
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
boolean |
-isClass |
-
boolean |
-usedForRef |
-
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
Tree.Expr |
-condition |
-
Tree |
-init |
-
Tree |
-loopBody |
-
Tree |
-update |
-
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
ForLoop(Tree init,
- Tree.Expr condition,
- Tree update,
- Tree loopBody,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Tree.Expr condition-
public Tree init-
public Tree loopBody-
public Tree update-
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
public static class Tree.Ident -extends Tree.LValue-
Tree.LValue.Kind
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
boolean |
-isDefined |
-
java.lang.String |
-name |
-
Tree.Expr |
-owner |
-
lvKind
isClass, usedForRef
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
Ident(Tree.Expr owner,
- java.lang.String name,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public boolean isDefined-
public java.lang.String name-
public Tree.Expr owner-
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
Tree.Expr |
-condition |
-
Tree |
-falseBranch |
-
Tree |
-trueBranch |
-
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
If(Tree.Expr condition,
- Tree trueBranch,
- Tree falseBranch,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Tree.Expr condition-
public Tree falseBranch-
public Tree trueBranch-
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
public static class Tree.Indexed -extends Tree.LValue-
Tree.LValue.Kind
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
Tree.Expr |
-array |
-
Tree.Expr |
-index |
-
lvKind
isClass, usedForRef
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
Indexed(Tree.Expr array,
- Tree.Expr index,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Tree.Expr array-
public Tree.Expr index-
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
public static enum Tree.LValue.Kind -extends java.lang.Enum<Tree.LValue.Kind>-
Enum Constant and Description | -
---|
ARRAY_ELEMENT |
-
LOCAL_VAR |
-
MEMBER_VAR |
-
PARAM_VAR |
-
Modifier and Type | -Method and Description | -
---|---|
static Tree.LValue.Kind |
-valueOf(java.lang.String name)
-Returns the enum constant of this type with the specified name.
- |
-
static Tree.LValue.Kind[] |
-values()
-Returns an array containing the constants of this enum type, in
-the order they are declared.
- |
-
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getClass, notify, notifyAll, wait, wait, wait
public static final Tree.LValue.Kind ARRAY_ELEMENT-
public static final Tree.LValue.Kind LOCAL_VAR-
public static final Tree.LValue.Kind MEMBER_VAR-
public static final Tree.LValue.Kind PARAM_VAR-
public static Tree.LValue.Kind valueOf(java.lang.String name)-
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static Tree.LValue.Kind[] values()-
-for (Tree.LValue.Kind c : Tree.LValue.Kind.values()) - System.out.println(c); -
public abstract static class Tree.LValue -extends Tree.Expr-
Modifier and Type | -Class and Description | -
---|---|
static class |
-Tree.LValue.Kind |
-
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
Tree.LValue.Kind |
-lvKind |
-
isClass, usedForRef
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
int |
-typeTag |
-
java.lang.Object |
-value |
-
isClass, usedForRef
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
Literal(int typeTag,
- java.lang.Object value,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public int typeTag-
public java.lang.Object value-
public Literal(int typeTag, - java.lang.Object value, - Location loc)-
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
Tree.Block |
-body |
-
java.util.List<Tree.VarDef> |
-formals |
-
java.lang.String |
-name |
-
Tree.TypeLiteral |
-returnType |
-
boolean |
-statik |
-
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
MethodDef(boolean statik,
- java.lang.String name,
- Tree.TypeLiteral returnType,
- java.util.List<Tree.VarDef> formals,
- Tree.Block body,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Tree.Block body-
public java.util.List<Tree.VarDef> formals-
public java.lang.String name-
public Tree.TypeLiteral returnType-
public boolean statik-
public MethodDef(boolean statik, - java.lang.String name, - Tree.TypeLiteral returnType, - java.util.List<Tree.VarDef> formals, - Tree.Block body, - Location loc)-
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
Tree.TypeLiteral |
-elementType |
-
Tree.Expr |
-length |
-
isClass, usedForRef
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
NewArray(Tree.TypeLiteral elementType,
- Tree.Expr length,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Tree.TypeLiteral elementType-
public Tree.Expr length-
public NewArray(Tree.TypeLiteral elementType, - Tree.Expr length, - Location loc)-
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
java.lang.String |
-className |
-
isClass, usedForRef
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
NewClass(java.lang.String className,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public NewClass(java.lang.String className, - Location loc)-
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
isClass, usedForRef
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
Null(Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
java.util.List<Tree.Expr> |
-exprs |
-
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
Print(java.util.List<Tree.Expr> exprs,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
isClass, usedForRef
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
ReadIntExpr(Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor visitor)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void accept(Tree.Visitor visitor)-
Tree
public void printTo(IndentPrintWriter pw)- -
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
isClass, usedForRef
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
ReadLineExpr(Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor visitor)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void accept(Tree.Visitor visitor)-
Tree
public void printTo(IndentPrintWriter pw)- -
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
Tree.Expr |
-expr |
-
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
Return(Tree.Expr expr,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
Skip(Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
isClass, usedForRef
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
ThisExpr(Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor visitor)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void accept(Tree.Visitor visitor)-
Tree
public void printTo(IndentPrintWriter pw)- -
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
java.util.List<Tree.ClassDef> |
-classes |
-
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
TopLevel(java.util.List<Tree.ClassDef> classes,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public java.util.List<Tree.ClassDef> classes-
public TopLevel(java.util.List<Tree.ClassDef> classes, - Location loc)-
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
public static class Tree.TypeArray -extends Tree.TypeLiteral-
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
Tree.TypeLiteral |
-elementType |
-
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
TypeArray(Tree.TypeLiteral elementType,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Tree.TypeLiteral elementType-
public TypeArray(Tree.TypeLiteral elementType, - Location loc)-
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
java.lang.String |
-className |
-
Tree.Expr |
-expr |
-
isClass, usedForRef
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
TypeCast(java.lang.String className,
- Tree.Expr expr,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public java.lang.String className-
public Tree.Expr expr-
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
public static class Tree.TypeClass -extends Tree.TypeLiteral-
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
java.lang.String |
-name |
-
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
TypeClass(java.lang.String name,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor visitor)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public TypeClass(java.lang.String name, - Location loc)-
public void accept(Tree.Visitor visitor)-
Tree
public void printTo(IndentPrintWriter pw)- -
public static class Tree.TypeIdent -extends Tree.TypeLiteral-
SemanticConstants
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
int |
-typeTag |
-
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
TypeIdent(int typeTag,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public TypeIdent(int typeTag, - Location loc)-
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
public abstract static class Tree.TypeLiteral -extends Tree-
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
TypeLiteral(int tag,
- Location loc) |
-
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
java.lang.String |
-className |
-
Tree.Expr |
-instance |
-
isClass, usedForRef
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
TypeTest(Tree.Expr instance,
- java.lang.String className,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public java.lang.String className-
public Tree.Expr instance-
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
Tree.Expr |
-expr |
-
isClass, usedForRef
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
Unary(int kind,
- Tree.Expr expr,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
private void |
-unaryOperatorToString(IndentPrintWriter pw,
- java.lang.String op) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
private void unaryOperatorToString(IndentPrintWriter pw, - java.lang.String op)-
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
java.lang.String |
-name |
-
Tree.TypeLiteral |
-type |
-
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
VarDef(java.lang.String name,
- Tree.TypeLiteral type,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public java.lang.String name-
public Tree.TypeLiteral type-
public VarDef(java.lang.String name, - Tree.TypeLiteral type, - Location loc)-
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
public abstract static class Tree.Visitor
-extends java.lang.Object
-clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void visitApply(Tree.Apply that)-
public void visitAssign(Tree.Assign that)-
public void visitBinary(Tree.Binary that)-
public void visitBlock(Tree.Block that)-
public void visitBreak(Tree.Break that)-
public void visitCallExpr(Tree.CallExpr that)-
public void visitClassDef(Tree.ClassDef that)-
public void visitExec(Tree.Exec that)-
public void visitForLoop(Tree.ForLoop that)-
public void visitIdent(Tree.Ident that)-
public void visitIf(Tree.If that)-
public void visitIndexed(Tree.Indexed that)-
public void visitLiteral(Tree.Literal that)-
public void visitLValue(Tree.LValue that)-
public void visitMethodDef(Tree.MethodDef that)-
public void visitNewArray(Tree.NewArray that)-
public void visitNewClass(Tree.NewClass that)-
public void visitNull(Tree.Null that)-
public void visitPrint(Tree.Print that)-
public void visitReadIntExpr(Tree.ReadIntExpr that)-
public void visitReadLineExpr(Tree.ReadLineExpr that)-
public void visitReturn(Tree.Return that)-
public void visitSkip(Tree.Skip that)-
public void visitThisExpr(Tree.ThisExpr that)-
public void visitTopLevel(Tree.TopLevel that)-
public void visitTree(Tree that)-
public void visitTypeArray(Tree.TypeArray that)-
public void visitTypeCast(Tree.TypeCast that)-
public void visitTypeClass(Tree.TypeClass that)-
public void visitTypeIdent(Tree.TypeIdent that)-
public void visitTypeTest(Tree.TypeTest that)-
public void visitUnary(Tree.Unary that)-
public void visitVarDef(Tree.VarDef that)-
public void visitWhileLoop(Tree.WhileLoop that)-
Tree.Apply, Tree.Assign, Tree.Binary, Tree.Block, Tree.Break, Tree.CallExpr, Tree.ClassDef, Tree.Exec, Tree.Expr, Tree.ForLoop, Tree.Ident, Tree.If, Tree.Indexed, Tree.Literal, Tree.LValue, Tree.MethodDef, Tree.NewArray, Tree.NewClass, Tree.Null, Tree.Print, Tree.ReadIntExpr, Tree.ReadLineExpr, Tree.Return, Tree.Skip, Tree.ThisExpr, Tree.TopLevel, Tree.TypeArray, Tree.TypeCast, Tree.TypeClass, Tree.TypeIdent, Tree.TypeLiteral, Tree.TypeTest, Tree.Unary, Tree.VarDef, Tree.Visitor, Tree.WhileLoop
Modifier and Type | -Field and Description | -
---|---|
Tree.Expr |
-condition |
-
Tree |
-loopBody |
-
AND, APPLY, ASSERT, ASSIGN, BITAND, BITOR, BITXOR, BLOCK, BOOL, BREAK, CALLEXPR, CASE, CATCH, CLASSDEF, COMPL, CONDEXPR, CONTINUE, DIV, DOLOOP, EQ, ERRONEOUS, EXEC, FORLOOP, GE, GT, IDENT, IF, IMPORT, INDEXED, INT, LABELLED, LE, LITERAL, loc, LT, METHODDEF, MINUS, MOD, MUL, NE, NEG, NEWARRAY, NEWCLASS, NOT, NULL, NULLCHK, OR, PARENS, PLUS, POS, POSTDEC, POSTINC, PREDEC, PREINC, PRINT, READINTEXPR, READLINEEXPR, RETURN, SELECT, SKIP, SL, SR, STRING, SWITCH, SYNCHRONIZED, tag, THISEXPR, THROW, TOPLEVEL, TRY, TYPEAPPLY, TYPEARRAY, TYPECAST, TYPECLASS, TYPEIDENT, TYPEPARAMETER, TYPETEST, USR, VARDEF, VOID, WHILELOOP
Constructor and Description | -
---|
WhileLoop(Tree.Expr condition,
- Tree loopBody,
- Location loc) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-printTo(IndentPrintWriter pw) |
-
getLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Tree.Expr condition-
public Tree loopBody-
public void accept(Tree.Visitor v)-
Tree
public void printTo(IndentPrintWriter pw)- -
public abstract class Tree
-extends java.lang.Object
-TreeMaker
,
-TreeInfo
,
-TreeTranslator
,
-Pretty
Modifier and Type | -Class and Description | -
---|---|
static class |
-Tree.Apply
-A method invocation
- |
-
static class |
-Tree.Assign
-A assignment with "=".
- |
-
static class |
-Tree.Binary
-A binary operation.
- |
-
static class |
-Tree.Block |
-
static class |
-Tree.Break
-A break from a loop.
- |
-
static class |
-Tree.CallExpr |
-
static class |
-Tree.ClassDef |
-
static class |
-Tree.Exec
-an expression statement
- |
-
static class |
-Tree.Expr |
-
static class |
-Tree.ForLoop
-A for loop.
- |
-
static class |
-Tree.Ident
-An identifier
- |
-
static class |
-Tree.If
-An "if ( ) { } else { }" block
- |
-
static class |
-Tree.Indexed
-An array selection
- |
-
static class |
-Tree.Literal
-A constant value given literally.
- |
-
static class |
-Tree.LValue |
-
static class |
-Tree.MethodDef |
-
static class |
-Tree.NewArray
-A new[...] operation.
- |
-
static class |
-Tree.NewClass
-A new(...) operation.
- |
-
static class |
-Tree.Null |
-
static class |
-Tree.Print
-A return statement.
- |
-
static class |
-Tree.ReadIntExpr |
-
static class |
-Tree.ReadLineExpr |
-
static class |
-Tree.Return
-A return statement.
- |
-
static class |
-Tree.Skip
-A no-op statement ";".
- |
-
static class |
-Tree.ThisExpr |
-
static class |
-Tree.TopLevel |
-
static class |
-Tree.TypeArray
-An array type, A[]
- |
-
static class |
-Tree.TypeCast
-A type cast.
- |
-
static class |
-Tree.TypeClass |
-
static class |
-Tree.TypeIdent
-Identifies a basic type.
- |
-
static class |
-Tree.TypeLiteral |
-
static class |
-Tree.TypeTest
-instanceof expression
- |
-
static class |
-Tree.Unary
-A unary operation.
- |
-
static class |
-Tree.VarDef |
-
static class |
-Tree.Visitor
-A generic visitor class for trees.
- |
-
static class |
-Tree.WhileLoop
-A while loop
- |
-
Modifier and Type | -Field and Description | -
---|---|
static int |
-AND |
-
static int |
-APPLY
-Method invocation expressions, of type Apply.
- |
-
static int |
-ASSERT
-Assert statements, of type Assert.
- |
-
static int |
-ASSIGN
-Assignment expressions, of type Assign.
- |
-
static int |
-BITAND |
-
static int |
-BITOR |
-
static int |
-BITXOR |
-
static int |
-BLOCK
-Blocks, of type Block.
- |
-
static int |
-BOOL |
-
static int |
-BREAK
-Break statements, of type Break.
- |
-
static int |
-CALLEXPR |
-
static int |
-CASE
-Case parts in switch statements, of type Case.
- |
-
static int |
-CATCH
-Catch clauses in try statements, of type Catch.
- |
-
static int |
-CLASSDEF
-Class definitions, of type ClassDef.
- |
-
static int |
-COMPL |
-
static int |
-CONDEXPR
-Conditional expressions, of type Conditional.
- |
-
static int |
-CONTINUE
-Continue statements, of type Continue.
- |
-
static int |
-DIV |
-
static int |
-DOLOOP
-Do-while loops, of type DoLoop.
- |
-
static int |
-EQ |
-
static int |
-ERRONEOUS
-Error trees, of type Erroneous.
- |
-
static int |
-EXEC
-Expression statements, of type Exec.
- |
-
static int |
-FORLOOP
-For-loops, of type ForLoop.
- |
-
static int |
-GE |
-
static int |
-GT |
-
static int |
-IDENT
-Simple identifiers, of type Ident.
- |
-
static int |
-IF
-Conditional statements, of type If.
- |
-
static int |
-IMPORT
-Import clauses, of type Import.
- |
-
static int |
-INDEXED
-Indexed array expressions, of type Indexed.
- |
-
static int |
-INT |
-
static int |
-LABELLED
-Labelled statements, of type Labelled.
- |
-
static int |
-LE |
-
static int |
-LITERAL
-Literals, of type Literal.
- |
-
Location |
-loc |
-
static int |
-LT |
-
static int |
-METHODDEF
-Method definitions, of type MethodDef.
- |
-
static int |
-MINUS |
-
static int |
-MOD |
-
static int |
-MUL |
-
static int |
-NE |
-
static int |
-NEG |
-
static int |
-NEWARRAY
-Array creation expressions, of type NewArray.
- |
-
static int |
-NEWCLASS
-Class instance creation expressions, of type NewClass.
- |
-
static int |
-NOT |
-
static int |
-NULL |
-
static int |
-NULLCHK
-unary operator for null reference checks, only used internally.
- |
-
static int |
-OR
-Binary operators, of type Binary.
- |
-
static int |
-PARENS
-Parenthesized subexpressions, of type Parens.
- |
-
static int |
-PLUS |
-
static int |
-POS
-Unary operators, of type Unary.
- |
-
static int |
-POSTDEC |
-
static int |
-POSTINC |
-
static int |
-PREDEC |
-
static int |
-PREINC |
-
static int |
-PRINT |
-
static int |
-READINTEXPR |
-
static int |
-READLINEEXPR |
-
static int |
-RETURN
-Return statements, of type Return.
- |
-
static int |
-SELECT
-Selections, of type Select.
- |
-
static int |
-SKIP
-The no-op statement ";", of type Skip
- |
-
static int |
-SL |
-
static int |
-SR |
-
static int |
-STRING |
-
static int |
-SWITCH
-Switch statements, of type Switch.
- |
-
static int |
-SYNCHRONIZED
-Synchronized statements, of type Synchonized.
- |
-
int |
-tag |
-
static int |
-THISEXPR |
-
static int |
-THROW
-Throw statements, of type Throw.
- |
-
static int |
-TOPLEVEL
-Toplevel nodes, of type TopLevel, representing entire source files.
- |
-
static int |
-TRY
-Try statements, of type Try.
- |
-
static int |
-TYPEAPPLY
-Parameterized types, of type TypeApply.
- |
-
static int |
-TYPEARRAY
-Array types, of type TypeArray.
- |
-
static int |
-TYPECAST
-Type cast expressions, of type TypeCast.
- |
-
static int |
-TYPECLASS
-Class types, of type TypeClass.
- |
-
static int |
-TYPEIDENT
-Basic type identifiers, of type TypeIdent.
- |
-
static int |
-TYPEPARAMETER
-Formal type parameters, of type TypeParameter.
- |
-
static int |
-TYPETEST
-Type test expressions, of type TypeTest.
- |
-
static int |
-USR |
-
static int |
-VARDEF
-Variable definitions, of type VarDef.
- |
-
static int |
-VOID
-Tags for Literal and TypeLiteral
- |
-
static int |
-WHILELOOP
-While-loops, of type WhileLoop.
- |
-
Constructor and Description | -
---|
Tree(int tag,
- Location loc)
-Initialize tree with given tag.
- |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
Location |
-getLocation() |
-
abstract void |
-printTo(IndentPrintWriter pw) |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final int AND-
public static final int APPLY-
public static final int ASSERT-
public static final int ASSIGN-
public static final int BITAND-
public static final int BITOR-
public static final int BITXOR-
public static final int BLOCK-
public static final int BOOL-
public static final int BREAK-
public static final int CALLEXPR-
public static final int CASE-
public static final int CATCH-
public static final int CLASSDEF-
public static final int COMPL-
public static final int CONDEXPR-
public static final int CONTINUE-
public static final int DIV-
public static final int DOLOOP-
public static final int EQ-
public static final int ERRONEOUS-
public static final int EXEC-
public static final int FORLOOP-
public static final int GE-
public static final int GT-
public static final int IDENT-
public static final int IF-
public static final int IMPORT-
public static final int INDEXED-
public static final int INT-
public static final int LABELLED-
public static final int LE-
public static final int LITERAL-
public Location loc-
public static final int LT-
public static final int METHODDEF-
public static final int MINUS-
public static final int MOD-
public static final int MUL-
public static final int NE-
public static final int NEG-
public static final int NEWARRAY-
public static final int NEWCLASS-
public static final int NOT-
public static final int NULL-
public static final int NULLCHK-
public static final int OR-
public static final int PARENS-
public static final int PLUS-
public static final int POS-
public static final int POSTDEC-
public static final int POSTINC-
public static final int PREDEC-
public static final int PREINC-
public static final int PRINT-
public static final int READINTEXPR-
public static final int READLINEEXPR-
public static final int RETURN-
public static final int SELECT-
public static final int SKIP-
public static final int SL-
public static final int SR-
public static final int STRING-
public static final int SWITCH-
public static final int SYNCHRONIZED-
public int tag-
public static final int THISEXPR-
public static final int THROW-
public static final int TOPLEVEL-
public static final int TRY-
public static final int TYPEAPPLY-
public static final int TYPEARRAY-
public static final int TYPECAST-
public static final int TYPECLASS-
public static final int TYPEIDENT-
public static final int TYPEPARAMETER-
public static final int TYPETEST-
public static final int USR-
public static final int VARDEF-
public static final int VOID-
public static final int WHILELOOP-
public Tree(int tag, - Location loc)-
public void accept(Tree.Visitor v)-
public Location getLocation()-
public abstract void printTo(IndentPrintWriter pw)-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitApply(Tree.Apply that) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitAssign(Tree.Assign that) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitBinary(Tree.Binary that) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Field and Description | -
---|---|
Tree.Block |
-Tree.MethodDef.body |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitBlock(Tree.Block that) |
-
Constructor and Description | -
---|
MethodDef(boolean statik,
- java.lang.String name,
- Tree.TypeLiteral returnType,
- java.util.List<Tree.VarDef> formals,
- Tree.Block body,
- Location loc) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitBreak(Tree.Break that) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitCallExpr(Tree.CallExpr that) |
-
Package | -Description | -
---|---|
decaf.frontend | -- |
decaf.tree | -- |
Modifier and Type | -Field and Description | -
---|---|
Tree.ClassDef |
-SemValue.cdef |
-
Modifier and Type | -Field and Description | -
---|---|
java.util.List<Tree.ClassDef> |
-SemValue.clist |
-
Modifier and Type | -Field and Description | -
---|---|
java.util.List<Tree.ClassDef> |
-Tree.TopLevel.classes |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitClassDef(Tree.ClassDef that) |
-
Constructor and Description | -
---|
TopLevel(java.util.List<Tree.ClassDef> classes,
- Location loc) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitExec(Tree.Exec that) |
-
Package | -Description | -
---|---|
decaf.frontend | -- |
decaf.tree | -- |
Modifier and Type | -Field and Description | -
---|---|
Tree.Expr |
-SemValue.expr |
-
Modifier and Type | -Field and Description | -
---|---|
java.util.List<Tree.Expr> |
-SemValue.elist |
-
Modifier and Type | -Class and Description | -
---|---|
static class |
-Tree.Apply
-A method invocation
- |
-
static class |
-Tree.Binary
-A binary operation.
- |
-
static class |
-Tree.CallExpr |
-
static class |
-Tree.Ident
-An identifier
- |
-
static class |
-Tree.Indexed
-An array selection
- |
-
static class |
-Tree.Literal
-A constant value given literally.
- |
-
static class |
-Tree.LValue |
-
static class |
-Tree.NewArray
-A new[...] operation.
- |
-
static class |
-Tree.NewClass
-A new(...) operation.
- |
-
static class |
-Tree.Null |
-
static class |
-Tree.ReadIntExpr |
-
static class |
-Tree.ReadLineExpr |
-
static class |
-Tree.ThisExpr |
-
static class |
-Tree.TypeCast
-A type cast.
- |
-
static class |
-Tree.TypeTest
-instanceof expression
- |
-
static class |
-Tree.Unary
-A unary operation.
- |
-
Modifier and Type | -Field and Description | -
---|---|
Tree.Expr |
-Tree.Indexed.array |
-
Tree.Expr |
-Tree.WhileLoop.condition |
-
Tree.Expr |
-Tree.ForLoop.condition |
-
Tree.Expr |
-Tree.If.condition |
-
Tree.Expr |
-Tree.Exec.expr |
-
Tree.Expr |
-Tree.Return.expr |
-
Tree.Expr |
-Tree.Assign.expr |
-
Tree.Expr |
-Tree.Unary.expr |
-
Tree.Expr |
-Tree.TypeCast.expr |
-
Tree.Expr |
-Tree.Indexed.index |
-
Tree.Expr |
-Tree.TypeTest.instance |
-
Tree.Expr |
-Tree.Binary.left |
-
Tree.Expr |
-Tree.NewArray.length |
-
Tree.Expr |
-Tree.Ident.owner |
-
Tree.Expr |
-Tree.Apply.receiver |
-
Tree.Expr |
-Tree.CallExpr.receiver |
-
Tree.Expr |
-Tree.Binary.right |
-
Modifier and Type | -Field and Description | -
---|---|
java.util.List<Tree.Expr> |
-Tree.Apply.actuals |
-
java.util.List<Tree.Expr> |
-Tree.CallExpr.actuals |
-
java.util.List<Tree.Expr> |
-Tree.Print.exprs |
-
Constructor and Description | -
---|
Apply(Tree.Expr receiver,
- java.lang.String method,
- java.util.List<Tree.Expr> actuals,
- Location loc) |
-
Assign(Tree.LValue left,
- Tree.Expr expr,
- Location loc) |
-
Binary(int kind,
- Tree.Expr left,
- Tree.Expr right,
- Location loc) |
-
CallExpr(Tree.Expr receiver,
- java.lang.String method,
- java.util.List<Tree.Expr> actuals,
- Location loc) |
-
Exec(Tree.Expr expr,
- Location loc) |
-
ForLoop(Tree init,
- Tree.Expr condition,
- Tree update,
- Tree loopBody,
- Location loc) |
-
Ident(Tree.Expr owner,
- java.lang.String name,
- Location loc) |
-
If(Tree.Expr condition,
- Tree trueBranch,
- Tree falseBranch,
- Location loc) |
-
Indexed(Tree.Expr array,
- Tree.Expr index,
- Location loc) |
-
NewArray(Tree.TypeLiteral elementType,
- Tree.Expr length,
- Location loc) |
-
Return(Tree.Expr expr,
- Location loc) |
-
TypeCast(java.lang.String className,
- Tree.Expr expr,
- Location loc) |
-
TypeTest(Tree.Expr instance,
- java.lang.String className,
- Location loc) |
-
Unary(int kind,
- Tree.Expr expr,
- Location loc) |
-
WhileLoop(Tree.Expr condition,
- Tree loopBody,
- Location loc) |
-
Constructor and Description | -
---|
Apply(Tree.Expr receiver,
- java.lang.String method,
- java.util.List<Tree.Expr> actuals,
- Location loc) |
-
CallExpr(Tree.Expr receiver,
- java.lang.String method,
- java.util.List<Tree.Expr> actuals,
- Location loc) |
-
Print(java.util.List<Tree.Expr> exprs,
- Location loc) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitForLoop(Tree.ForLoop that) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitIdent(Tree.Ident that) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitIf(Tree.If that) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitIndexed(Tree.Indexed that) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Field and Description | -
---|---|
Tree.LValue.Kind |
-Tree.LValue.lvKind |
-
Modifier and Type | -Method and Description | -
---|---|
static Tree.LValue.Kind |
-Tree.LValue.Kind.valueOf(java.lang.String name)
-Returns the enum constant of this type with the specified name.
- |
-
static Tree.LValue.Kind[] |
-Tree.LValue.Kind.values()
-Returns an array containing the constants of this enum type, in
-the order they are declared.
- |
-
Package | -Description | -
---|---|
decaf.frontend | -- |
decaf.tree | -- |
Modifier and Type | -Field and Description | -
---|---|
Tree.LValue |
-SemValue.lvalue |
-
Modifier and Type | -Class and Description | -
---|---|
static class |
-Tree.Ident
-An identifier
- |
-
static class |
-Tree.Indexed
-An array selection
- |
-
Modifier and Type | -Field and Description | -
---|---|
Tree.LValue |
-Tree.Assign.left |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitLValue(Tree.LValue that) |
-
Constructor and Description | -
---|
Assign(Tree.LValue left,
- Tree.Expr expr,
- Location loc) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitLiteral(Tree.Literal that) |
-
Package | -Description | -
---|---|
decaf.frontend | -- |
decaf.tree | -- |
Modifier and Type | -Field and Description | -
---|---|
Tree.MethodDef |
-SemValue.fdef |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitMethodDef(Tree.MethodDef that) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitNewArray(Tree.NewArray that) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitNewClass(Tree.NewClass that) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitNull(Tree.Null that) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitPrint(Tree.Print that) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitReadIntExpr(Tree.ReadIntExpr that) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitReadLineExpr(Tree.ReadLineExpr that) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitReturn(Tree.Return that) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitSkip(Tree.Skip that) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitThisExpr(Tree.ThisExpr that) |
-
Package | -Description | -
---|---|
decaf.frontend | -- |
decaf.tree | -- |
Modifier and Type | -Field and Description | -
---|---|
Tree.TopLevel |
-SemValue.prog |
-
protected Tree.TopLevel |
-BaseParser.tree |
-
Modifier and Type | -Method and Description | -
---|---|
Tree.TopLevel |
-BaseParser.getTree() |
-
Tree.TopLevel |
-BaseParser.parseFile() |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitTopLevel(Tree.TopLevel that) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitTypeArray(Tree.TypeArray that) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitTypeCast(Tree.TypeCast that) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitTypeClass(Tree.TypeClass that) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitTypeIdent(Tree.TypeIdent that) |
-
Package | -Description | -
---|---|
decaf.frontend | -- |
decaf.tree | -- |
Modifier and Type | -Field and Description | -
---|---|
Tree.TypeLiteral |
-SemValue.type |
-
Modifier and Type | -Class and Description | -
---|---|
static class |
-Tree.TypeArray
-An array type, A[]
- |
-
static class |
-Tree.TypeClass |
-
static class |
-Tree.TypeIdent
-Identifies a basic type.
- |
-
Modifier and Type | -Field and Description | -
---|---|
Tree.TypeLiteral |
-Tree.NewArray.elementType |
-
Tree.TypeLiteral |
-Tree.TypeArray.elementType |
-
Tree.TypeLiteral |
-Tree.MethodDef.returnType |
-
Tree.TypeLiteral |
-Tree.VarDef.type |
-
Constructor and Description | -
---|
MethodDef(boolean statik,
- java.lang.String name,
- Tree.TypeLiteral returnType,
- java.util.List<Tree.VarDef> formals,
- Tree.Block body,
- Location loc) |
-
NewArray(Tree.TypeLiteral elementType,
- Tree.Expr length,
- Location loc) |
-
TypeArray(Tree.TypeLiteral elementType,
- Location loc) |
-
VarDef(java.lang.String name,
- Tree.TypeLiteral type,
- Location loc) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitTypeTest(Tree.TypeTest that) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitUnary(Tree.Unary that) |
-
Package | -Description | -
---|---|
decaf.frontend | -- |
decaf.tree | -- |
Modifier and Type | -Field and Description | -
---|---|
Tree.VarDef |
-SemValue.vdef |
-
Modifier and Type | -Field and Description | -
---|---|
java.util.List<Tree.VarDef> |
-SemValue.vlist |
-
Modifier and Type | -Field and Description | -
---|---|
java.util.List<Tree.VarDef> |
-Tree.MethodDef.formals |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitVarDef(Tree.VarDef that) |
-
Constructor and Description | -
---|
MethodDef(boolean statik,
- java.lang.String name,
- Tree.TypeLiteral returnType,
- java.util.List<Tree.VarDef> formals,
- Tree.Block body,
- Location loc) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.accept(Tree.Visitor v)
-Visit this tree with a given visitor.
- |
-
void |
-Tree.TopLevel.accept(Tree.Visitor v) |
-
void |
-Tree.ClassDef.accept(Tree.Visitor v) |
-
void |
-Tree.MethodDef.accept(Tree.Visitor v) |
-
void |
-Tree.VarDef.accept(Tree.Visitor v) |
-
void |
-Tree.Skip.accept(Tree.Visitor v) |
-
void |
-Tree.Block.accept(Tree.Visitor v) |
-
void |
-Tree.WhileLoop.accept(Tree.Visitor v) |
-
void |
-Tree.ForLoop.accept(Tree.Visitor v) |
-
void |
-Tree.If.accept(Tree.Visitor v) |
-
void |
-Tree.Exec.accept(Tree.Visitor v) |
-
void |
-Tree.Break.accept(Tree.Visitor v) |
-
void |
-Tree.Print.accept(Tree.Visitor v) |
-
void |
-Tree.Return.accept(Tree.Visitor v) |
-
void |
-Tree.Apply.accept(Tree.Visitor v) |
-
void |
-Tree.NewClass.accept(Tree.Visitor v) |
-
void |
-Tree.NewArray.accept(Tree.Visitor v) |
-
void |
-Tree.Assign.accept(Tree.Visitor v) |
-
void |
-Tree.Unary.accept(Tree.Visitor v) |
-
void |
-Tree.Binary.accept(Tree.Visitor visitor) |
-
void |
-Tree.CallExpr.accept(Tree.Visitor visitor) |
-
void |
-Tree.ReadIntExpr.accept(Tree.Visitor visitor) |
-
void |
-Tree.ReadLineExpr.accept(Tree.Visitor visitor) |
-
void |
-Tree.ThisExpr.accept(Tree.Visitor visitor) |
-
void |
-Tree.TypeCast.accept(Tree.Visitor v) |
-
void |
-Tree.TypeTest.accept(Tree.Visitor v) |
-
void |
-Tree.Indexed.accept(Tree.Visitor v) |
-
void |
-Tree.Ident.accept(Tree.Visitor v) |
-
void |
-Tree.Literal.accept(Tree.Visitor v) |
-
void |
-Tree.Null.accept(Tree.Visitor v) |
-
void |
-Tree.TypeIdent.accept(Tree.Visitor v) |
-
void |
-Tree.TypeClass.accept(Tree.Visitor visitor) |
-
void |
-Tree.TypeArray.accept(Tree.Visitor v) |
-
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitWhileLoop(Tree.WhileLoop that) |
-
Package | -Description | -
---|---|
decaf.frontend | -- |
decaf.tree | -- |
Modifier and Type | -Field and Description | -
---|---|
Tree |
-SemValue.stmt |
-
Modifier and Type | -Field and Description | -
---|---|
java.util.List<Tree> |
-SemValue.flist
-field list
- |
-
java.util.List<Tree> |
-SemValue.slist
-statement list
- |
-
Modifier and Type | -Class and Description | -
---|---|
static class |
-Tree.Apply
-A method invocation
- |
-
static class |
-Tree.Assign
-A assignment with "=".
- |
-
static class |
-Tree.Binary
-A binary operation.
- |
-
static class |
-Tree.Block |
-
static class |
-Tree.Break
-A break from a loop.
- |
-
static class |
-Tree.CallExpr |
-
static class |
-Tree.ClassDef |
-
static class |
-Tree.Exec
-an expression statement
- |
-
static class |
-Tree.Expr |
-
static class |
-Tree.ForLoop
-A for loop.
- |
-
static class |
-Tree.Ident
-An identifier
- |
-
static class |
-Tree.If
-An "if ( ) { } else { }" block
- |
-
static class |
-Tree.Indexed
-An array selection
- |
-
static class |
-Tree.Literal
-A constant value given literally.
- |
-
static class |
-Tree.LValue |
-
static class |
-Tree.MethodDef |
-
static class |
-Tree.NewArray
-A new[...] operation.
- |
-
static class |
-Tree.NewClass
-A new(...) operation.
- |
-
static class |
-Tree.Null |
-
static class |
-Tree.Print
-A return statement.
- |
-
static class |
-Tree.ReadIntExpr |
-
static class |
-Tree.ReadLineExpr |
-
static class |
-Tree.Return
-A return statement.
- |
-
static class |
-Tree.Skip
-A no-op statement ";".
- |
-
static class |
-Tree.ThisExpr |
-
static class |
-Tree.TopLevel |
-
static class |
-Tree.TypeArray
-An array type, A[]
- |
-
static class |
-Tree.TypeCast
-A type cast.
- |
-
static class |
-Tree.TypeClass |
-
static class |
-Tree.TypeIdent
-Identifies a basic type.
- |
-
static class |
-Tree.TypeLiteral |
-
static class |
-Tree.TypeTest
-instanceof expression
- |
-
static class |
-Tree.Unary
-A unary operation.
- |
-
static class |
-Tree.VarDef |
-
static class |
-Tree.WhileLoop
-A while loop
- |
-
Modifier and Type | -Field and Description | -
---|---|
Tree |
-Tree.If.falseBranch |
-
Tree |
-Tree.ForLoop.init |
-
Tree |
-Tree.WhileLoop.loopBody |
-
Tree |
-Tree.ForLoop.loopBody |
-
Tree |
-Tree.If.trueBranch |
-
Tree |
-Tree.ForLoop.update |
-
Modifier and Type | -Field and Description | -
---|---|
java.util.List<Tree> |
-Tree.Block.block |
-
java.util.List<Tree> |
-Tree.ClassDef.fields |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-Tree.Visitor.visitTree(Tree that) |
-
Constructor and Description | -
---|
ForLoop(Tree init,
- Tree.Expr condition,
- Tree update,
- Tree loopBody,
- Location loc) |
-
If(Tree.Expr condition,
- Tree trueBranch,
- Tree falseBranch,
- Location loc) |
-
WhileLoop(Tree.Expr condition,
- Tree loopBody,
- Location loc) |
-
Constructor and Description | -
---|
Block(java.util.List<Tree> block,
- Location loc) |
-
ClassDef(java.lang.String name,
- java.lang.String parent,
- java.util.List<Tree> fields,
- Location loc) |
-
Class | -Description | -
---|---|
Tree | -
- Root class for abstract syntax tree nodes.
- |
-
Tree.Apply | -
- A method invocation
- |
-
Tree.Assign | -
- A assignment with "=".
- |
-
Tree.Binary | -
- A binary operation.
- |
-
Tree.Block | -- |
Tree.Break | -
- A break from a loop.
- |
-
Tree.CallExpr | -- |
Tree.ClassDef | -- |
Tree.Exec | -
- an expression statement
- |
-
Tree.Expr | -- |
Tree.ForLoop | -
- A for loop.
- |
-
Tree.Ident | -
- An identifier
- |
-
Tree.If | -
- An "if ( ) { } else { }" block
- |
-
Tree.Indexed | -
- An array selection
- |
-
Tree.Literal | -
- A constant value given literally.
- |
-
Tree.LValue | -- |
Tree.MethodDef | -- |
Tree.NewArray | -
- A new[...] operation.
- |
-
Tree.NewClass | -
- A new(...) operation.
- |
-
Tree.Null | -- |
Tree.Print | -
- A return statement.
- |
-
Tree.ReadIntExpr | -- |
Tree.ReadLineExpr | -- |
Tree.Return | -
- A return statement.
- |
-
Tree.Skip | -
- A no-op statement ";".
- |
-
Tree.ThisExpr | -- |
Tree.TopLevel | -- |
Tree.TypeArray | -
- An array type, A[]
- |
-
Tree.TypeCast | -
- A type cast.
- |
-
Tree.TypeClass | -- |
Tree.TypeIdent | -
- Identifies a basic type.
- |
-
Tree.TypeLiteral | -- |
Tree.TypeTest | -
- instanceof expression
- |
-
Tree.Unary | -
- A unary operation.
- |
-
Tree.VarDef | -- |
Tree.Visitor | -
- A generic visitor class for trees.
- |
-
Tree.WhileLoop | -
- A while loop
- |
-
Enum | -Description | -
---|---|
Tree.LValue.Kind | -- |
Package | -Description | -
---|---|
decaf.frontend | -- |
decaf.tree | -- |
Class and Description | -
---|
Tree
- Root class for abstract syntax tree nodes.
- |
-
Tree.ClassDef | -
Tree.Expr | -
Tree.LValue | -
Tree.MethodDef | -
Tree.TopLevel | -
Tree.TypeLiteral | -
Tree.VarDef | -
Class and Description | -
---|
Tree
- Root class for abstract syntax tree nodes.
- |
-
Tree.Apply
- A method invocation
- |
-
Tree.Assign
- A assignment with "=".
- |
-
Tree.Binary
- A binary operation.
- |
-
Tree.Block | -
Tree.Break
- A break from a loop.
- |
-
Tree.CallExpr | -
Tree.ClassDef | -
Tree.Exec
- an expression statement
- |
-
Tree.Expr | -
Tree.ForLoop
- A for loop.
- |
-
Tree.Ident
- An identifier
- |
-
Tree.If
- An "if ( ) { } else { }" block
- |
-
Tree.Indexed
- An array selection
- |
-
Tree.Literal
- A constant value given literally.
- |
-
Tree.LValue | -
Tree.LValue.Kind | -
Tree.MethodDef | -
Tree.NewArray
- A new[...] operation.
- |
-
Tree.NewClass
- A new(...) operation.
- |
-
Tree.Null | -
Tree.Print
- A return statement.
- |
-
Tree.ReadIntExpr | -
Tree.ReadLineExpr | -
Tree.Return
- A return statement.
- |
-
Tree.Skip
- A no-op statement ";".
- |
-
Tree.ThisExpr | -
Tree.TopLevel | -
Tree.TypeArray
- An array type, A[]
- |
-
Tree.TypeCast
- A type cast.
- |
-
Tree.TypeClass | -
Tree.TypeIdent
- Identifies a basic type.
- |
-
Tree.TypeLiteral | -
Tree.TypeTest
- instanceof expression
- |
-
Tree.Unary
- A unary operation.
- |
-
Tree.VarDef | -
Tree.Visitor
- A generic visitor class for trees.
- |
-
Tree.WhileLoop
- A while loop
- |
-
public class IndentPrintWriter
-extends java.io.PrintWriter
-Modifier and Type | -Field and Description | -
---|---|
private java.lang.StringBuilder |
-indent |
-
private boolean |
-newLineBegin |
-
private int |
-step |
-
out
lock
Constructor and Description | -
---|
IndentPrintWriter(java.io.OutputStream out,
- int step) |
-
IndentPrintWriter(java.io.Writer out,
- int step) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-decIndent()
-减少缩进
- |
-
void |
-incIndent()
-增加缩进
- |
-
void |
-println() |
-
void |
-write(char[] buf,
- int off,
- int len) |
-
void |
-write(int c) |
-
void |
-write(java.lang.String s,
- int off,
- int len) |
-
private void |
-writeIndent() |
-
append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, setError, write, write
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private java.lang.StringBuilder indent-
private boolean newLineBegin-
private int step-
public IndentPrintWriter(java.io.OutputStream out, - int step)-
out
- step
- 每次缩进变化的空格数public IndentPrintWriter(java.io.Writer out, - int step)-
out
- step
- 每次缩进变化的空格数public void decIndent()-
public void incIndent()-
public void println()-
println
in class java.io.PrintWriter
public void write(char[] buf, - int off, - int len)-
write
in class java.io.PrintWriter
public void write(int c)-
write
in class java.io.PrintWriter
public void write(java.lang.String s, - int off, - int len)-
write
in class java.io.PrintWriter
private void writeIndent()-
public final class MiscUtils
-extends java.lang.Object
-Modifier and Type | -Method and Description | -
---|---|
static java.lang.String |
-quote(java.lang.String str)
-返回带转义符格式的字符串
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Package | -Description | -
---|---|
decaf.tree | -- |
Modifier and Type | -Method and Description | -
---|---|
private void |
-Tree.Binary.binaryOperatorPrintTo(IndentPrintWriter pw,
- java.lang.String op) |
-
abstract void |
-Tree.printTo(IndentPrintWriter pw) |
-
void |
-Tree.TopLevel.printTo(IndentPrintWriter pw) |
-
void |
-Tree.ClassDef.printTo(IndentPrintWriter pw) |
-
void |
-Tree.MethodDef.printTo(IndentPrintWriter pw) |
-
void |
-Tree.VarDef.printTo(IndentPrintWriter pw) |
-
void |
-Tree.Skip.printTo(IndentPrintWriter pw) |
-
void |
-Tree.Block.printTo(IndentPrintWriter pw) |
-
void |
-Tree.WhileLoop.printTo(IndentPrintWriter pw) |
-
void |
-Tree.ForLoop.printTo(IndentPrintWriter pw) |
-
void |
-Tree.If.printTo(IndentPrintWriter pw) |
-
void |
-Tree.Exec.printTo(IndentPrintWriter pw) |
-
void |
-Tree.Break.printTo(IndentPrintWriter pw) |
-
void |
-Tree.Print.printTo(IndentPrintWriter pw) |
-
void |
-Tree.Return.printTo(IndentPrintWriter pw) |
-
void |
-Tree.Apply.printTo(IndentPrintWriter pw) |
-
void |
-Tree.NewClass.printTo(IndentPrintWriter pw) |
-
void |
-Tree.NewArray.printTo(IndentPrintWriter pw) |
-
void |
-Tree.Assign.printTo(IndentPrintWriter pw) |
-
void |
-Tree.Unary.printTo(IndentPrintWriter pw) |
-
void |
-Tree.Binary.printTo(IndentPrintWriter pw) |
-
void |
-Tree.CallExpr.printTo(IndentPrintWriter pw) |
-
void |
-Tree.ReadIntExpr.printTo(IndentPrintWriter pw) |
-
void |
-Tree.ReadLineExpr.printTo(IndentPrintWriter pw) |
-
void |
-Tree.ThisExpr.printTo(IndentPrintWriter pw) |
-
void |
-Tree.TypeCast.printTo(IndentPrintWriter pw) |
-
void |
-Tree.TypeTest.printTo(IndentPrintWriter pw) |
-
void |
-Tree.Indexed.printTo(IndentPrintWriter pw) |
-
void |
-Tree.Ident.printTo(IndentPrintWriter pw) |
-
void |
-Tree.Literal.printTo(IndentPrintWriter pw) |
-
void |
-Tree.Null.printTo(IndentPrintWriter pw) |
-
void |
-Tree.TypeIdent.printTo(IndentPrintWriter pw) |
-
void |
-Tree.TypeClass.printTo(IndentPrintWriter pw) |
-
void |
-Tree.TypeArray.printTo(IndentPrintWriter pw) |
-
private void |
-Tree.Unary.unaryOperatorToString(IndentPrintWriter pw,
- java.lang.String op) |
-
Class | -Description | -
---|---|
IndentPrintWriter | -
- 用于缩进输出的类
-- 使用时注意不要自行输出"\r\n"或"\n"进行换行,而要使用该类的println系列函数进行换行 |
-
MiscUtils | -- |
Package | -Description | -
---|---|
decaf.tree | -- |
Class and Description | -
---|
IndentPrintWriter
- 用于缩进输出的类
-- 使用时注意不要自行输出"\r\n"或"\n"进行换行,而要使用该类的println系列函数进行换行 |
-
The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.
-Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
-Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
-Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
-Each annotation type has its own separate page with the following sections:
-Each enum has its own separate page with the following sections:
-Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
-There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object
. The interfaces do not inherit from java.lang.Object
.
The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
-These links take you to the next or previous class, interface, package, or related page.
-These links show and hide the HTML frames. All pages are available with or without frames.
-The All Classes link shows all classes and interfaces except non-static nested types.
-Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
-The Constant Field Values page lists the static final fields and their values.
-- - diff --git "a/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2016_\351\273\204\345\256\266\346\231\226_PA/698609556_1_decaf_PA1A/result/doc/overview-summary.html" "b/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2016_\351\273\204\345\256\266\346\231\226_PA/698609556_1_decaf_PA1A/result/doc/overview-summary.html" deleted file mode 100644 index 8f9a3e4e4..000000000 --- "a/\345\244\247\344\270\211\344\270\212/\347\274\226\350\257\221\345\216\237\347\220\206/hw/2016_\351\273\204\345\256\266\346\231\226_PA/698609556_1_decaf_PA1A/result/doc/overview-summary.html" +++ /dev/null @@ -1,152 +0,0 @@ - - - - - -
Package | -Description | -
---|---|
decaf | -- |
decaf.error | -- |
decaf.frontend | -- |
decaf.tree | -- |
decaf.utils | -- |