From e0040b44c85a43ccb633916f8291e049e9b1dbeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oszk=C3=A1r=20Semer=C3=A1th?= Date: Mon, 4 Nov 2024 00:23:20 +0100 Subject: [PATCH] Update hw-2.langium --- src/language/hw-2.langium | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/language/hw-2.langium b/src/language/hw-2.langium index 9e1c445..19399da 100644 --- a/src/language/hw-2.langium +++ b/src/language/hw-2.langium @@ -1,18 +1,24 @@ -grammar Hw2 +grammar SmartHouse -entry Model: - (persons+=Person | greetings+=Greeting)*; +entry CPSModel : +'repository' '{' + +'}' +'market' '{' + +'}' +(cpss += CPS)+ + ; -Person: - 'person' name=ID; -Greeting: - 'Hello' person=[Person:ID] '!'; +CPS: 'cps' name = ID; + + +terminal DOUBLE returns number: /[0-9]+.[0-9]+/; +terminal INT returns number: /[0-9]+/; hidden terminal WS: /\s+/; terminal ID: /[_a-zA-Z][\w_]*/; -terminal INT returns number: /[0-9]+/; -terminal STRING: /"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/; hidden terminal ML_COMMENT: /\/\*[\s\S]*?\*\//; hidden terminal SL_COMMENT: /\/\/[^\n\r]*/;