Sintaxe do HMDES


<block> ::=

{#include <identifier>} <variable declaration part> <statement part>


<variable declaration part> ::=

< empty> | {$def  !<variable identifier>  <integer_constant> | <variable identifier> | <alias identifier>}




<statement part> ::=

<empty>| <compound statement>

<compound statement> ::=

SECTION <identifier> { <statement>{ <statement> } }

<statement> ::=

<simple statement> | <structured statement>


<simple statement> ::=

<assignment statement>

<assignment statement> ::=

<variable> = <expression>




<structured statement> ::=

<static rotating constant> | <if statement> | <while statement> | <for statement> | <function statement>;

<if statement> ::=

if (<expression>)  <statement> | if (<expression>) <statement> else <statement>

<while statement> ::=

while (<expression>)  <statement>

<for statement> ::=

for (<identifier> in $<integer constant> .. (<expression>)) {{<static rotating constant>;}}

<function statement> ::=

<parameter>::=

<identifier> (<parameter> {<parameter>})

<empty> | <for statement> | <function statement> | <constant identifier> | <static for> | <integer constant>| <alias identifier>


<expression> ::=

<simple expression> |  <simple expression> <relational operator> <simple expression>

<simple expression> ::=

<sign> <term2> { <adding operator> <term2> }

<term2> ::=

<term> { <multiplying operator> <term> }

<term> ::=

<factor> { <logical operator> <factor> }

<factor> ::=

<variable> | <constant> | <alias> |( <expression> )


<relational operator> ::=

== | != | < | <= | >= | > | || | &&

<sign> ::=

+ | - | <empty>

<adding operator> ::=

+ | -

<multiplying logical operator> ::=

* | /

<logical operator> ::=

<< | >>


<variable> ::=

<entire variable>

<array variable> ::=

<entire variable>

<entire variable> ::=

<variable identifier>

<variable identifier> ::=

<identifier>


<alias> ::= ${<variable>}


<constant> ::=

<integer constant> | <character constant> | <constant identifier>

<constant identifier> ::=

<identifier>

<identifier> ::=

<letter> { <letter or digit> }

<letter or digit> ::=

<letter> | <digit>

<integer constant> ::=

<digit> { <digit> }

<character constant> ::=

‘<letter or digit>’  |  ‘’<letter or digit> {<letter or digit>}’’

<static_rotating_constant> ::=

<constant identifier> <static for> | <constant for>()

<static for>::=

<constant for>::=

${<constant identifier>}

[${<constant identifier>}]

<alias identifier>::=

$={<expression>}

<letter> ::=

a | b | c | d | e | f | g | h | i | j | k | l | m | n | o |
p | q | r | s | t | u | v | w | x | y | z | A | B | C |
D | E | F | G | H | I | J | K | L | M | N | O | P
| Q | R | S | T | W | V | W | X | Y | Z | _

<digit> ::=

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

<special symbol> ::=

+ | - | * | = | <> | < | > | <= | >= | != | || | && | ( | ) | [ | ] | := | / | %| . | , | { | }| ; | : | += | ++| --| # | include | if | else | while | do | char | integer | boolean | SECTION | for | in | .. | $def | CREATE | LINK | REQUIRED | width | static | rotating | vector | speculative | INT | STRING