-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtvkl.gram
More file actions
47 lines (46 loc) · 1.96 KB
/
tvkl.gram
File metadata and controls
47 lines (46 loc) · 1.96 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# =============================================================================
# TVKL — Terminal Virtual Keyboard Layout
# =============================================================================
#
# -----------------------------------------------------------------------------
# SYMBOL LEGEND (EBNF META-SYNTAX)
# -----------------------------------------------------------------------------
#
# ::= Production rule definition
# | Alternation (logical OR)
# {} Zero or more repetitions
# [] Optional (0 or 1 occurrence)
# "" Literal terminal string
#
# =============================================================================
# FORMAL GRAMMAR
# =============================================================================
tvkl ::= { declaration } EOF ;
declaration ::= assign
| line ;
assign ::= ident "=" value ;
ident ::= "#" name ;
value ::= number
| color
| ident ;
color ::= "@" "(" color_param "," color_param "," color_param ")" ;
color_param ::= number | ident ;
line ::= ":" "|" { item "|" } "-" ;
item ::= bind_list [ attr_decl ] ;
bind_list ::= bind { "," bind } ;
bind ::= key_name [ metadata ] ;
metadata ::= "{" quoted_name "}" ;
attr_decl ::= "[" [ attr ] { "," [ attr ] } "]" ;
attr ::= number
| color
| ident ;
key_name ::= quoted_name
| name ;
quoted_name ::= "'" name_char2 "'"
| '"' name_char2 '"' ;
number ::= "$" num ;
name ::= name_char { name_char } ;
name_char ::= ? any character except whitespace, "|", ":", "-", "[", "]", "{", "}", ",", "=", "#", "@" ? ;
name_char2 ::= ? any chararcter except corresponding quotation marks ? ;
num ::= digit { digit } ;
digit ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;