Skip to content

Commit d57895c

Browse files
committed
Changed ReadME
1 parent 34c71d0 commit d57895c

File tree

1 file changed

+14
-4
lines changed
  • pycode/memilio-generation/memilio/tools

1 file changed

+14
-4
lines changed

pycode/memilio-generation/memilio/tools/README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,17 @@ This descibes the filepath to your model.cpp outgoing from the tools folder.
2424

2525
To use a different model, replace ode_secirvvs with the desired model's name in the file path.
2626

27-
To set up a target folder, specify the desired output directory for the generated bindings.
27+
Adding Additional Source Files:
28+
In addition to the main source file, it is possible to include further source files in the binding process.
29+
For this purpose, the ´asts´ instance of the [ASTHandler class](/pycode/memilio-generation/memilio/generation/ast_handler.py) provides the method ´add_source_file´:
30+
```python
31+
asts.add_source_file("name_of_the_file.cpp")
32+
´´´
33+
34+
To set up a target folder, specify the desired output directory for the generated bindings here:
35+
`conf.target_folder = file_path`
36+
If no custom path is specified and `file_path`is used as the target folder, the generated files will be saved in
37+
the tools directory by default, as this is the working directory of the skript.
2838

2939
After setting up the source file and target folder, set the path to the example script in the terminal:
3040
If the terminal shows the memilio package, just give the path with:
@@ -53,10 +63,10 @@ You can print the AST in the example script with the aviz instance of the Visual
5363

5464

5565
Example:
56-
`aviz.output_ast_formatted(ast, ast.get_node_by_index(1))` displays the second node of the AST and its children in a file called ast_formatted.txt.
57-
The root node (`.get_node_by_index(0)`) displays the whole AST.
66+
`aviz.output_ast_formatted(asts.get_ast_by_id(0), ast.get_node_by_index(1))` displays the second node of the first AST and its children in a file called ast_formatted.txt.
67+
The root node `.get_node_by_index(0)` displays the whole AST.
5868

59-
`aviz.output_ast_terminal(ast, ast.get_node_by_index(1))` displays the second node of the AST and its children in terminal.
69+
`aviz.output_ast_terminal(asts.get_ast_by_id(0), ast.get_node_by_index(1))` displays the second node of the AST and its children in terminal.
6070

6171
The first argument of the statements specify the given AST. The second argument specifies the node and its children that you want to display.
6272

0 commit comments

Comments
 (0)