Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
language [2018/11/01 13:31] 127.0.0.1 external edit |
language [2019/09/13 09:55] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| #+options: toc:nil | #+options: toc:nil | ||
| + | #+html: {{tag>language syntax}} | ||
| * Language | * Language | ||
| Line 11: | Line 12: | ||
| #+html: <callout type="info" icon="fa fa-code"> | #+html: <callout type="info" icon="fa fa-code"> | ||
| The /Hello World/ application specified in CASM: | The /Hello World/ application specified in CASM: | ||
| - | #+name: asdf | ||
| #+begin_src casm -n | #+begin_src casm -n | ||
| CASM | CASM | ||
| Line 17: | Line 17: | ||
| rule HelloWorld = | rule HelloWorld = | ||
| { | { | ||
| - | println( "Hello World!" ) | + | println( "Hello world!" ) |
| } | } | ||
| #+end_src | #+end_src | ||
| #+html: </callout> | #+html: </callout> | ||
| + | |||
| + | Every CASM specification starts with a [[./syntax#Header][header]] containing the keyword =CASM= (line 1). | ||
| + | The [[./syntax#Header][header]] part is followed by [[./syntax#Definitions][definitions]]. | ||
| + | In line 2 an [[./syntax#InitDefinition][init definition]] is specified to set the starting rule of the single execution agent to the rule named =HelloWorld=. | ||
| + | The rule =HelloWorld= is defined in line 3 ranging to line 6 through a [[./syntax#RuleDefinition][rule definition]]. | ||
| + | Notice that CASM does not require symbol names to be declared before usage. | ||
| + | Inside the =HelloWorld= rule a [[./syntax#BlockRule][block rule]] creates a parallel execution semantics scope (line 4, 6). | ||
| + | Last but not least the actual statement to print out the =Hello world!= string defined by a [[./syntax#CallRule][call rule]] to a built-in function named =println=. | ||
| + | |||
| + | CASM does not require any newlines, tabulators, or statement separators like in other specification or programming languages. | ||
| + | |||
| + | |||
| + | TBA | ||
| + | |||
| + | ** Functions | ||
| + | |||
| + | TBA | ||
| + | |||
| + | # #+html: <callout type="info" icon="fa fa-code"> | ||
| + | # The following example defines a binary function named =phoneBook= with a | ||
| + | # given type relation $x : String * String \rightarrow String$ to store | ||
| + | # telephone number strings identified by a last and first name string: | ||
| + | # #+begin_src casm | ||
| + | # function phoneBook : String * String -> String | ||
| + | # #+end_src | ||
| + | # #+html: </callout> | ||
| + | |||
| + | |||
| + | ** Rules | ||
| + | |||
| + | TBA | ||
| + | |||
| + | ** Initialization | ||
| + | |||
| + | TBA | ||
| + | |||
| + | ** Comments | ||
| + | |||
| + | TBA | ||
| + | |||