Skip to content

Commit

Permalink
fixed grammar of Rust target.
Browse files Browse the repository at this point in the history
  • Loading branch information
AneesHl committed Jul 20, 2024
1 parent 242e3c7 commit b4f40a6
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 5 deletions.
18 changes: 17 additions & 1 deletion docs/writing-reactors/a-first-reactor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,14 @@ The general structure of a reactor definition is as follows:
timer <name>([<offset>[, <period>]])
logical action <name>[: <type>]
physical action <name>[: <type>]
[const] method <name>(parameters):<type> {= ... body ...=}
reaction [<name>] (triggers) [<uses>] [-> <effects>] [{= ... body ...=}]
<instance-name> = new <class-name>([<parameter-assignments>])
<port-name> [, ...] -> <port-name> [, ...] [after <delay>]
}
```
</ShowIf>
<ShowIf cpp rs>
<ShowIf cpp>
```lf
[main] reactor <class-name> [(parameters)] {
input <name>: <type>
Expand All @@ -116,6 +117,21 @@ The general structure of a reactor definition is as follows:
}
```
</ShowIf>
<ShowIf rs>
```lf
[main] reactor <class-name> [(parameters)] {
input <name>: <type>
output <name>: <type>
state <name>: <type> [= <value>]
timer <name>([<offset>[, <period>]])
logical action <name>[: <type>]
physical action <name>[: <type>]
reaction [<name>] (triggers) [<uses>] [-> <effects>] [{= ... body ...=}]
<instance-name> = new <class-name>([<parameter-assignments>])
<port-name> [, ...] -> <port-name> [, ...] [after <delay>]
}
```
</ShowIf>
<ShowIf py>
```lf
[main or federated] reactor <class-name> [(parameters)] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,14 @@ The general structure of a reactor definition is as follows:
timer <name>([<offset>[, <period>]])
logical action <name>[: <type>]
physical action <name>[: <type>]
[const] method <name>(parameters):<type> {= ... body ...=}
reaction [<name>] (triggers) [<uses>] [-> <effects>] [{= ... body ...=}]
<instance-name> = new <class-name>([<parameter-assignments>])
<port-name> [, ...] -> <port-name> [, ...] [after <delay>]
}
```
</ShowIf>
<ShowIf cpp rs>
<ShowIf cpp>
```lf
[main] reactor <class-name> [(parameters)] {
input <name>: <type>
Expand All @@ -116,6 +117,21 @@ The general structure of a reactor definition is as follows:
}
```
</ShowIf>
<ShowIf rs>
```lf
[main] reactor <class-name> [(parameters)] {
input <name>: <type>
output <name>: <type>
state <name>: <type> [= <value>]
timer <name>([<offset>[, <period>]])
logical action <name>[: <type>]
physical action <name>[: <type>]
reaction [<name>] (triggers) [<uses>] [-> <effects>] [{= ... body ...=}]
<instance-name> = new <class-name>([<parameter-assignments>])
<port-name> [, ...] -> <port-name> [, ...] [after <delay>]
}
```
</ShowIf>
<ShowIf py>
```lf
[main or federated] reactor <class-name> [(parameters)] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,14 @@ The general structure of a reactor definition is as follows:
timer <name>([<offset>[, <period>]])
logical action <name>[: <type>]
physical action <name>[: <type>]
[const] method <name>(parameters):<type> {= ... body ...=}
reaction [<name>] (triggers) [<uses>] [-> <effects>] [{= ... body ...=}]
<instance-name> = new <class-name>([<parameter-assignments>])
<port-name> [, ...] -> <port-name> [, ...] [after <delay>]
}
```
</ShowIf>
<ShowIf cpp rs>
<ShowIf cpp>
```lf
[main] reactor <class-name> [(parameters)] {
input <name>: <type>
Expand All @@ -116,6 +117,21 @@ The general structure of a reactor definition is as follows:
}
```
</ShowIf>
<ShowIf rs>
```lf
[main] reactor <class-name> [(parameters)] {
input <name>: <type>
output <name>: <type>
state <name>: <type> [= <value>]
timer <name>([<offset>[, <period>]])
logical action <name>[: <type>]
physical action <name>[: <type>]
reaction [<name>] (triggers) [<uses>] [-> <effects>] [{= ... body ...=}]
<instance-name> = new <class-name>([<parameter-assignments>])
<port-name> [, ...] -> <port-name> [, ...] [after <delay>]
}
```
</ShowIf>
<ShowIf py>
```lf
[main or federated] reactor <class-name> [(parameters)] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,14 @@ The general structure of a reactor definition is as follows:
timer <name>([<offset>[, <period>]])
logical action <name>[: <type>]
physical action <name>[: <type>]
[const] method <name>(parameters):<type> {= ... body ...=}
reaction [<name>] (triggers) [<uses>] [-> <effects>] [{= ... body ...=}]
<instance-name> = new <class-name>([<parameter-assignments>])
<port-name> [, ...] -> <port-name> [, ...] [after <delay>]
}
```
</ShowIf>
<ShowIf cpp rs>
<ShowIf cpp>
```lf
[main] reactor <class-name> [(parameters)] {
input <name>: <type>
Expand All @@ -116,6 +117,21 @@ The general structure of a reactor definition is as follows:
}
```
</ShowIf>
<ShowIf rs>
```lf
[main] reactor <class-name> [(parameters)] {
input <name>: <type>
output <name>: <type>
state <name>: <type> [= <value>]
timer <name>([<offset>[, <period>]])
logical action <name>[: <type>]
physical action <name>[: <type>]
reaction [<name>] (triggers) [<uses>] [-> <effects>] [{= ... body ...=}]
<instance-name> = new <class-name>([<parameter-assignments>])
<port-name> [, ...] -> <port-name> [, ...] [after <delay>]
}
```
</ShowIf>
<ShowIf py>
```lf
[main or federated] reactor <class-name> [(parameters)] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,14 @@ The general structure of a reactor definition is as follows:
timer <name>([<offset>[, <period>]])
logical action <name>[: <type>]
physical action <name>[: <type>]
[const] method <name>(parameters):<type> {= ... body ...=}
reaction [<name>] (triggers) [<uses>] [-> <effects>] [{= ... body ...=}]
<instance-name> = new <class-name>([<parameter-assignments>])
<port-name> [, ...] -> <port-name> [, ...] [after <delay>]
}
```
</ShowIf>
<ShowIf cpp rs>
<ShowIf cpp>
```lf
[main] reactor <class-name> [(parameters)] {
input <name>: <type>
Expand All @@ -116,6 +117,21 @@ The general structure of a reactor definition is as follows:
}
```
</ShowIf>
<ShowIf rs>
```lf
[main] reactor <class-name> [(parameters)] {
input <name>: <type>
output <name>: <type>
state <name>: <type> [= <value>]
timer <name>([<offset>[, <period>]])
logical action <name>[: <type>]
physical action <name>[: <type>]
reaction [<name>] (triggers) [<uses>] [-> <effects>] [{= ... body ...=}]
<instance-name> = new <class-name>([<parameter-assignments>])
<port-name> [, ...] -> <port-name> [, ...] [after <delay>]
}
```
</ShowIf>
<ShowIf py>
```lf
[main or federated] reactor <class-name> [(parameters)] {
Expand Down

0 comments on commit b4f40a6

Please sign in to comment.