Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
language:langs:chp [2024/07/20 16:36] – [Advanced expression syntax] rajit | language:langs:chp [2025/05/23 11:56] (current) – [Syntactic replication] rajit | ||
---|---|---|---|
Line 307: | Line 307: | ||
<code act> | <code act> | ||
[ v = 0 -> x := x - v | [ v = 0 -> x := x - v | ||
- | [] ( [] i : 3 : v = i+2 -> x := x + i | + | [] ( [] i : 3 : v = i+2 -> x := x + i ) |
] | ] | ||
</ | </ | ||
Line 330: | Line 330: | ||
</ | </ | ||
where '' | where '' | ||
+ | |||
+ | ===== Debugging and other support functions for simulation ===== | ||
+ | |||
+ | When running CHP simulations, | ||
+ | |||
+ | <code act> | ||
+ | ... | ||
+ | chp { | ||
+ | ... | ||
+ | log (" | ||
+ | ... | ||
+ | } | ||
+ | </ | ||
+ | The statement above will display '' | ||
+ | |||
+ | <code act> | ||
+ | int x; | ||
+ | ... | ||
+ | chp { | ||
+ | ... | ||
+ | log (" | ||
+ | log ("%x This is hex: ", x+3); | ||
+ | log ("%b This is binary", | ||
+ | ... | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Booleans are displayed as integers, with '' | ||
+ | |||
+ | Other support functions of this type are: | ||
+ | * '' | ||
+ | * '' | ||
+ | * In the standard '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | |||
====== The chp-txt sublanguage ====== | ====== The chp-txt sublanguage ====== |