zkay.zkay_ast.visitor.deep_copy

Module Contents

zkay.zkay_ast.visitor.deep_copy.T
zkay.zkay_ast.visitor.deep_copy.deep_copy(ast: T, with_types=False, with_analysis=False) T
Parameters
  • ast

  • with_types – (optional)

Returns

a deep copy of ast

Only parents and identifiers are updated in the returned ast (e.g., inferred types are not preserved)

zkay.zkay_ast.visitor.deep_copy.replace_expr(old_expr: zkay.zkay_ast.ast.Expression, new_expr: zkay.zkay_ast.ast.Expression, copy_type: bool = False)

Copies over ast common ast attributes and reruns, parent setter, symbol table, side effect detector

zkay.zkay_ast.visitor.deep_copy._replace_ast(old_ast: zkay.zkay_ast.ast.AST, new_ast: zkay.zkay_ast.ast.AST)
class zkay.zkay_ast.visitor.deep_copy.DeepCopyVisitor(with_types, with_analysis)

Bases: zkay.zkay_ast.visitor.visitor.AstVisitor

setting_later
static copy_ast_fields(ast, ast_copy)
visitChildren(self, ast)
visitAnnotatedTypeName(self, ast)
visitUserDefinedTypeName(self, ast: zkay.zkay_ast.ast.UserDefinedTypeName)
visitBuiltinFunction(self, ast)
visitExpression(self, ast: zkay.zkay_ast.ast.Expression)
visitStatement(self, ast: zkay.zkay_ast.ast.Statement)
copy_field(self, field)