]> git.sur5r.net Git - i3/i3/blob - parser-specs/config.spec
75c07232d01337a55001e115cb598ff6d572a593
[i3/i3] / parser-specs / config.spec
1 # vim:ts=2:sw=2:expandtab
2 #
3 # i3 - an improved dynamic tiling window manager
4 # © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
5 #
6 # parser-specs/config.spec: Specification file for generate-command-parser.pl
7 # which will generate the appropriate header files for our C parser.
8 #
9 # Use :source highlighting.vim in vim to get syntax highlighting
10 # for this file.
11
12 # TODO: get it to parse the default config :)
13 # TODO: comment handling (on their own line, at the end of a line)
14
15 state INITIAL:
16   # We have an end token here for all the commands which just call some
17   # function without using an explicit 'end' token.
18   end ->
19   #'[' -> call cmd_criteria_init(); CRITERIA
20   'font' -> FONT
21   'mode' -> MODENAME
22   exectype = 'exec_always', 'exec'
23       -> EXEC
24
25 # <exec|exec_always> [--no-startup-id] command
26 state EXEC:
27   no_startup_id = '--no-startup-id'
28       ->
29   command = string
30       -> call cfg_exec($exectype, $no_startup_id, $command)
31
32 state MODENAME:
33   modename = word
34       -> call cfg_enter_mode($modename); MODEBRACE
35
36 state MODEBRACE:
37   '{'
38       -> MODE
39
40 state MODE:
41   bindtype = 'bindsym', 'bindcode'
42       -> MODE_BINDING
43   '}'
44       -> INITIAL
45
46 state MODE_BINDING:
47   modifiers = 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5', 'Shift', 'Control'
48       ->
49   '+'
50       ->
51   key = word
52       -> MODE_BINDCOMMAND
53
54 state MODE_BINDCOMMAND:
55   command = string
56       -> call cfg_mode_binding($bindtype, $modifiers, $key, $command); MODE
57
58 state FONT:
59   font = string
60       -> call cfg_font($font)