From b06a29504c82991ecfd72625eb0b891d0b99f85a 2021-06-03 15:52:43 From: mh Date: 2021-06-03 15:52:43 Subject: [PATCH] more documentation of language validation --- diff --git a/docs/spec/definitions.md b/docs/spec/definitions.md index aa83df09814a0b62fb32ff6c5f8bb458ad030f5f..591b3fe9304797f1eb556819173205a7c8b70f1f 100644 --- a/docs/spec/definitions.md +++ b/docs/spec/definitions.md @@ -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: diff --git a/docs/spec/validation.md b/docs/spec/validation.md index a692b0a3de06993395e6c41bc5332094cd78bf76..9a0fa0b9419e50dce43024c892d7c4f5fc0e9525 100644 --- a/docs/spec/validation.md +++ b/docs/spec/validation.md @@ -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(out output_port, T value_to_put) -> T { /* ... */ } +func put(out 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 +