()
| 25 | |
| 26 | |
| 27 | def parse_args(): |
| 28 | parser = argparse.ArgumentParser( |
| 29 | description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter |
| 30 | ) |
| 31 | |
| 32 | parser.add_argument( |
| 33 | "--output", |
| 34 | "-o", |
| 35 | type=argparse.FileType("w"), |
| 36 | default=sys.stdout, |
| 37 | help="A file to output the expanded axiom to. Defaults to stdout.", |
| 38 | ) |
| 39 | parser.add_argument( |
| 40 | "-l", |
| 41 | "--log-level", |
| 42 | type=str, |
| 43 | default=DEFAULT_LEVEL, |
| 44 | choices=LOG_LEVELS.keys(), |
| 45 | help=f"Set the logging output level. Defaults to {DEFAULT_LEVEL}.", |
| 46 | ) |
| 47 | |
| 48 | parser.add_argument( |
| 49 | "--seed", |
| 50 | "-s", |
| 51 | type=int, |
| 52 | default=generate_random_seed(), |
| 53 | help="The value to seed the random generator with", |
| 54 | ) |
| 55 | parser.add_argument( |
| 56 | "--placeholders", |
| 57 | "-p", |
| 58 | action="store_true", |
| 59 | default=False, |
| 60 | help="Whether to allow tokens other than f,g,F,G,v,d,D", |
| 61 | ) |
| 62 | parser.add_argument( |
| 63 | "--stochastic", |
| 64 | action="store_true", |
| 65 | default=False, |
| 66 | help="Whether to allow stochastic production rules", |
| 67 | ) |
| 68 | parser.add_argument( |
| 69 | "--context-sensitive", |
| 70 | "-c", |
| 71 | action="store_true", |
| 72 | default=False, |
| 73 | help="Whether to allow context-sensitive production rules", |
| 74 | ) |
| 75 | parser.add_argument( |
| 76 | "--drawing-bias", |
| 77 | type=float, |
| 78 | default=1, |
| 79 | help="The bias to apply for generating 'f' and 'g' tokens in the RHS.", |
| 80 | ) |
| 81 | parser.add_argument( |
| 82 | "--skipping-bias", |
| 83 | type=float, |
| 84 | default=1, |
no test coverage detected