2017-03-13 16:58:58 +00:00
|
|
|
# Regular Expressions for PLATYPUS
|
|
|
|
## Comments
|
|
|
|
```
|
|
|
|
L(COMMENT) = !< [^CR]*CR
|
|
|
|
```
|
|
|
|
|
|
|
|
## Keywords
|
|
|
|
```
|
|
|
|
L(KEYWORD) = PLATYPUS | IF | THEN | ELSE | USING | REPEAT | INPUT | OUTPUT
|
|
|
|
```
|
|
|
|
## Variable Identifiers
|
|
|
|
```
|
2017-03-14 19:54:47 +00:00
|
|
|
L(L) = [a-zA-Z]
|
2017-03-13 16:58:58 +00:00
|
|
|
|
2017-03-14 19:54:47 +00:00
|
|
|
L(LoD) = [a-zA-Z0-9]
|
2017-03-13 16:58:58 +00:00
|
|
|
|
|
|
|
L(VID) = AVID | SVID
|
|
|
|
|
|
|
|
L(AVID) = [a-zA-Z]([a-zA-Z0-9])*
|
|
|
|
|
|
|
|
L(SVID) = AVID#
|
|
|
|
|
|
|
|
```
|
|
|
|
## Integer Literals
|
|
|
|
```
|
2017-03-18 21:23:57 +00:00
|
|
|
L(DIL) = 0|([1-9][0-9]*)
|
2017-03-13 16:58:58 +00:00
|
|
|
|
2017-03-14 19:54:47 +00:00
|
|
|
L(NzD) = [1-9]
|
2017-03-13 16:58:58 +00:00
|
|
|
|
2017-03-14 19:54:47 +00:00
|
|
|
L(D) = [0-9]
|
2017-03-13 16:58:58 +00:00
|
|
|
|
2017-03-14 19:54:47 +00:00
|
|
|
L(OD) = [0-7]
|
2017-03-13 16:58:58 +00:00
|
|
|
|
2017-03-18 21:23:57 +00:00
|
|
|
L(OIL) = 0(0|[1-7][0-7]*)
|
2017-03-13 16:58:58 +00:00
|
|
|
|
2017-03-14 19:54:47 +00:00
|
|
|
L(IL) = (DIL | OIL)
|
2017-03-13 16:58:58 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
## Floating Point Literal
|
|
|
|
```
|
2017-03-14 19:54:47 +00:00
|
|
|
L(FLPL) = (0 | [1-9]*).[0-9]*
|
2017-03-13 16:58:58 +00:00
|
|
|
```
|
|
|
|
## String Literal
|
|
|
|
```
|
2017-03-14 19:54:47 +00:00
|
|
|
L(STRL) = "([a-ZA-Z_0-9])*"
|
2017-03-13 16:58:58 +00:00
|
|
|
```
|