Changeset - b06a29504c82
[Not reviewed]
0 2 0
mh - 4 years ago 2021-06-03 15:52:43
contact@maxhenger.nl
more documentation of language validation
2 files changed with 10 insertions and 3 deletions:
0 comments (0 inline, 0 general)
docs/spec/definitions.md
Show inline comments
 
@@ -208,6 +208,8 @@ DeclComp = CompVariant Ident PolyVars? "("
 

	
 
We'll delay examples of components until we've introduced the concept of connectors in this document.
 

	
 
**note**: It might be that the distinction between primitive and composite connectors (and the restrictions they place on the available language features inside each of them) will be removed in the future.
 

	
 
## Combining all Declarations
 

	
 
A module is the combination of any of the above declarations. So we may specify the possible contents of a module as:
docs/spec/validation.md
Show inline comments
 
@@ -180,10 +180,10 @@ The `put` function may put a value into an output port. This function may only b
 

	
 
If a `put` function is called in a branch that has previously assumed that nothing will ever be sent through the port provided as argument, then that branch is considered inconsistent and will be removed. If a `put` function is called in a branch that has not decided on the firing state of a port then it will be forced to fire without forking of execution.
 

	
 
The put function would be written in PDL as:
 
The put function would be written in PDL as, if it would support the C-like `void` type:
 

	
 
```
 
func put<T>(out<T> output_port, T value_to_put) -> T { /* ... */ }
 
func put<T>(out<T> output_port, T value_to_put) -> void { /* ... */ }
 
```
 

	
 
**note**: Whether the `put` statement blocks until a corresponding `get` has been performed has not yet been decided. 
 
@@ -239,6 +239,11 @@ func assert(bool test) -> void { /* ... */ }
 

	
 
### Synchronous Blocks
 

	
 
Synchronous blocks may only be placed in primitive components. Synchronous blocks may not be nested. One may not jump into or out of a synchronous block.
 

	
 
### Use of Builtin Procedures
 

	
 
### Control-Flow Rules
 
\ No newline at end of file
 
Builtin procedures that do not have a return value (currently only `put` and `assert`) may not be called at the expression level and must be called at the statement level. i.e. the parent of the builtin call expression may only be the `StmtExpr` statement.
 

	
 
### Control-Flow Rules
 

	
0 comments (0 inline, 0 general)