parsing package

dependencies module

Exported members: abstract_code_dependencies


abstract_code_dependencies(code[, ...]) Analyses identifiers used in abstract code blocks

expressions module

AST parsing based analysis of expressions

Exported members: is_boolean_expression, parse_expression_unit


is_boolean_expression(expr, variables) Determines if an expression is of boolean type or not
parse_expression_unit(expr, variables) Returns the unit value of an expression, and checks its validity

functions module

Exported members: AbstractCodeFunction, abstract_code_from_function, extract_abstract_code_functions, substitute_abstract_code_functions


AbstractCodeFunction(name, args, code, ...) The information defining an abstract code function
FunctionRewriter(func[, numcalls]) Inlines a function call using temporary variables
VarRewriter(pre) Rewrites all variable names in names by prepending pre


abstract_code_from_function(func) Converts the body of the function to abstract code
extract_abstract_code_functions(code) Returns a set of abstract code functions from function definitions.
substitute_abstract_code_functions(code, funcs) Performs inline substitution of all the functions in the code

statements module


parse_statement(code) Parses a single line of code into “var op expr”.

sympytools module

Utility functions for parsing expressions and statements.


CustomSympyPrinter([settings]) Printer that overrides the printing of some basic sympy objects.


replace_constants(sympy_expr[, variables]) Replace constant values in a sympy expression with their numerical value.
str_to_sympy(expr) Parses a string into a sympy expression.
sympy_to_str(sympy_expr) Converts a sympy expression into a string.


PRINTER Printer that overrides the printing of some basic sympy objects.