Skip to content

Commit

Permalink
Update hw-2.langium
Browse files Browse the repository at this point in the history
  • Loading branch information
OszkarSemerath authored Nov 3, 2024
1 parent cb08975 commit e0040b4
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/language/hw-2.langium
Original file line number Diff line number Diff line change
@@ -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]*/;

0 comments on commit e0040b4

Please sign in to comment.