Skip to content

Commit

Permalink
Add while to bnf
Browse files Browse the repository at this point in the history
  • Loading branch information
Saverio976 committed Jan 14, 2024
1 parent d2d17aa commit 14f5dfd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/BNF.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<parameter> ::= <identifier> ": " <type>
<type> ::= <upperLetter> <char2>
<instruction> ::= <instructionIns> ";\n"
<instructionIns> ::= <declaration> | <assignment> | <functionCall> | <return> | <condition>
<instructionIns> ::= <declaration> | <assignment> | <functionCall> | <return> | <condition> | <while>
<declaration> ::= "@" <type> " " <identifier> " = " <value>
<assignment> ::= <identifier> " = " <value>
<functionCall> ::= <identifier> "(" <varParamList>* ")"
Expand All @@ -39,6 +39,7 @@
<conditionIfElse> ::= <conditionIf> <conditionElse>
<conditionIf> ::= "if (" <value> ")\n{\n" <instruction>* "}\n"
<conditionElse> ::= "else\n{\n" <instruction>* "}\n"
<while> ::= "while (" <value> ")\n{\n" <instruction>* "}\n"
<character> ::= "'" <char1> "'"
<bool> ::= "True" | "False"
Expand Down

0 comments on commit 14f5dfd

Please sign in to comment.