diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2020-06-11 17:30:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-11 17:30:46 +0100 |
commit | 1ed83adb0e95305af858bd41af531e487f54fee7 (patch) | |
tree | 5b05876e1800975fd2f0b8021544423f9fd9822a /Parser/pgen/__main__.py | |
parent | 311110abcd8ab648dbf1803e36a8ba5d93fa019b (diff) | |
download | cpython-git-1ed83adb0e95305af858bd41af531e487f54fee7.tar.gz |
bpo-40939: Remove the old parser (GH-20768)
This commit removes the old parser, the deprecated parser module, the old parser compatibility flags and environment variables and all associated support code and documentation.
Diffstat (limited to 'Parser/pgen/__main__.py')
-rw-r--r-- | Parser/pgen/__main__.py | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/Parser/pgen/__main__.py b/Parser/pgen/__main__.py deleted file mode 100644 index d3780a7b77..0000000000 --- a/Parser/pgen/__main__.py +++ /dev/null @@ -1,43 +0,0 @@ -import argparse - -from .pgen import ParserGenerator - - -def main(): - parser = argparse.ArgumentParser(description="Parser generator main program.") - parser.add_argument( - "grammar", type=str, help="The file with the grammar definition in EBNF format" - ) - parser.add_argument("tokens", type=str, help="The file with the token definitions") - parser.add_argument( - "graminit_h", - type=argparse.FileType("w"), - help="The path to write the grammar's non-terminals as #defines", - ) - parser.add_argument( - "graminit_c", - type=argparse.FileType("w"), - help="The path to write the grammar as initialized data", - ) - - parser.add_argument("--verbose", "-v", action="count") - parser.add_argument( - "--graph", - type=argparse.FileType("w"), - action="store", - metavar="GRAPH_OUTPUT_FILE", - help="Dumps a DOT representation of the generated automata in a file", - ) - - args = parser.parse_args() - - p = ParserGenerator( - args.grammar, args.tokens, verbose=args.verbose, graph_file=args.graph - ) - grammar = p.make_grammar() - grammar.produce_graminit_h(args.graminit_h.write) - grammar.produce_graminit_c(args.graminit_c.write) - - -if __name__ == "__main__": - main() |