You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce an include statement that allows one NESTML file to be included into another.
For simplicity, this should be just a verbatim (C preprocessor #include style) textual include. (Hence, we choose the name include rather than import.)
Example:
model_XYZ.nestml:
parameters:
a mV = 42 mV
model_FOO.nestml:
parameters:
b mV = -2 mV
model_full.nestml:
model foo:
include "model_XYZ.nestml"
include "model_FOO.nestml"
state:
c mV = a + b
Use this to deduplicate/modularize code for postsynaptic response shapes and refractory mechanism in neurons.
The include statement should be able to appear at any indentation level. For instance, you could do an include "root_finding.nestml" inside the update block of a model.
This means that the ModelParser has to be able to parse the included .nestml file at different points of the grammar: as a modelBody, or as an Expression, or as a Statement, etc. We could achieve this by trying to parse these different elements one by one and wrapping them in a series of try..except blocks. So there would be a (for example) ModelParser.parse_included_file(filename). The ASTNode returned from there should be plugged into the place in the parent where the include statement appears.
The text was updated successfully, but these errors were encountered:
Introduce an
include
statement that allows one NESTML file to be included into another.For simplicity, this should be just a verbatim (C preprocessor
#include
style) textual include. (Hence, we choose the nameinclude
rather thanimport
.)Example:
model_XYZ.nestml
:model_FOO.nestml
:model_full.nestml
:Use this to deduplicate/modularize code for postsynaptic response shapes and refractory mechanism in neurons.
The
include
statement should be able to appear at any indentation level. For instance, you could do aninclude "root_finding.nestml"
inside theupdate
block of a model.This means that the ModelParser has to be able to parse the included .nestml file at different points of the grammar: as a modelBody, or as an Expression, or as a Statement, etc. We could achieve this by trying to parse these different elements one by one and wrapping them in a series of try..except blocks. So there would be a (for example)
ModelParser.parse_included_file(filename)
. The ASTNode returned from there should be plugged into the place in the parent where theinclude
statement appears.The text was updated successfully, but these errors were encountered: