<s> import argparse <EOL> import os . path <EOL> import re <EOL> import sys <EOL> from . import Grammar <EOL> argp = argparse . ArgumentParser ( description = "<STR_LIT>" ) <EOL> argp . add_argument ( "<STR_LIT:input>" , type = argparse . FileType ( '<STR_LIT:r>' ) , help = "<STR_LIT>" ) <EOL> argp . add_argument ( "<STR_LIT>" , type = argparse . FileType ( '<STR_LIT:w>' ) , nargs = "<STR_LIT:?>" , default = sys . stdout , help = "<STR_LIT>" ) <EOL> argp . add_argument ( "<STR_LIT>" , "<STR_LIT>" , action = "<STR_LIT>" , nargs = <NUM_LIT:2> , help = "<STR_LIT>" , default = [ ] ) <EOL> args = argp . parse_args ( ) <EOL> args . function = { func : eval ( defn ) for ( func , defn ) in args . function } <EOL> args . output . write ( Grammar ( args . input . read ( ) , path = os . path . dirname ( args . input . name ) , ** args . function ) . generate ( ) ) </s>
