Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settle on first definite grammar version for production #2

Merged
merged 7 commits into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions Emoji-Bedeutung-v2-+-Aufgaben-+-Codebeispiele.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ X in Variable speichern.

# Ausgabe
- πŸ’¬ // Textausgabe
- πŸ”Š / πŸ“’ // Tonausgabe
- πŸ€– πŸ”Š // Text2Speech
- πŸ”Š / πŸ“’ // Tonausgabe - was heißt "Tonausgabe"?
- πŸ€– // Text2Speech
- πŸ“‘ // Broadcast: Nachricht an alle senden

## Codebeispiel
Expand All @@ -28,11 +28,10 @@ X aus Variable auf unterschiedliche Art ausgeben.
```
πŸ—ƒοΈ ➑️ πŸ’¬
πŸ—ƒοΈ ➑️ πŸ”Š
πŸ—ƒοΈ ➑️ πŸ€– πŸ”Š
πŸ—ƒοΈ ➑️ πŸ€–
πŸ—ƒοΈ ➑️ πŸ“’
πŸ—ƒοΈ ➑️ πŸ“‘
```

# Datenspeicherung
Ein Typ von Variable.
Keine Unterscheidung zwischen Datentypen & Anzahl der gespeicherten Elemente.
Expand Down Expand Up @@ -173,4 +172,6 @@ x == string ? if true: loop: {

---
Wenn πŸ”€ leer ist, dann hat die Ausgabe ein beispielsweise leeres Blatt Papier.
ABER es gibt eine Ausgabe!
ABER es gibt eine Ausgabe!


4 changes: 3 additions & 1 deletion backlog-an-moeglichen-emojis.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,6 @@ Sorg dafΓΌr, dass du deinem Roboter den Namen eines Klassenkameraden und eine Gr

πŸ‘Ž:
πŸ”€ ➑️ πŸ’¬ // ("Dieser Name ist nicht in der Klassenliste")
```
```

:loud_sound:
107 changes: 107 additions & 0 deletions emoji-grammar.ohm
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
Emoji {
Functionality = Functionality+ | Input | Output | Condition | Variable | Loop

/*
* INPUT
*/
Input
= Input_Emoji+ Arrow_Right Variable_Emoji -- No_Type
| (Input_Emoji (Type_Numeric_Emoji | Type_String_Emoji) Type_Required_Emoji ?)+ Arrow_Right Variable_Emoji -- Type_Required

Input_Emoji = ":memo:" | "πŸ“" | ":microphone:" | "🎀" | ":microphone_studio:" | "πŸŽ™οΈ" | ":camera_with_flash:" | "πŸ“Έ" | ":camera:" | "πŸ“·" | ":framed_picture:" | "πŸ–ΌοΈ"

/*
* OUTPUT
*/
Output
= Variable_Emoji Arrow_Right Output_Emoji -- From_Variable
| Output_Emoji String -- From_String

Output_Emoji = ":speech:" | "πŸ’¬" | ":loud_sound:" | "πŸ”Š" | ":megaphone:" | "πŸ“’" | ":robot:" | "πŸ€–" | ":satellite:" | "πŸ“‘"

/*
* VARIABLE
*/
Variable
= Variable_Emoji Arrow_Left Input_Emoji+ -- Normal
// "Random_String" bislang deaktiviert
| Random_Number Arrow_Right Variable_Emoji -- Right_Side_Add_Random_Value
| Variable_Emoji Arrow_Left Random_Number -- Left_Side_Add_Random_Value
| Variable_Emoji -- Empty


Variable_Emoji = ":cardfilebox:" | "πŸ—ƒοΈ"

/*
* CONDITION
*/
Condition = Compare_Value Compare_Operator_Emoji Compare_Value Condition_Identifier_Emoji (Condition_Flow | end)
Condition_Flow
= (Condition_True_Emoji Functionality Condition_False_Emoji Functionality | Condition_False_Emoji Functionality Condition_True_Emoji Functionality) -- Double_Path
| (Condition_True_Emoji | Condition_False_Emoji) Functionality -- Single_Path
| (Condition_True_Emoji | Condition_False_Emoji) -- Empty_Path

Condition_Identifier_Emoji = ":question:" | "❓"
Condition_True_Emoji = ":thumbs_up:" | "πŸ‘"
Condition_False_Emoji = ":thumbs_down:" | "πŸ‘Ž"

Compare_Operator_Emoji
= ":balance_scale:" | "βš–οΈ"
| ":equals:" | "="
|":chart_with_downwards_trend:"
| "πŸ“‰" | ":chart_with_upwards_trend:"
| "πŸ“ˆ"

// Begriffe in [] beziehen sich auf Variablen
// Wird ggf. separiert werden mΓΌssen
Compare_Value = Variable_Emoji | Compare_Value_Emoji

Compare_Value_Emoji
= "[NOT_EMPTY]" | "[EMPTY]"
| "[FIRST]" | "[MIDDLE]" | "[LAST]"

/*
* LOOP
*/
Loop
= Loop_Emoji Integer Functionality -- Timed_Loop
| Loop_Emoji Condition Condition_Flow -- Condition_Loop
| Loop_Emoji (Integer | Condition) -- Empty_Loop

Loop_Emoji = ":repeat:" | "πŸ”"

/*
* HELPERS
*/
Arrow_Right = ":arrow_right:" | "➑️"
Arrow_Left = ":arrow_left:" | "⬅️"

Random_Number = Random_Emoji Type_Numeric_Emoji Type_Numeric_Emoji ?
// Wie wΓΌrde "Random_String" aussehen? Was wΓΌrde passieren?
Random_String = Random_Emoji Type_String_Emoji
Random_Emoji = ":twisted_rightwards_arrows:" | "πŸ”€"

/*
* TYPES
*/
Type_Required_Emoji = ":exclamation:" | "❗"

Type_Numeric_Emoji = ":1234:" | "πŸ”’"
Type_String_Emoji = ":abc:" | "πŸ”€"

String
= "\"" (alnum | specialCharacters)* "\"" -- Double_Quoutes
| (alnum | specialCharacters)* -- No_Double_Quoutes

Integer = number+

Letters = letter+
specialCharacters = "!" | "?" | "<" | ">" | "Β§" | "$" | "&" | "/" | "," | ";" | "." | ":" | "_" | "#" | "'" | "~" | "|" | "^" | "β€²"

ident (an identifier)
= letter alnum*

number (a number)
= digit* "." digit+ -- fract
| digit+ -- whole
}
187 changes: 187 additions & 0 deletions examples.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
[
{
"text": "πŸ“ ➑️ πŸ—ƒοΈ\nπŸ“· ➑️ πŸ—ƒοΈ\n🎀 ➑️ πŸ—ƒοΈ\nπŸŽ™οΈ ➑️ πŸ—ƒοΈ\nπŸ–ΌοΈ ➑️ πŸ—ƒοΈ",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ“πŸ”’β—βž‘οΈ πŸ—ƒοΈ",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ“πŸ”€β—βž‘οΈ πŸ—ƒοΈ",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ“πŸ”’β— πŸ“πŸ”’β— ➑️ πŸ—ƒοΈ",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ”€ πŸ”’ ➑️ πŸ—ƒοΈ\n\nπŸ”€ πŸ”’ πŸ”’ ➑️ πŸ—ƒοΈ",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ—ƒοΈ ➑️ πŸ’¬",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ“πŸ”’β— πŸ“πŸ”€β— ➑️ πŸ—ƒοΈ",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ“πŸ”€β— πŸ“πŸ”€β— ➑️ πŸ—ƒοΈ",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ“πŸ”€β— πŸ“πŸ”’β— ➑️ πŸ—ƒοΈ\n",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ’¬ \"Richtig geraten!\"",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ”\n πŸ—ƒοΈ βš–οΈ πŸ—ƒοΈ ❓\n πŸ‘\n πŸ’¬ \"Richtig geraten!\"\n πŸ‘Ž\n πŸ’¬ \"Falsch geraten!\"",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ’¬ \"Richtig geraten\"",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ’¬ \"123\"\n",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ’¬ \"abc 123\"",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ’¬ \"123 abc\"",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ’¬ \"!123 abc!\"",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ’¬ \"123! abc!\"",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ”\n πŸ—ƒοΈ βš–οΈ πŸ—ƒοΈ ❓",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ”\n πŸ—ƒοΈ βš–οΈ πŸ—ƒοΈ ❓ πŸ‘ πŸ’¬ \"Richtig geraten!\"",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ”\n πŸ—ƒοΈ βš–οΈ πŸ—ƒοΈ ❓\n πŸ‘ ",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ”\n πŸ—ƒοΈ βš–οΈ πŸ—ƒοΈ ❓\n πŸ‘Ž",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ”\n πŸ—ƒοΈ βš–οΈ πŸ—ƒοΈ ❓\n πŸ‘Ž\n πŸ’¬ \"Falsch geraten!\"\n πŸ‘\n πŸ’¬ \"Richtig geraten!\"",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ”\n πŸ—ƒοΈ βš–οΈ πŸ—ƒοΈ ❓\n πŸ‘Ž \n πŸ’¬ \"Soll funktionieren!\"",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ“πŸ“πŸ“ ➑️ πŸ—ƒοΈ",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ” 10\n πŸ—ƒοΈ ➑️ πŸ’¬ ",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ” 10",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ’¬ \"Gib einen Text ein\"\n\nπŸ“ ➑️ πŸ—ƒοΈ\n\nπŸ” 10\n πŸ—ƒοΈ ➑️ πŸ’¬ ",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ—ƒοΈ βš–οΈ πŸ—ƒοΈ ❓ \n",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ—ƒοΈ βš–οΈ πŸ—ƒοΈ ❓\n πŸ‘\n πŸ’¬ \"Richtig geraten!\"",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ—ƒοΈ βš–οΈ πŸ—ƒοΈ ❓ \n πŸ‘",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ—ƒοΈ",
"startRule": "",
"shouldMatch": true
},
{
"text": "πŸ—ƒοΈ\n\nπŸ—ƒοΈ βš–οΈ [EMPTY] ❓\n πŸ‘\n πŸ“ ➑️ πŸ—ƒοΈ \n \n[EMPTY] βš–οΈ πŸ—ƒοΈ ❓\n πŸ‘\n πŸ“ ➑️ πŸ—ƒοΈ ",
"startRule": "",
"shouldMatch": true
},
{
"text": "\nπŸ”€ πŸ”’ πŸ”’ πŸ”’ ➑️ πŸ—ƒοΈ\n",
"startRule": "",
"shouldMatch": false
},
{
"text": "πŸ”€ πŸ”’ πŸ”€ ➑️ πŸ—ƒοΈ\n",
"startRule": "",
"shouldMatch": false
},
{
"text": "πŸ”€ πŸ”€ πŸ”’ ➑️ πŸ—ƒοΈ\n",
"startRule": "",
"shouldMatch": false
},
{
"text": "πŸ”€ πŸ”€ πŸ”€ ➑️ πŸ—ƒοΈ",
"startRule": "",
"shouldMatch": false
},
{
"text": "πŸ”€ πŸ”€ ➑️ πŸ—ƒοΈ",
"startRule": "",
"shouldMatch": false
}
]
Loading