-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb08975
commit e0040b4
Showing
1 changed file
with
15 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]*/; |