params package

Package that provides all the functionality to parse and process the command line arguments of Cnerator. To see all the parameters, run Cnerator with -h or --help parameters.

Submodules

params.epilog module

This module is aimed at building the epilog of the help message. Such message shows the different syntactic constructs provided by Cnerator.

params.epilog.build_epilog() → str[source]

Builds the epilog of the help message

params.json_probs module

This module is aimed at processing input json files specifying the probabilities of the syntactic constructs to be created by Cnerator (command line option -P). See json/probabilities for particular examples.

params.json_probs.parse_probabilities_specification_json_file(file_name: str) → Dict[str, dict][source]

Parses a json file with probabilities specifications and returns a valid representation

params.parameters module

Module where the command line arguments are parsed.

params.parameters.get_app_args()[source]
params.parameters.get_modules_to_import(vst_param: str) → List[source]

Returns the list of visitors to import, given the args.visitors option

params.parameters.get_probs_to_override(probs_param: str) → Optional[Dict[str, dict]][source]

Parses the args.probs parameter and returns the dictionary with their values

params.parameters.parse_args()[source]
params.parameters.parse_function_specification_json_file(file_name: str) → Dict[str, Dict][source]

Parses a json file with function specifications and returns a valid representation

params.parameters.parse_probabilities_specification_json_file(file_name: str) → Optional[Dict[str, dict]][source]

Parses a json file with probabilities specifications and returns a valid representation

params.writter module

This modulete takes the program representation (AST) and writes it into the different compilation units specified by the user through the -n or -nfiles options.

params.writter.replace_code(code)[source]
params.writter.split_in_similar_parts(seq, amount)[source]
params.writter.write_in_files(program, args)[source]
params.writter.write_in_multiple_files(program, args)[source]
params.writter.write_in_multiple_headers(program, args)[source]
params.writter.write_in_one_file(program, args)[source]