lookout.style.format.langs.__main__
¶
Tooling to generate language specific resources.
Module Contents¶
-
lookout.style.format.langs.__main__.
parse_args
()¶ Parse arguments into an argparse.Namespace.
-
lookout.style.format.langs.__main__.
extract_node_token
(file:str, node:bblfsh.Node)¶ Extract a token from a babelfish node.
Parameters: - file – File from which the node was parsed.
- node – Node from which to extract a token.
Returns: Extracted token.
-
lookout.style.format.langs.__main__.
analyze_uast
(path:str, content:str, root:bblfsh.Node, internal_types:dict, roles:dict, reserved:set)¶ Fill internal types, roles and reserved dictionaries with statistics computed from an UAST.
Parameters: - path – Path of the analyzed file.
- content – Content of the analyzed file.
- root – UAST of the analyzed file.
- internal_types – Dictionary containing the internal types statistics.
- roles – Dictionary containing the roles statistics.
- reserved – Dictionary containing the reserved (or tokens) statistics.
-
lookout.style.format.langs.__main__.
generate_files
(outdir:str, internal_types:dict, roles:dict, reserved:set)¶ Generate roles and tokens statistics modules.
Parameters: - outdir – Output directory in which to write the computed statistics.
- internal_types – Internal types statistics dictionary.
- roles – Roles statistics dictionary.
- reserved – Reserved (or tokens) statistics dictionary.
-
lookout.style.format.langs.__main__.
main
()¶ Entry point.