Skip to content

Latest commit

 

History

History
31 lines (27 loc) · 1.52 KB

abstract_model.rst

File metadata and controls

31 lines (27 loc) · 1.52 KB

Abstract Model Representation

The Abstract Model representation allows a separation of concern between translation and building. Translation involves anything that happens from the moment the source code of the original model is loaded into memory up to the creation of the Abstract Model representation. Similarly, the building will be everything that takes place between the Abstract Model and the source code of the model written in a programming language different than that of the original model.This approach allows to easily include new code to the translation or or building process, without the the risk of affecting one another.

The :pyAbstractModel object should retain as much information from the original model as possible. Although the information is not used in the output code, it may be necessary for other future output languages or for improvements in the currently supported outputs. For example, currently unchangeable constansts (== defined in Vensim) are treated as regular components with Python, but in the future we may want to protect them from user interaction.

The lowest level of this representation is the :pyAbstractSyntax Tree (AST). This includes all the operations and calls in a given component expression.

Main abstract structures

pysd.translators.structures.abstract_model

Abstrat structures for the AST

pysd.translators.structures.abstract_expressions