Skip to content

permissive-water.sdf3

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module permissive-water

// Key idea: WATER is the inverse of LAYOUT

context-free syntax
  // Allow WATER on places where LAYOUT may occur
  LAYOUT.WATER = WATER

lexical sorts
  WATER
  
  WATERTOKENSTART
  WATERTOKENSEPARATOR

lexical syntax
  // Separate water regions into smaller chunks for recovery costs calculation
  WATER = WATERTOKEN
  WATER = WATERTOKENSEPARATOR

  // Allow to skip over identifier strings
        = WATERTOKENSTART [A-Za-z0-9\_]*
  WATERTOKENSTART = [A-Za-z0-9\_] {recover}

  // Allow to skip over special characters that are neither part of identifiers nor whitespace characters
  WATERTOKENSEPARATOR = ~[A-Za-z0-9\_\ \t\12\r\n\*] {recover}

lexical restrictions
  WATERTOKEN -/- [A-Za-z0-9\_]