103 lines
2 KiB
Markdown
103 lines
2 KiB
Markdown
# code_gen.py
|
|
|
|

|
|
|
|
## Overview
|
|
|
|
Convert the value of `tok` from string to bool, while maintaining line number & column.
|
|
|
|
## API Index
|
|
|
|
- [Function: `tok_to_bool`](#tok_to_bool)
|
|
- [Function: `tok_to_int`](#tok_to_int)
|
|
- [Function: `tok_to_str`](#tok_to_str)
|
|
- [Class: `VersionInfo`](#versioninfo)
|
|
- [Function: `test`](#test)
|
|
- [Function: `build_info`](#build_info)
|
|
|
|
---
|
|
|
|
## API Reference
|
|
|
|
### [Function] `tok_to_bool`
|
|
|
|
```python
|
|
function tok_to_bool(tok)
|
|
```
|
|
|
|
Convert the value of `tok` from string to bool, while maintaining line number & column.
|
|
|
|
---
|
|
|
|
### [Function] `tok_to_int`
|
|
|
|
```python
|
|
function tok_to_int(tok)
|
|
```
|
|
|
|
Convert the value of `tok` from string to int, while maintaining line number & column.
|
|
|
|
---
|
|
|
|
### [Function] `tok_to_str`
|
|
|
|
```python
|
|
function tok_to_str(tok)
|
|
```
|
|
|
|
Convert the value of `tok` from string to string, while maintaining line number & column.
|
|
|
|
---
|
|
|
|
### [Class] `VersionInfo(object)`
|
|
|
|
*No description provided.*
|
|
|
|
#### Methods
|
|
|
|
##### `__init__(self, input_raw)`
|
|
|
|
*No description provided.*
|
|
|
|
##### `fparams(self)`
|
|
|
|
*No description provided.*
|
|
|
|
---
|
|
|
|
### [Function] `test`
|
|
|
|
```python
|
|
function test(terms_raw, report, latex)
|
|
```
|
|
|
|
Compiles the post-processing term specifications from DSL into targets.
|
|
|
|
This compiles the Lark AST through all 4 pipeline stages (Stage 1 to 4)
|
|
and outputs the resulting Fortran source code via Jinja2, a LaTeX equation
|
|
dictionary, or a code generation IR report.
|
|
|
|
|
|
**Arguments:**
|
|
|
|
- ` terms_raw ` *(str)*: The raw string contents of the DSL terms specification input file.
|
|
- ` report ` *(bool)*: If True, generates and saves the intermediate code generation report.
|
|
- ` latex ` *(bool)*: If True, prints LaTeX equations of the averaged terms to stdout.
|
|
|
|
---
|
|
|
|
### [Function] `build_info`
|
|
|
|
```python
|
|
function build_info(terms_raw)
|
|
```
|
|
|
|
Generates and prints build information for the current code generation run.
|
|
|
|
|
|
**Arguments:**
|
|
|
|
- ` terms_raw ` *(str)*: The raw string contents of the DSL terms specification input file.
|
|
|
|
---
|
|
|