keyboardlayouteditor

[Fork] Archive of the keyboard layout editor.
git clone https://git.jojolepro.com/keyboardlayouteditor.git
Log | Files | Refs | README | LICENSE

commit 352b89cb328bc1ca15969490127e0a405d706fbe
parent 9699784811645e771bd1d2dc898bda96d06efa79
Author: simos.lists <simos.lists@70737e48-4f4a-0410-8df8-290828ad50c4>
Date:   Wed, 21 May 2008 01:40:23 +0000

Now  override key  works, also keypad_keys is fine.

git-svn-id: http://keyboardlayouteditor.googlecode.com/svn/trunk@30 70737e48-4f4a-0410-8df8-290828ad50c4

Diffstat:
MXKBGrammar/XKBGrammar.g | 6++++--
MXKBGrammar/XKBGrammar.tokens | 79++++++++++++++++++++++++++++++++++++++++++-------------------------------------
MXKBGrammar/XKBGrammarLexer.py | 791++++++++++++++++++++++++++++++++++++++++++++-----------------------------------
MXKBGrammar/XKBGrammarLexer.pyc | 0
MXKBGrammar/XKBGrammarParser.py | 704+++++++++++++++++++++++++++++++++++++++++--------------------------------------
MXKBGrammar/XKBGrammarParser.pyc | 0
MXKBGrammar/XKBGrammarWalker.g | 3++-
MXKBGrammar/check_xkb.py | 10+++++++---
MXKBGrammar/gr | 4++--
9 files changed, 867 insertions(+), 730 deletions(-)

diff --git a/XKBGrammar/XKBGrammar.g b/XKBGrammar/XKBGrammar.g @@ -33,6 +33,7 @@ tokens VALUE; STATE; KEYSYMGROUP; + OVERRIDE; } // We cover XKB symbol files that look like @@ -90,8 +91,8 @@ line_keytype ; line_key - : 'key' keycode keysyms - -> ^(TOKEN_KEY keycode keysyms) + : override='override'? 'key' keycode keysyms + -> ^(TOKEN_KEY ^(OVERRIDE $override)? keycode keysyms) ; line_modifier_map @@ -119,6 +120,7 @@ mapOptions | 'hidden' | 'partial' | 'alphanumeric_keys' + | 'keypad_keys' | 'modifier_keys' | 'alternate_group' | 'xkb_symbols' diff --git a/XKBGrammar/XKBGrammar.tokens b/XKBGrammar/XKBGrammar.tokens @@ -1,6 +1,5 @@ T__29=29 T__28=28 -T__27=27 MAPOPTIONS=13 TOKEN_INCLUDE=4 TOKEN_MODIFIER_MAP=9 @@ -8,15 +7,18 @@ TOKEN_TYPE=8 MAPTYPE=11 T__55=55 T__56=56 -NAME=23 +T__57=57 +NAME=24 +T__58=58 T__51=51 T__52=52 MAPMATERIAL=14 T__53=53 T__54=54 +T__59=59 KEYSYMS=18 -COMMENT=25 -DQSTRING=22 +COMMENT=26 +DQSTRING=23 T__50=50 T__42=42 T__43=43 @@ -28,7 +30,7 @@ T__47=47 T__44=44 SECTION=15 T__45=45 -LINE_COMMENT=26 +LINE_COMMENT=27 KEYCODE=16 T__48=48 T__49=49 @@ -38,46 +40,49 @@ LAYOUT=10 T__30=30 T__31=31 T__32=32 -WS=24 +WS=25 T__33=33 T__34=34 T__35=35 T__36=36 T__37=37 +OVERRIDE=22 T__38=38 T__39=39 KEYSYMGROUP=21 -TOKEN_KEY=7 MAPNAME=12 +TOKEN_KEY=7 TOKEN_KEY_TYPE=5 KEYCODEX=17 -'alphanumeric_keys'=45 -'Shift'=49 -'alternate_group'=47 -'Mod3'=54 -'type'=41 -'>'=40 -'include'=30 -'hidden'=43 -';'=29 -'Mod1'=52 -'='=34 -'Mod5'=56 -'xkb_symbols'=48 -'}'=28 -'Control'=50 -'key'=36 -'partial'=44 -'{'=27 -'modifier_keys'=46 -'Mod4'=55 -'Mod2'=53 -'<'=39 -'key.type'=35 -'['=32 -'name'=31 -','=38 -'modifier_map'=37 -'default'=42 -']'=33 -'Lock'=51 +'alphanumeric_keys'=47 +'Shift'=52 +'alternate_group'=50 +'Mod3'=57 +'type'=43 +'>'=42 +'include'=31 +'hidden'=45 +';'=30 +'Mod1'=55 +'='=35 +'Mod5'=59 +'xkb_symbols'=51 +'keypad_keys'=48 +'}'=29 +'Control'=53 +'override'=37 +'key'=38 +'partial'=46 +'{'=28 +'modifier_keys'=49 +'Mod4'=58 +'Mod2'=56 +'key.type'=36 +'<'=41 +'['=33 +'name'=32 +','=40 +'modifier_map'=39 +'default'=44 +']'=34 +'Lock'=54 diff --git a/XKBGrammar/XKBGrammarLexer.py b/XKBGrammar/XKBGrammarLexer.py @@ -1,4 +1,4 @@ -# $ANTLR 3.1b1 XKBGrammar.g 2008-05-20 22:51:09 +# $ANTLR 3.1b1 XKBGrammar.g 2008-05-21 02:16:01 import sys from antlr3 import * @@ -11,7 +11,6 @@ HIDDEN = BaseRecognizer.HIDDEN # token types T__29=29 T__28=28 -T__27=27 MAPOPTIONS=13 TOKEN_INCLUDE=4 TOKEN_MODIFIER_MAP=9 @@ -20,15 +19,18 @@ TOKEN_TYPE=8 MAPTYPE=11 T__55=55 T__56=56 -NAME=23 +T__57=57 +T__58=58 +NAME=24 T__51=51 T__52=52 T__53=53 MAPMATERIAL=14 T__54=54 +T__59=59 KEYSYMS=18 -COMMENT=25 -DQSTRING=22 +COMMENT=26 +DQSTRING=23 T__50=50 T__42=42 T__43=43 @@ -40,7 +42,7 @@ T__47=47 T__44=44 SECTION=15 T__45=45 -LINE_COMMENT=26 +LINE_COMMENT=27 KEYCODE=16 T__48=48 T__49=49 @@ -51,16 +53,17 @@ T__30=30 T__31=31 T__32=32 T__33=33 -WS=24 +WS=25 T__34=34 T__35=35 T__36=36 T__37=37 T__38=38 +OVERRIDE=22 T__39=39 KEYSYMGROUP=21 -MAPNAME=12 TOKEN_KEY=7 +MAPNAME=12 TOKEN_KEY_TYPE=5 KEYCODEX=17 @@ -90,31 +93,6 @@ class XKBGrammarLexer(Lexer): - # $ANTLR start T__27 - def mT__27(self, ): - - try: - _type = T__27 - _channel = DEFAULT_CHANNEL - - # XKBGrammar.g:7:7: ( '{' ) - # XKBGrammar.g:7:9: '{' - self.match(123) - - - - - self._state.type = _type - self._state.channel = _channel - - finally: - - pass - - # $ANTLR end T__27 - - - # $ANTLR start T__28 def mT__28(self, ): @@ -122,9 +100,9 @@ class XKBGrammarLexer(Lexer): _type = T__28 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:8:7: ( '}' ) - # XKBGrammar.g:8:9: '}' - self.match(125) + # XKBGrammar.g:7:7: ( '{' ) + # XKBGrammar.g:7:9: '{' + self.match(123) @@ -147,9 +125,9 @@ class XKBGrammarLexer(Lexer): _type = T__29 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:9:7: ( ';' ) - # XKBGrammar.g:9:9: ';' - self.match(59) + # XKBGrammar.g:8:7: ( '}' ) + # XKBGrammar.g:8:9: '}' + self.match(125) @@ -172,9 +150,9 @@ class XKBGrammarLexer(Lexer): _type = T__30 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:10:7: ( 'include' ) - # XKBGrammar.g:10:9: 'include' - self.match("include") + # XKBGrammar.g:9:7: ( ';' ) + # XKBGrammar.g:9:9: ';' + self.match(59) @@ -197,9 +175,9 @@ class XKBGrammarLexer(Lexer): _type = T__31 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:11:7: ( 'name' ) - # XKBGrammar.g:11:9: 'name' - self.match("name") + # XKBGrammar.g:10:7: ( 'include' ) + # XKBGrammar.g:10:9: 'include' + self.match("include") @@ -222,9 +200,9 @@ class XKBGrammarLexer(Lexer): _type = T__32 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:12:7: ( '[' ) - # XKBGrammar.g:12:9: '[' - self.match(91) + # XKBGrammar.g:11:7: ( 'name' ) + # XKBGrammar.g:11:9: 'name' + self.match("name") @@ -247,9 +225,9 @@ class XKBGrammarLexer(Lexer): _type = T__33 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:13:7: ( ']' ) - # XKBGrammar.g:13:9: ']' - self.match(93) + # XKBGrammar.g:12:7: ( '[' ) + # XKBGrammar.g:12:9: '[' + self.match(91) @@ -272,9 +250,9 @@ class XKBGrammarLexer(Lexer): _type = T__34 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:14:7: ( '=' ) - # XKBGrammar.g:14:9: '=' - self.match(61) + # XKBGrammar.g:13:7: ( ']' ) + # XKBGrammar.g:13:9: ']' + self.match(93) @@ -297,9 +275,9 @@ class XKBGrammarLexer(Lexer): _type = T__35 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:15:7: ( 'key.type' ) - # XKBGrammar.g:15:9: 'key.type' - self.match("key.type") + # XKBGrammar.g:14:7: ( '=' ) + # XKBGrammar.g:14:9: '=' + self.match(61) @@ -322,9 +300,9 @@ class XKBGrammarLexer(Lexer): _type = T__36 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:16:7: ( 'key' ) - # XKBGrammar.g:16:9: 'key' - self.match("key") + # XKBGrammar.g:15:7: ( 'key.type' ) + # XKBGrammar.g:15:9: 'key.type' + self.match("key.type") @@ -347,9 +325,9 @@ class XKBGrammarLexer(Lexer): _type = T__37 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:17:7: ( 'modifier_map' ) - # XKBGrammar.g:17:9: 'modifier_map' - self.match("modifier_map") + # XKBGrammar.g:16:7: ( 'override' ) + # XKBGrammar.g:16:9: 'override' + self.match("override") @@ -372,9 +350,9 @@ class XKBGrammarLexer(Lexer): _type = T__38 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:18:7: ( ',' ) - # XKBGrammar.g:18:9: ',' - self.match(44) + # XKBGrammar.g:17:7: ( 'key' ) + # XKBGrammar.g:17:9: 'key' + self.match("key") @@ -397,9 +375,9 @@ class XKBGrammarLexer(Lexer): _type = T__39 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:19:7: ( '<' ) - # XKBGrammar.g:19:9: '<' - self.match(60) + # XKBGrammar.g:18:7: ( 'modifier_map' ) + # XKBGrammar.g:18:9: 'modifier_map' + self.match("modifier_map") @@ -422,9 +400,9 @@ class XKBGrammarLexer(Lexer): _type = T__40 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:20:7: ( '>' ) - # XKBGrammar.g:20:9: '>' - self.match(62) + # XKBGrammar.g:19:7: ( ',' ) + # XKBGrammar.g:19:9: ',' + self.match(44) @@ -447,9 +425,9 @@ class XKBGrammarLexer(Lexer): _type = T__41 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:21:7: ( 'type' ) - # XKBGrammar.g:21:9: 'type' - self.match("type") + # XKBGrammar.g:20:7: ( '<' ) + # XKBGrammar.g:20:9: '<' + self.match(60) @@ -472,9 +450,9 @@ class XKBGrammarLexer(Lexer): _type = T__42 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:22:7: ( 'default' ) - # XKBGrammar.g:22:9: 'default' - self.match("default") + # XKBGrammar.g:21:7: ( '>' ) + # XKBGrammar.g:21:9: '>' + self.match(62) @@ -497,9 +475,9 @@ class XKBGrammarLexer(Lexer): _type = T__43 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:23:7: ( 'hidden' ) - # XKBGrammar.g:23:9: 'hidden' - self.match("hidden") + # XKBGrammar.g:22:7: ( 'type' ) + # XKBGrammar.g:22:9: 'type' + self.match("type") @@ -522,9 +500,9 @@ class XKBGrammarLexer(Lexer): _type = T__44 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:24:7: ( 'partial' ) - # XKBGrammar.g:24:9: 'partial' - self.match("partial") + # XKBGrammar.g:23:7: ( 'default' ) + # XKBGrammar.g:23:9: 'default' + self.match("default") @@ -547,9 +525,9 @@ class XKBGrammarLexer(Lexer): _type = T__45 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:25:7: ( 'alphanumeric_keys' ) - # XKBGrammar.g:25:9: 'alphanumeric_keys' - self.match("alphanumeric_keys") + # XKBGrammar.g:24:7: ( 'hidden' ) + # XKBGrammar.g:24:9: 'hidden' + self.match("hidden") @@ -572,9 +550,9 @@ class XKBGrammarLexer(Lexer): _type = T__46 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:26:7: ( 'modifier_keys' ) - # XKBGrammar.g:26:9: 'modifier_keys' - self.match("modifier_keys") + # XKBGrammar.g:25:7: ( 'partial' ) + # XKBGrammar.g:25:9: 'partial' + self.match("partial") @@ -597,9 +575,9 @@ class XKBGrammarLexer(Lexer): _type = T__47 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:27:7: ( 'alternate_group' ) - # XKBGrammar.g:27:9: 'alternate_group' - self.match("alternate_group") + # XKBGrammar.g:26:7: ( 'alphanumeric_keys' ) + # XKBGrammar.g:26:9: 'alphanumeric_keys' + self.match("alphanumeric_keys") @@ -622,9 +600,9 @@ class XKBGrammarLexer(Lexer): _type = T__48 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:28:7: ( 'xkb_symbols' ) - # XKBGrammar.g:28:9: 'xkb_symbols' - self.match("xkb_symbols") + # XKBGrammar.g:27:7: ( 'keypad_keys' ) + # XKBGrammar.g:27:9: 'keypad_keys' + self.match("keypad_keys") @@ -647,9 +625,9 @@ class XKBGrammarLexer(Lexer): _type = T__49 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:29:7: ( 'Shift' ) - # XKBGrammar.g:29:9: 'Shift' - self.match("Shift") + # XKBGrammar.g:28:7: ( 'modifier_keys' ) + # XKBGrammar.g:28:9: 'modifier_keys' + self.match("modifier_keys") @@ -672,9 +650,9 @@ class XKBGrammarLexer(Lexer): _type = T__50 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:30:7: ( 'Control' ) - # XKBGrammar.g:30:9: 'Control' - self.match("Control") + # XKBGrammar.g:29:7: ( 'alternate_group' ) + # XKBGrammar.g:29:9: 'alternate_group' + self.match("alternate_group") @@ -697,9 +675,9 @@ class XKBGrammarLexer(Lexer): _type = T__51 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:31:7: ( 'Lock' ) - # XKBGrammar.g:31:9: 'Lock' - self.match("Lock") + # XKBGrammar.g:30:7: ( 'xkb_symbols' ) + # XKBGrammar.g:30:9: 'xkb_symbols' + self.match("xkb_symbols") @@ -722,9 +700,9 @@ class XKBGrammarLexer(Lexer): _type = T__52 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:32:7: ( 'Mod1' ) - # XKBGrammar.g:32:9: 'Mod1' - self.match("Mod1") + # XKBGrammar.g:31:7: ( 'Shift' ) + # XKBGrammar.g:31:9: 'Shift' + self.match("Shift") @@ -747,9 +725,9 @@ class XKBGrammarLexer(Lexer): _type = T__53 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:33:7: ( 'Mod2' ) - # XKBGrammar.g:33:9: 'Mod2' - self.match("Mod2") + # XKBGrammar.g:32:7: ( 'Control' ) + # XKBGrammar.g:32:9: 'Control' + self.match("Control") @@ -772,9 +750,9 @@ class XKBGrammarLexer(Lexer): _type = T__54 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:34:7: ( 'Mod3' ) - # XKBGrammar.g:34:9: 'Mod3' - self.match("Mod3") + # XKBGrammar.g:33:7: ( 'Lock' ) + # XKBGrammar.g:33:9: 'Lock' + self.match("Lock") @@ -797,9 +775,9 @@ class XKBGrammarLexer(Lexer): _type = T__55 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:35:7: ( 'Mod4' ) - # XKBGrammar.g:35:9: 'Mod4' - self.match("Mod4") + # XKBGrammar.g:34:7: ( 'Mod1' ) + # XKBGrammar.g:34:9: 'Mod1' + self.match("Mod1") @@ -822,9 +800,9 @@ class XKBGrammarLexer(Lexer): _type = T__56 _channel = DEFAULT_CHANNEL - # XKBGrammar.g:36:7: ( 'Mod5' ) - # XKBGrammar.g:36:9: 'Mod5' - self.match("Mod5") + # XKBGrammar.g:35:7: ( 'Mod2' ) + # XKBGrammar.g:35:9: 'Mod2' + self.match("Mod2") @@ -840,6 +818,81 @@ class XKBGrammarLexer(Lexer): + # $ANTLR start T__57 + def mT__57(self, ): + + try: + _type = T__57 + _channel = DEFAULT_CHANNEL + + # XKBGrammar.g:36:7: ( 'Mod3' ) + # XKBGrammar.g:36:9: 'Mod3' + self.match("Mod3") + + + + + self._state.type = _type + self._state.channel = _channel + + finally: + + pass + + # $ANTLR end T__57 + + + + # $ANTLR start T__58 + def mT__58(self, ): + + try: + _type = T__58 + _channel = DEFAULT_CHANNEL + + # XKBGrammar.g:37:7: ( 'Mod4' ) + # XKBGrammar.g:37:9: 'Mod4' + self.match("Mod4") + + + + + self._state.type = _type + self._state.channel = _channel + + finally: + + pass + + # $ANTLR end T__58 + + + + # $ANTLR start T__59 + def mT__59(self, ): + + try: + _type = T__59 + _channel = DEFAULT_CHANNEL + + # XKBGrammar.g:38:7: ( 'Mod5' ) + # XKBGrammar.g:38:9: 'Mod5' + self.match("Mod5") + + + + + self._state.type = _type + self._state.channel = _channel + + finally: + + pass + + # $ANTLR end T__59 + + + # $ANTLR start NAME def mNAME(self, ): @@ -847,9 +900,9 @@ class XKBGrammarLexer(Lexer): _type = NAME _channel = DEFAULT_CHANNEL - # XKBGrammar.g:139:2: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '(' | ')' | '0' .. '9' | '+' | '-' )* ) - # XKBGrammar.g:139:4: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '(' | ')' | '0' .. '9' | '+' | '-' )* - # XKBGrammar.g:139:4: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '(' | ')' | '0' .. '9' | '+' | '-' )* + # XKBGrammar.g:141:2: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '(' | ')' | '0' .. '9' | '+' | '-' )* ) + # XKBGrammar.g:141:4: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '(' | ')' | '0' .. '9' | '+' | '-' )* + # XKBGrammar.g:141:4: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '(' | ')' | '0' .. '9' | '+' | '-' )* while True: #loop1 alt1 = 2 LA1_0 = self.input.LA(1) @@ -895,8 +948,8 @@ class XKBGrammarLexer(Lexer): _type = WS _channel = DEFAULT_CHANNEL - # XKBGrammar.g:143:2: ( ( ' ' | '\\r' | '\\t' | '\\u000C' | '\\n' ) ) - # XKBGrammar.g:144:2: ( ' ' | '\\r' | '\\t' | '\\u000C' | '\\n' ) + # XKBGrammar.g:145:2: ( ( ' ' | '\\r' | '\\t' | '\\u000C' | '\\n' ) ) + # XKBGrammar.g:146:2: ( ' ' | '\\r' | '\\t' | '\\u000C' | '\\n' ) if (9 <= self.input.LA(1) <= 10) or (12 <= self.input.LA(1) <= 13) or self.input.LA(1) == 32: self.input.consume(); else: @@ -929,10 +982,10 @@ class XKBGrammarLexer(Lexer): _type = COMMENT _channel = DEFAULT_CHANNEL - # XKBGrammar.g:149:6: ( '/*' ( . )* '*/' ) - # XKBGrammar.g:150:2: '/*' ( . )* '*/' + # XKBGrammar.g:151:6: ( '/*' ( . )* '*/' ) + # XKBGrammar.g:152:2: '/*' ( . )* '*/' self.match("/*") - # XKBGrammar.g:150:7: ( . )* + # XKBGrammar.g:152:7: ( . )* while True: #loop2 alt2 = 2 LA2_0 = self.input.LA(1) @@ -951,7 +1004,7 @@ class XKBGrammarLexer(Lexer): if alt2 == 1: - # XKBGrammar.g:150:7: . + # XKBGrammar.g:152:7: . self.matchAny() @@ -986,9 +1039,9 @@ class XKBGrammarLexer(Lexer): _type = LINE_COMMENT _channel = DEFAULT_CHANNEL - # XKBGrammar.g:154:6: ( ( '//' | '#' ) (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' ) - # XKBGrammar.g:155:2: ( '//' | '#' ) (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' - # XKBGrammar.g:155:2: ( '//' | '#' ) + # XKBGrammar.g:156:6: ( ( '//' | '#' ) (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' ) + # XKBGrammar.g:157:2: ( '//' | '#' ) (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' + # XKBGrammar.g:157:2: ( '//' | '#' ) alt3 = 2 LA3_0 = self.input.LA(1) @@ -1002,19 +1055,19 @@ class XKBGrammarLexer(Lexer): raise nvae if alt3 == 1: - # XKBGrammar.g:155:3: '//' + # XKBGrammar.g:157:3: '//' self.match("//") elif alt3 == 2: - # XKBGrammar.g:155:10: '#' + # XKBGrammar.g:157:10: '#' self.match(35) - # XKBGrammar.g:155:16: (~ ( '\\n' | '\\r' ) )* + # XKBGrammar.g:157:16: (~ ( '\\n' | '\\r' ) )* while True: #loop4 alt4 = 2 LA4_0 = self.input.LA(1) @@ -1024,7 +1077,7 @@ class XKBGrammarLexer(Lexer): if alt4 == 1: - # XKBGrammar.g:155:16: ~ ( '\\n' | '\\r' ) + # XKBGrammar.g:157:16: ~ ( '\\n' | '\\r' ) if (0 <= self.input.LA(1) <= 9) or (11 <= self.input.LA(1) <= 12) or (14 <= self.input.LA(1) <= 65534): self.input.consume(); else: @@ -1039,14 +1092,14 @@ class XKBGrammarLexer(Lexer): break #loop4 - # XKBGrammar.g:155:32: ( '\\r' )? + # XKBGrammar.g:157:32: ( '\\r' )? alt5 = 2 LA5_0 = self.input.LA(1) if (LA5_0 == 13) : alt5 = 1 if alt5 == 1: - # XKBGrammar.g:155:32: '\\r' + # XKBGrammar.g:157:32: '\\r' self.match(13) @@ -1078,10 +1131,10 @@ class XKBGrammarLexer(Lexer): _type = DQSTRING _channel = DEFAULT_CHANNEL - # XKBGrammar.g:163:6: ( '\"' ( options {greedy=false; } : ~ ( '\"' ) )* '\"' ) - # XKBGrammar.g:163:10: '\"' ( options {greedy=false; } : ~ ( '\"' ) )* '\"' + # XKBGrammar.g:165:6: ( '\"' ( options {greedy=false; } : ~ ( '\"' ) )* '\"' ) + # XKBGrammar.g:165:10: '\"' ( options {greedy=false; } : ~ ( '\"' ) )* '\"' self.match(34) - # XKBGrammar.g:163:14: ( options {greedy=false; } : ~ ( '\"' ) )* + # XKBGrammar.g:165:14: ( options {greedy=false; } : ~ ( '\"' ) )* while True: #loop6 alt6 = 2 LA6_0 = self.input.LA(1) @@ -1093,7 +1146,7 @@ class XKBGrammarLexer(Lexer): if alt6 == 1: - # XKBGrammar.g:163:39: ~ ( '\"' ) + # XKBGrammar.g:165:39: ~ ( '\"' ) if (0 <= self.input.LA(1) <= 33) or (35 <= self.input.LA(1) <= 65534): self.input.consume(); else: @@ -1125,215 +1178,227 @@ class XKBGrammarLexer(Lexer): def mTokens(self): - # XKBGrammar.g:1:8: ( T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | T__41 | T__42 | T__43 | T__44 | T__45 | T__46 | T__47 | T__48 | T__49 | T__50 | T__51 | T__52 | T__53 | T__54 | T__55 | T__56 | NAME | WS | COMMENT | LINE_COMMENT | DQSTRING ) - alt7 = 35 + # XKBGrammar.g:1:8: ( T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | T__41 | T__42 | T__43 | T__44 | T__45 | T__46 | T__47 | T__48 | T__49 | T__50 | T__51 | T__52 | T__53 | T__54 | T__55 | T__56 | T__57 | T__58 | T__59 | NAME | WS | COMMENT | LINE_COMMENT | DQSTRING ) + alt7 = 37 alt7 = self.dfa7.predict(self.input) if alt7 == 1: - # XKBGrammar.g:1:10: T__27 - self.mT__27() + # XKBGrammar.g:1:10: T__28 + self.mT__28() elif alt7 == 2: - # XKBGrammar.g:1:16: T__28 - self.mT__28() + # XKBGrammar.g:1:16: T__29 + self.mT__29() elif alt7 == 3: - # XKBGrammar.g:1:22: T__29 - self.mT__29() + # XKBGrammar.g:1:22: T__30 + self.mT__30() elif alt7 == 4: - # XKBGrammar.g:1:28: T__30 - self.mT__30() + # XKBGrammar.g:1:28: T__31 + self.mT__31() elif alt7 == 5: - # XKBGrammar.g:1:34: T__31 - self.mT__31() + # XKBGrammar.g:1:34: T__32 + self.mT__32() elif alt7 == 6: - # XKBGrammar.g:1:40: T__32 - self.mT__32() + # XKBGrammar.g:1:40: T__33 + self.mT__33() elif alt7 == 7: - # XKBGrammar.g:1:46: T__33 - self.mT__33() + # XKBGrammar.g:1:46: T__34 + self.mT__34() elif alt7 == 8: - # XKBGrammar.g:1:52: T__34 - self.mT__34() + # XKBGrammar.g:1:52: T__35 + self.mT__35() elif alt7 == 9: - # XKBGrammar.g:1:58: T__35 - self.mT__35() + # XKBGrammar.g:1:58: T__36 + self.mT__36() elif alt7 == 10: - # XKBGrammar.g:1:64: T__36 - self.mT__36() + # XKBGrammar.g:1:64: T__37 + self.mT__37() elif alt7 == 11: - # XKBGrammar.g:1:70: T__37 - self.mT__37() + # XKBGrammar.g:1:70: T__38 + self.mT__38() elif alt7 == 12: - # XKBGrammar.g:1:76: T__38 - self.mT__38() + # XKBGrammar.g:1:76: T__39 + self.mT__39() elif alt7 == 13: - # XKBGrammar.g:1:82: T__39 - self.mT__39() + # XKBGrammar.g:1:82: T__40 + self.mT__40() elif alt7 == 14: - # XKBGrammar.g:1:88: T__40 - self.mT__40() + # XKBGrammar.g:1:88: T__41 + self.mT__41() elif alt7 == 15: - # XKBGrammar.g:1:94: T__41 - self.mT__41() + # XKBGrammar.g:1:94: T__42 + self.mT__42() elif alt7 == 16: - # XKBGrammar.g:1:100: T__42 - self.mT__42() + # XKBGrammar.g:1:100: T__43 + self.mT__43() elif alt7 == 17: - # XKBGrammar.g:1:106: T__43 - self.mT__43() + # XKBGrammar.g:1:106: T__44 + self.mT__44() elif alt7 == 18: - # XKBGrammar.g:1:112: T__44 - self.mT__44() + # XKBGrammar.g:1:112: T__45 + self.mT__45() elif alt7 == 19: - # XKBGrammar.g:1:118: T__45 - self.mT__45() + # XKBGrammar.g:1:118: T__46 + self.mT__46() elif alt7 == 20: - # XKBGrammar.g:1:124: T__46 - self.mT__46() + # XKBGrammar.g:1:124: T__47 + self.mT__47() elif alt7 == 21: - # XKBGrammar.g:1:130: T__47 - self.mT__47() + # XKBGrammar.g:1:130: T__48 + self.mT__48() elif alt7 == 22: - # XKBGrammar.g:1:136: T__48 - self.mT__48() + # XKBGrammar.g:1:136: T__49 + self.mT__49() elif alt7 == 23: - # XKBGrammar.g:1:142: T__49 - self.mT__49() + # XKBGrammar.g:1:142: T__50 + self.mT__50() elif alt7 == 24: - # XKBGrammar.g:1:148: T__50 - self.mT__50() + # XKBGrammar.g:1:148: T__51 + self.mT__51() elif alt7 == 25: - # XKBGrammar.g:1:154: T__51 - self.mT__51() + # XKBGrammar.g:1:154: T__52 + self.mT__52() elif alt7 == 26: - # XKBGrammar.g:1:160: T__52 - self.mT__52() + # XKBGrammar.g:1:160: T__53 + self.mT__53() elif alt7 == 27: - # XKBGrammar.g:1:166: T__53 - self.mT__53() + # XKBGrammar.g:1:166: T__54 + self.mT__54() elif alt7 == 28: - # XKBGrammar.g:1:172: T__54 - self.mT__54() + # XKBGrammar.g:1:172: T__55 + self.mT__55() elif alt7 == 29: - # XKBGrammar.g:1:178: T__55 - self.mT__55() + # XKBGrammar.g:1:178: T__56 + self.mT__56() elif alt7 == 30: - # XKBGrammar.g:1:184: T__56 - self.mT__56() + # XKBGrammar.g:1:184: T__57 + self.mT__57() elif alt7 == 31: - # XKBGrammar.g:1:190: NAME - self.mNAME() + # XKBGrammar.g:1:190: T__58 + self.mT__58() elif alt7 == 32: - # XKBGrammar.g:1:195: WS - self.mWS() + # XKBGrammar.g:1:196: T__59 + self.mT__59() elif alt7 == 33: - # XKBGrammar.g:1:198: COMMENT - self.mCOMMENT() + # XKBGrammar.g:1:202: NAME + self.mNAME() elif alt7 == 34: - # XKBGrammar.g:1:206: LINE_COMMENT - self.mLINE_COMMENT() + # XKBGrammar.g:1:207: WS + self.mWS() elif alt7 == 35: - # XKBGrammar.g:1:219: DQSTRING + # XKBGrammar.g:1:210: COMMENT + self.mCOMMENT() + + + + elif alt7 == 36: + # XKBGrammar.g:1:218: LINE_COMMENT + self.mLINE_COMMENT() + + + + elif alt7 == 37: + # XKBGrammar.g:1:231: DQSTRING self.mDQSTRING() @@ -1346,87 +1411,90 @@ class XKBGrammarLexer(Lexer): # lookup tables for DFA #7 DFA7_eot = DFA.unpack( - u"\1\30\3\uffff\2\30\3\uffff\2\30\3\uffff\12\30\5\uffff\16\30\1\uffff" - u"\2\30\1\76\15\30\1\120\2\uffff\1\30\1\122\10\30\1\133\1\134\1\135" - u"\1\136\1\137\1\140\1\30\1\uffff\1\30\1\uffff\6\30\1\151\1\30\6" - u"\uffff\3\30\1\156\4\30\1\uffff\1\30\1\164\1\30\1\166\1\uffff\1" - u"\167\3\30\1\173\1\uffff\1\30\2\uffff\3\30\1\uffff\15\30\1\u008e" - u"\1\u008f\3\30\2\uffff\1\u0093\2\30\1\uffff\3\30\1\u0099\1\30\1" - u"\uffff\1\u009b\1\uffff" + u"\1\31\3\uffff\2\31\3\uffff\3\31\3\uffff\12\31\5\uffff\17\31\1\uffff" + u"\2\31\1\102\16\31\1\125\1\uffff\1\31\1\uffff\2\31\1\131\10\31\1" + u"\142\1\143\1\144\1\145\1\146\1\147\1\31\1\uffff\3\31\1\uffff\6" + u"\31\1\162\1\31\6\uffff\5\31\1\171\4\31\1\uffff\1\31\1\177\3\31" + u"\1\u0083\1\uffff\1\u0084\3\31\1\u0088\1\uffff\1\31\1\u008a\1\31" + u"\2\uffff\3\31\1\uffff\1\31\1\uffff\12\31\1\u009b\4\31\1\u00a0\1" + u"\uffff\1\u00a1\3\31\2\uffff\1\u00a5\2\31\1\uffff\3\31\1\u00ab\1" + u"\31\1\uffff\1\u00ad\1\uffff" ) DFA7_eof = DFA.unpack( - u"\u009c\uffff" + u"\u00ae\uffff" ) DFA7_min = DFA.unpack( - u"\1\11\3\uffff\1\156\1\141\3\uffff\1\145\1\157\3\uffff\1\171\1\145" - u"\1\151\1\141\1\154\1\153\1\150\3\157\2\uffff\1\52\2\uffff\1\143" - u"\1\155\1\171\1\144\1\160\1\146\1\144\1\162\1\160\1\142\1\151\1" - u"\156\1\143\1\144\1\uffff\1\154\1\145\1\50\1\151\1\145\1\141\1\144" - u"\1\164\1\150\1\145\1\137\1\146\1\164\1\153\1\61\1\165\1\50\2\uffff" - u"\1\146\1\50\1\165\1\145\1\151\1\141\1\162\1\163\1\164\1\162\6\50" - u"\1\144\1\uffff\1\151\1\uffff\1\154\1\156\1\141\2\156\1\171\1\50" - u"\1\157\6\uffff\2\145\1\164\1\50\1\154\1\165\1\141\1\155\1\uffff" - u"\1\154\1\50\1\162\1\50\1\uffff\1\50\1\155\1\164\1\142\1\50\1\uffff" - u"\1\137\2\uffff\2\145\1\157\1\uffff\1\153\1\162\1\137\1\154\1\141" - u"\1\145\1\151\1\147\1\163\1\160\1\171\1\143\1\162\2\50\1\163\1\137" + u"\1\11\3\uffff\1\156\1\141\3\uffff\1\145\1\166\1\157\3\uffff\1\171" + u"\1\145\1\151\1\141\1\154\1\153\1\150\3\157\2\uffff\1\52\2\uffff" + u"\1\143\1\155\1\171\1\145\1\144\1\160\1\146\1\144\1\162\1\160\1" + u"\142\1\151\1\156\1\143\1\144\1\uffff\1\154\1\145\1\50\1\162\1\151" + u"\1\145\1\141\1\144\1\164\1\150\1\145\1\137\1\146\1\164\1\153\1" + u"\61\1\165\1\50\1\uffff\1\141\1\uffff\1\162\1\146\1\50\1\165\1\145" + u"\1\151\1\141\1\162\1\163\1\164\1\162\6\50\1\144\1\uffff\1\144\2" + u"\151\1\uffff\1\154\1\156\1\141\2\156\1\171\1\50\1\157\6\uffff\1" + u"\145\1\137\1\144\1\145\1\164\1\50\1\154\1\165\1\141\1\155\1\uffff" + u"\1\154\1\50\1\153\1\145\1\162\1\50\1\uffff\1\50\1\155\1\164\1\142" + u"\1\50\1\uffff\1\145\1\50\1\137\2\uffff\2\145\1\157\1\uffff\1\171" + u"\1\uffff\1\153\1\162\1\137\1\154\1\163\1\141\1\145\1\151\1\147" + u"\1\163\1\50\1\160\1\171\1\143\1\162\1\50\1\uffff\1\50\1\163\1\137" u"\1\157\2\uffff\1\50\1\153\1\165\1\uffff\1\145\1\160\1\171\1\50" u"\1\163\1\uffff\1\50\1\uffff" ) DFA7_max = DFA.unpack( - u"\1\175\3\uffff\1\156\1\141\3\uffff\1\145\1\157\3\uffff\1\171\1" - u"\145\1\151\1\141\1\154\1\153\1\150\3\157\2\uffff\1\57\2\uffff\1" - u"\143\1\155\1\171\1\144\1\160\1\146\1\144\1\162\1\164\1\142\1\151" - u"\1\156\1\143\1\144\1\uffff\1\154\1\145\1\172\1\151\1\145\1\141" - u"\1\144\1\164\1\150\1\145\1\137\1\146\1\164\1\153\1\65\1\165\1\172" - u"\2\uffff\1\146\1\172\1\165\1\145\1\151\1\141\1\162\1\163\1\164" - u"\1\162\6\172\1\144\1\uffff\1\151\1\uffff\1\154\1\156\1\141\2\156" - u"\1\171\1\172\1\157\6\uffff\2\145\1\164\1\172\1\154\1\165\1\141" - u"\1\155\1\uffff\1\154\1\172\1\162\1\172\1\uffff\1\172\1\155\1\164" - u"\1\142\1\172\1\uffff\1\137\2\uffff\2\145\1\157\1\uffff\1\155\1" - u"\162\1\137\1\154\1\141\1\145\1\151\1\147\1\163\1\160\1\171\1\143" - u"\1\162\2\172\1\163\1\137\1\157\2\uffff\1\172\1\153\1\165\1\uffff" + u"\1\175\3\uffff\1\156\1\141\3\uffff\1\145\1\166\1\157\3\uffff\1" + u"\171\1\145\1\151\1\141\1\154\1\153\1\150\3\157\2\uffff\1\57\2\uffff" + u"\1\143\1\155\1\171\1\145\1\144\1\160\1\146\1\144\1\162\1\164\1" + u"\142\1\151\1\156\1\143\1\144\1\uffff\1\154\1\145\1\172\1\162\1" + u"\151\1\145\1\141\1\144\1\164\1\150\1\145\1\137\1\146\1\164\1\153" + u"\1\65\1\165\1\172\1\uffff\1\141\1\uffff\1\162\1\146\1\172\1\165" + u"\1\145\1\151\1\141\1\162\1\163\1\164\1\162\6\172\1\144\1\uffff" + u"\1\144\2\151\1\uffff\1\154\1\156\1\141\2\156\1\171\1\172\1\157" + u"\6\uffff\1\145\1\137\1\144\1\145\1\164\1\172\1\154\1\165\1\141" + u"\1\155\1\uffff\1\154\1\172\1\153\1\145\1\162\1\172\1\uffff\1\172" + u"\1\155\1\164\1\142\1\172\1\uffff\1\145\1\172\1\137\2\uffff\2\145" + u"\1\157\1\uffff\1\171\1\uffff\1\155\1\162\1\137\1\154\1\163\1\141" + u"\1\145\1\151\1\147\1\163\1\172\1\160\1\171\1\143\1\162\1\172\1" + u"\uffff\1\172\1\163\1\137\1\157\2\uffff\1\172\1\153\1\165\1\uffff" u"\1\145\1\160\1\171\1\172\1\163\1\uffff\1\172\1\uffff" ) DFA7_accept = DFA.unpack( - u"\1\uffff\1\1\1\2\1\3\2\uffff\1\6\1\7\1\10\2\uffff\1\14\1\15\1\16" - u"\12\uffff\1\37\1\40\1\uffff\1\42\1\43\16\uffff\1\41\21\uffff\1" - u"\11\1\12\21\uffff\1\5\1\uffff\1\17\10\uffff\1\31\1\32\1\33\1\34" - u"\1\35\1\36\10\uffff\1\27\4\uffff\1\21\5\uffff\1\4\1\uffff\1\20" - u"\1\22\3\uffff\1\30\22\uffff\1\26\1\13\3\uffff\1\24\5\uffff\1\25" - u"\1\uffff\1\23" + u"\1\uffff\1\1\1\2\1\3\2\uffff\1\6\1\7\1\10\3\uffff\1\15\1\16\1\17" + u"\12\uffff\1\41\1\42\1\uffff\1\44\1\45\17\uffff\1\43\22\uffff\1" + u"\11\1\uffff\1\13\22\uffff\1\5\3\uffff\1\20\10\uffff\1\33\1\34\1" + u"\35\1\36\1\37\1\40\12\uffff\1\31\6\uffff\1\22\5\uffff\1\4\3\uffff" + u"\1\21\1\23\3\uffff\1\32\1\uffff\1\12\20\uffff\1\25\4\uffff\1\30" + u"\1\14\3\uffff\1\26\5\uffff\1\27\1\uffff\1\24" ) DFA7_special = DFA.unpack( - u"\u009c\uffff" + u"\u00ae\uffff" ) DFA7_transition = [ - DFA.unpack(u"\2\31\1\uffff\2\31\22\uffff\1\31\1\uffff\1\34\1\33\10" - u"\uffff\1\13\2\uffff\1\32\13\uffff\1\3\1\14\1\10\1\15\4\uffff\1" - u"\25\10\uffff\1\26\1\27\5\uffff\1\24\7\uffff\1\6\1\uffff\1\7\3\uffff" - u"\1\22\2\uffff\1\17\3\uffff\1\20\1\4\1\uffff\1\11\1\uffff\1\12\1" - u"\5\1\uffff\1\21\3\uffff\1\16\3\uffff\1\23\2\uffff\1\1\1\uffff\1" - u"\2"), + DFA.unpack(u"\2\32\1\uffff\2\32\22\uffff\1\32\1\uffff\1\35\1\34\10" + u"\uffff\1\14\2\uffff\1\33\13\uffff\1\3\1\15\1\10\1\16\4\uffff\1" + u"\26\10\uffff\1\27\1\30\5\uffff\1\25\7\uffff\1\6\1\uffff\1\7\3\uffff" + u"\1\23\2\uffff\1\20\3\uffff\1\21\1\4\1\uffff\1\11\1\uffff\1\13\1" + u"\5\1\12\1\22\3\uffff\1\17\3\uffff\1\24\2\uffff\1\1\1\uffff\1\2"), DFA.unpack(u""), DFA.unpack(u""), DFA.unpack(u""), - DFA.unpack(u"\1\35"), DFA.unpack(u"\1\36"), + DFA.unpack(u"\1\37"), DFA.unpack(u""), DFA.unpack(u""), DFA.unpack(u""), - DFA.unpack(u"\1\37"), DFA.unpack(u"\1\40"), + DFA.unpack(u"\1\41"), + DFA.unpack(u"\1\42"), DFA.unpack(u""), DFA.unpack(u""), DFA.unpack(u""), - DFA.unpack(u"\1\41"), - DFA.unpack(u"\1\42"), DFA.unpack(u"\1\43"), DFA.unpack(u"\1\44"), DFA.unpack(u"\1\45"), @@ -1435,34 +1503,33 @@ class XKBGrammarLexer(Lexer): DFA.unpack(u"\1\50"), DFA.unpack(u"\1\51"), DFA.unpack(u"\1\52"), + DFA.unpack(u"\1\53"), + DFA.unpack(u"\1\54"), DFA.unpack(u""), DFA.unpack(u""), - DFA.unpack(u"\1\53\4\uffff\1\33"), + DFA.unpack(u"\1\55\4\uffff\1\34"), DFA.unpack(u""), DFA.unpack(u""), - DFA.unpack(u"\1\54"), - DFA.unpack(u"\1\55"), DFA.unpack(u"\1\56"), DFA.unpack(u"\1\57"), DFA.unpack(u"\1\60"), DFA.unpack(u"\1\61"), DFA.unpack(u"\1\62"), DFA.unpack(u"\1\63"), - DFA.unpack(u"\1\64\3\uffff\1\65"), + DFA.unpack(u"\1\64"), + DFA.unpack(u"\1\65"), DFA.unpack(u"\1\66"), - DFA.unpack(u"\1\67"), - DFA.unpack(u"\1\70"), + DFA.unpack(u"\1\67\3\uffff\1\70"), DFA.unpack(u"\1\71"), DFA.unpack(u"\1\72"), - DFA.unpack(u""), DFA.unpack(u"\1\73"), DFA.unpack(u"\1\74"), - DFA.unpack(u"\2\30\1\uffff\1\30\1\uffff\1\30\1\75\1\uffff\12\30\7" - u"\uffff\32\30\4\uffff\1\30\1\uffff\32\30"), + DFA.unpack(u"\1\75"), + DFA.unpack(u""), + DFA.unpack(u"\1\76"), DFA.unpack(u"\1\77"), - DFA.unpack(u"\1\100"), - DFA.unpack(u"\1\101"), - DFA.unpack(u"\1\102"), + DFA.unpack(u"\2\31\1\uffff\1\31\1\uffff\1\31\1\100\1\uffff\12\31" + u"\7\uffff\32\31\4\uffff\1\31\1\uffff\17\31\1\101\12\31"), DFA.unpack(u"\1\103"), DFA.unpack(u"\1\104"), DFA.unpack(u"\1\105"), @@ -1470,122 +1537,144 @@ class XKBGrammarLexer(Lexer): DFA.unpack(u"\1\107"), DFA.unpack(u"\1\110"), DFA.unpack(u"\1\111"), - DFA.unpack(u"\1\112\1\113\1\114\1\115\1\116"), - DFA.unpack(u"\1\117"), - DFA.unpack(u"\2\30\1\uffff\1\30\1\uffff\1\30\2\uffff\12\30\7\uffff" - u"\32\30\4\uffff\1\30\1\uffff\32\30"), - DFA.unpack(u""), - DFA.unpack(u""), - DFA.unpack(u"\1\121"), - DFA.unpack(u"\2\30\1\uffff\1\30\1\uffff\1\30\2\uffff\12\30\7\uffff" - u"\32\30\4\uffff\1\30\1\uffff\32\30"), - DFA.unpack(u"\1\123"), + DFA.unpack(u"\1\112"), + DFA.unpack(u"\1\113"), + DFA.unpack(u"\1\114"), + DFA.unpack(u"\1\115"), + DFA.unpack(u"\1\116"), + DFA.unpack(u"\1\117\1\120\1\121\1\122\1\123"), DFA.unpack(u"\1\124"), - DFA.unpack(u"\1\125"), + DFA.unpack(u"\2\31\1\uffff\1\31\1\uffff\1\31\2\uffff\12\31\7\uffff" + u"\32\31\4\uffff\1\31\1\uffff\32\31"), + DFA.unpack(u""), DFA.unpack(u"\1\126"), + DFA.unpack(u""), DFA.unpack(u"\1\127"), DFA.unpack(u"\1\130"), - DFA.unpack(u"\1\131"), + DFA.unpack(u"\2\31\1\uffff\1\31\1\uffff\1\31\2\uffff\12\31\7\uffff" + u"\32\31\4\uffff\1\31\1\uffff\32\31"), DFA.unpack(u"\1\132"), - DFA.unpack(u"\2\30\1\uffff\1\30\1\uffff\1\30\2\uffff\12\30\7\uffff" - u"\32\30\4\uffff\1\30\1\uffff\32\30"), - DFA.unpack(u"\2\30\1\uffff\1\30\1\uffff\1\30\2\uffff\12\30\7\uffff" - u"\32\30\4\uffff\1\30\1\uffff\32\30"), - DFA.unpack(u"\2\30\1\uffff\1\30\1\uffff\1\30\2\uffff\12\30\7\uffff" - u"\32\30\4\uffff\1\30\1\uffff\32\30"), - DFA.unpack(u"\2\30\1\uffff\1\30\1\uffff\1\30\2\uffff\12\30\7\uffff" - u"\32\30\4\uffff\1\30\1\uffff\32\30"), - DFA.unpack(u"\2\30\1\uffff\1\30\1\uffff\1\30\2\uffff\12\30\7\uffff" - u"\32\30\4\uffff\1\30\1\uffff\32\30"), - DFA.unpack(u"\2\30\1\uffff\1\30\1\uffff\1\30\2\uffff\12\30\7\uffff" - u"\32\30\4\uffff\1\30\1\uffff\32\30"), + DFA.unpack(u"\1\133"), + DFA.unpack(u"\1\134"), + DFA.unpack(u"\1\135"), + DFA.unpack(u"\1\136"), + DFA.unpack(u"\1\137"), + DFA.unpack(u"\1\140"), DFA.unpack(u"\1\141"), - DFA.unpack(u""), - DFA.unpack(u"\1\142"), - DFA.unpack(u""), - DFA.unpack(u"\1\143"), - DFA.unpack(u"\1\144"), - DFA.unpack(u"\1\145"), - DFA.unpack(u"\1\146"), - DFA.unpack(u"\1\147"), + DFA.unpack(u"\2\31\1\uffff\1\31\1\uffff\1\31\2\uffff\12\31\7\uffff" + u"\32\31\4\uffff\1\31\1\uffff\32\31"), + DFA.unpack(u"\2\31\1\uffff\1\31\1\uffff\1\31\2\uffff\12\31\7\uffff" + u"\32\31\4\uffff\1\31\1\uffff\32\31"), + DFA.unpack(u"\2\31\1\uffff\1\31\1\uffff\1\31\2\uffff\12\31\7\uffff" + u"\32\31\4\uffff\1\31\1\uffff\32\31"), + DFA.unpack(u"\2\31\1\uffff\1\31\1\uffff\1\31\2\uffff\12\31\7\uffff" + u"\32\31\4\uffff\1\31\1\uffff\32\31"), + DFA.unpack(u"\2\31\1\uffff\1\31\1\uffff\1\31\2\uffff\12\31\7\uffff" + u"\32\31\4\uffff\1\31\1\uffff\32\31"), + DFA.unpack(u"\2\31\1\uffff\1\31\1\uffff\1\31\2\uffff\12\31\7\uffff" + u"\32\31\4\uffff\1\31\1\uffff\32\31"), DFA.unpack(u"\1\150"), - DFA.unpack(u"\2\30\1\uffff\1\30\1\uffff\1\30\2\uffff\12\30\7\uffff" - u"\32\30\4\uffff\1\30\1\uffff\32\30"), - DFA.unpack(u"\1\152"), - DFA.unpack(u""), - DFA.unpack(u""), - DFA.unpack(u""), - DFA.unpack(u""), - DFA.unpack(u""), DFA.unpack(u""), + DFA.unpack(u"\1\151"), + DFA.unpack(u"\1\152"), DFA.unpack(u"\1\153"), + DFA.unpack(u""), DFA.unpack(u"\1\154"), DFA.unpack(u"\1\155"), - DFA.unpack(u"\2\30\1\uffff\1\30\1\uffff\1\30\2\uffff\12\30\7\uffff" - u"\32\30\4\uffff\1\30\1\uffff\32\30"), + DFA.unpack(u"\1\156"), DFA.unpack(u"\1\157"), DFA.unpack(u"\1\160"), DFA.unpack(u"\1\161"), - DFA.unpack(u"\1\162"), - DFA.unpack(u""), + DFA.unpack(u"\2\31\1\uffff\1\31\1\uffff\1\31\2\uffff\12\31\7\uffff" + u"\32\31\4\uffff\1\31\1\uffff\32\31"), DFA.unpack(u"\1\163"), - DFA.unpack(u"\2\30\1\uffff\1\30\1\uffff\1\30\2\uffff\12\30\7\uffff" - u"\32\30\4\uffff\1\30\1\uffff\32\30"), - DFA.unpack(u"\1\165"), - DFA.unpack(u"\2\30\1\uffff\1\30\1\uffff\1\30\2\uffff\12\30\7\uffff" - u"\32\30\4\uffff\1\30\1\uffff\32\30"), DFA.unpack(u""), - DFA.unpack(u"\2\30\1\uffff\1\30\1\uffff\1\30\2\uffff\12\30\7\uffff" - u"\32\30\4\uffff\1\30\1\uffff\32\30"), - DFA.unpack(u"\1\170"), - DFA.unpack(u"\1\171"), - DFA.unpack(u"\1\172"), - DFA.unpack(u"\2\30\1\uffff\1\30\1\uffff\1\30\2\uffff\12\30\7\uffff" - u"\32\30\4\uffff\1\30\1\uffff\32\30"), DFA.unpack(u""), - DFA.unpack(u"\1\174"), DFA.unpack(u""), DFA.unpack(u""), + DFA.unpack(u""), + DFA.unpack(u""), + DFA.unpack(u"\1\164"), + DFA.unpack(u"\1\165"), + DFA.unpack(u"\1\166"), + DFA.unpack(u"\1\167"), + DFA.unpack(u"\1\170"), + DFA.unpack(u"\2\31\1\uffff\1\31\1\uffff\1\31\2\uffff\12\31\7\uffff" + u"\32\31\4\uffff\1\31\1\uffff\32\31"), + DFA.unpack(u"\1\172"), + DFA.unpack(u"\1\173"), + DFA.unpack(u"\1\174"), DFA.unpack(u"\1\175"), - DFA.unpack(u"\1\176"), - DFA.unpack(u"\1\177"), DFA.unpack(u""), - DFA.unpack(u"\1\u0081\1\uffff\1\u0080"), + DFA.unpack(u"\1\176"), + DFA.unpack(u"\2\31\1\uffff\1\31\1\uffff\1\31\2\uffff\12\31\7\uffff" + u"\32\31\4\uffff\1\31\1\uffff\32\31"), + DFA.unpack(u"\1\u0080"), + DFA.unpack(u"\1\u0081"), DFA.unpack(u"\1\u0082"), - DFA.unpack(u"\1\u0083"), - DFA.unpack(u"\1\u0084"), + DFA.unpack(u"\2\31\1\uffff\1\31\1\uffff\1\31\2\uffff\12\31\7\uffff" + u"\32\31\4\uffff\1\31\1\uffff\32\31"), + DFA.unpack(u""), + DFA.unpack(u"\2\31\1\uffff\1\31\1\uffff\1\31\2\uffff\12\31\7\uffff" + u"\32\31\4\uffff\1\31\1\uffff\32\31"), DFA.unpack(u"\1\u0085"), DFA.unpack(u"\1\u0086"), DFA.unpack(u"\1\u0087"), - DFA.unpack(u"\1\u0088"), + DFA.unpack(u"\2\31\1\uffff\1\31\1\uffff\1\31\2\uffff\12\31\7\uffff" + u"\32\31\4\uffff\1\31\1\uffff\32\31"), + DFA.unpack(u""), DFA.unpack(u"\1\u0089"), - DFA.unpack(u"\1\u008a"), + DFA.unpack(u"\2\31\1\uffff\1\31\1\uffff\1\31\2\uffff\12\31\7\uffff" + u"\32\31\4\uffff\1\31\1\uffff\32\31"), DFA.unpack(u"\1\u008b"), + DFA.unpack(u""), + DFA.unpack(u""), DFA.unpack(u"\1\u008c"), DFA.unpack(u"\1\u008d"), - DFA.unpack(u"\2\30\1\uffff\1\30\1\uffff\1\30\2\uffff\12\30\7\uffff" - u"\32\30\4\uffff\1\30\1\uffff\32\30"), - DFA.unpack(u"\2\30\1\uffff\1\30\1\uffff\1\30\2\uffff\12\30\7\uffff" - u"\32\30\4\uffff\1\30\1\uffff\32\30"), - DFA.unpack(u"\1\u0090"), - DFA.unpack(u"\1\u0091"), - DFA.unpack(u"\1\u0092"), + DFA.unpack(u"\1\u008e"), DFA.unpack(u""), + DFA.unpack(u"\1\u008f"), DFA.unpack(u""), - DFA.unpack(u"\2\30\1\uffff\1\30\1\uffff\1\30\2\uffff\12\30\7\uffff" - u"\32\30\4\uffff\1\30\1\uffff\32\30"), + DFA.unpack(u"\1\u0091\1\uffff\1\u0090"), + DFA.unpack(u"\1\u0092"), + DFA.unpack(u"\1\u0093"), DFA.unpack(u"\1\u0094"), DFA.unpack(u"\1\u0095"), - DFA.unpack(u""), DFA.unpack(u"\1\u0096"), DFA.unpack(u"\1\u0097"), DFA.unpack(u"\1\u0098"), - DFA.unpack(u"\2\30\1\uffff\1\30\1\uffff\1\30\2\uffff\12\30\7\uffff" - u"\32\30\4\uffff\1\30\1\uffff\32\30"), + DFA.unpack(u"\1\u0099"), DFA.unpack(u"\1\u009a"), + DFA.unpack(u"\2\31\1\uffff\1\31\1\uffff\1\31\2\uffff\12\31\7\uffff" + u"\32\31\4\uffff\1\31\1\uffff\32\31"), + DFA.unpack(u"\1\u009c"), + DFA.unpack(u"\1\u009d"), + DFA.unpack(u"\1\u009e"), + DFA.unpack(u"\1\u009f"), + DFA.unpack(u"\2\31\1\uffff\1\31\1\uffff\1\31\2\uffff\12\31\7\uffff" + u"\32\31\4\uffff\1\31\1\uffff\32\31"), + DFA.unpack(u""), + DFA.unpack(u"\2\31\1\uffff\1\31\1\uffff\1\31\2\uffff\12\31\7\uffff" + u"\32\31\4\uffff\1\31\1\uffff\32\31"), + DFA.unpack(u"\1\u00a2"), + DFA.unpack(u"\1\u00a3"), + DFA.unpack(u"\1\u00a4"), + DFA.unpack(u""), + DFA.unpack(u""), + DFA.unpack(u"\2\31\1\uffff\1\31\1\uffff\1\31\2\uffff\12\31\7\uffff" + u"\32\31\4\uffff\1\31\1\uffff\32\31"), + DFA.unpack(u"\1\u00a6"), + DFA.unpack(u"\1\u00a7"), + DFA.unpack(u""), + DFA.unpack(u"\1\u00a8"), + DFA.unpack(u"\1\u00a9"), + DFA.unpack(u"\1\u00aa"), + DFA.unpack(u"\2\31\1\uffff\1\31\1\uffff\1\31\2\uffff\12\31\7\uffff" + u"\32\31\4\uffff\1\31\1\uffff\32\31"), + DFA.unpack(u"\1\u00ac"), DFA.unpack(u""), - DFA.unpack(u"\2\30\1\uffff\1\30\1\uffff\1\30\2\uffff\12\30\7\uffff" - u"\32\30\4\uffff\1\30\1\uffff\32\30"), + DFA.unpack(u"\2\31\1\uffff\1\31\1\uffff\1\31\2\uffff\12\31\7\uffff" + u"\32\31\4\uffff\1\31\1\uffff\32\31"), DFA.unpack(u"") ] diff --git a/XKBGrammar/XKBGrammarLexer.pyc b/XKBGrammar/XKBGrammarLexer.pyc Binary files differ. diff --git a/XKBGrammar/XKBGrammarParser.py b/XKBGrammar/XKBGrammarParser.py @@ -1,4 +1,4 @@ -# $ANTLR 3.1b1 XKBGrammar.g 2008-05-20 22:51:08 +# $ANTLR 3.1b1 XKBGrammar.g 2008-05-21 02:16:01 import sys from antlr3 import * @@ -14,7 +14,6 @@ HIDDEN = BaseRecognizer.HIDDEN # token types T__29=29 T__28=28 -T__27=27 MAPOPTIONS=13 TOKEN_INCLUDE=4 TOKEN_MODIFIER_MAP=9 @@ -23,15 +22,18 @@ TOKEN_TYPE=8 MAPTYPE=11 T__55=55 T__56=56 -NAME=23 +T__57=57 +NAME=24 +T__58=58 T__51=51 T__52=52 MAPMATERIAL=14 T__53=53 T__54=54 +T__59=59 KEYSYMS=18 -COMMENT=25 -DQSTRING=22 +COMMENT=26 +DQSTRING=23 T__50=50 T__42=42 T__43=43 @@ -43,7 +45,7 @@ T__47=47 T__44=44 SECTION=15 T__45=45 -LINE_COMMENT=26 +LINE_COMMENT=27 KEYCODE=16 T__48=48 T__49=49 @@ -53,17 +55,18 @@ LAYOUT=10 T__30=30 T__31=31 T__32=32 -WS=24 +WS=25 T__33=33 T__34=34 T__35=35 T__36=36 T__37=37 +OVERRIDE=22 T__38=38 T__39=39 KEYSYMGROUP=21 -TOKEN_KEY=7 MAPNAME=12 +TOKEN_KEY=7 TOKEN_KEY_TYPE=5 KEYCODEX=17 @@ -73,12 +76,13 @@ tokenNames = [ "TOKEN_INCLUDE", "TOKEN_KEY_TYPE", "TOKEN_NAME", "TOKEN_KEY", "TOKEN_TYPE", "TOKEN_MODIFIER_MAP", "LAYOUT", "MAPTYPE", "MAPNAME", "MAPOPTIONS", "MAPMATERIAL", "SECTION", "KEYCODE", "KEYCODEX", "KEYSYMS", "VALUE", - "STATE", "KEYSYMGROUP", "DQSTRING", "NAME", "WS", "COMMENT", "LINE_COMMENT", - "'{'", "'}'", "';'", "'include'", "'name'", "'['", "']'", "'='", "'key.type'", - "'key'", "'modifier_map'", "','", "'<'", "'>'", "'type'", "'default'", - "'hidden'", "'partial'", "'alphanumeric_keys'", "'modifier_keys'", "'alternate_group'", - "'xkb_symbols'", "'Shift'", "'Control'", "'Lock'", "'Mod1'", "'Mod2'", - "'Mod3'", "'Mod4'", "'Mod5'" + "STATE", "KEYSYMGROUP", "OVERRIDE", "DQSTRING", "NAME", "WS", "COMMENT", + "LINE_COMMENT", "'{'", "'}'", "';'", "'include'", "'name'", "'['", "']'", + "'='", "'key.type'", "'override'", "'key'", "'modifier_map'", "','", + "'<'", "'>'", "'type'", "'default'", "'hidden'", "'partial'", "'alphanumeric_keys'", + "'keypad_keys'", "'modifier_keys'", "'alternate_group'", "'xkb_symbols'", + "'Shift'", "'Control'", "'Lock'", "'Mod1'", "'Mod2'", "'Mod3'", "'Mod4'", + "'Mod5'" ] @@ -118,7 +122,7 @@ class XKBGrammarParser(Parser): # $ANTLR start layout - # XKBGrammar.g:54:1: layout : ( section )+ EOF -> ^( LAYOUT ( section )+ ) ; + # XKBGrammar.g:55:1: layout : ( section )+ EOF -> ^( LAYOUT ( section )+ ) ; def layout(self, ): retval = self.layout_return() @@ -135,21 +139,21 @@ class XKBGrammarParser(Parser): stream_section = RewriteRuleSubtreeStream(self.adaptor, "rule section") try: try: - # XKBGrammar.g:55:2: ( ( section )+ EOF -> ^( LAYOUT ( section )+ ) ) - # XKBGrammar.g:55:4: ( section )+ EOF - # XKBGrammar.g:55:4: ( section )+ + # XKBGrammar.g:56:2: ( ( section )+ EOF -> ^( LAYOUT ( section )+ ) ) + # XKBGrammar.g:56:4: ( section )+ EOF + # XKBGrammar.g:56:4: ( section )+ cnt1 = 0 while True: #loop1 alt1 = 2 LA1_0 = self.input.LA(1) - if ((42 <= LA1_0 <= 48)) : + if ((44 <= LA1_0 <= 51)) : alt1 = 1 if alt1 == 1: - # XKBGrammar.g:55:4: section - self._state.following.append(self.FOLLOW_section_in_layout137) + # XKBGrammar.g:56:4: section + self._state.following.append(self.FOLLOW_section_in_layout141) section1 = self.section() self._state.following.pop() @@ -168,7 +172,7 @@ class XKBGrammarParser(Parser): EOF2 = self.input.LT(1) - self.match(self.input, EOF, self.FOLLOW_EOF_in_layout140) + self.match(self.input, EOF, self.FOLLOW_EOF_in_layout144) stream_EOF.add(EOF2) # AST Rewrite # elements: section @@ -186,12 +190,12 @@ class XKBGrammarParser(Parser): root_0 = self.adaptor.nil() - # 56:2: -> ^( LAYOUT ( section )+ ) - # XKBGrammar.g:56:5: ^( LAYOUT ( section )+ ) + # 57:2: -> ^( LAYOUT ( section )+ ) + # XKBGrammar.g:57:5: ^( LAYOUT ( section )+ ) root_1 = self.adaptor.nil() root_1 = self.adaptor.becomeRoot(self.adaptor.createFromType(LAYOUT, "LAYOUT"), root_1) - # XKBGrammar.g:56:14: ( section )+ + # XKBGrammar.g:57:14: ( section )+ if not (stream_section.hasNext()): raise RewriteEarlyExitException() @@ -240,7 +244,7 @@ class XKBGrammarParser(Parser): # $ANTLR start section - # XKBGrammar.g:59:1: section : mapType '{' ( mapMaterial )+ '}' ';' -> ^( SECTION mapType ^( MAPMATERIAL ( mapMaterial )+ ) ) ; + # XKBGrammar.g:60:1: section : mapType '{' ( mapMaterial )+ '}' ';' -> ^( SECTION mapType ^( MAPMATERIAL ( mapMaterial )+ ) ) ; def section(self, ): retval = self.section_return() @@ -259,36 +263,36 @@ class XKBGrammarParser(Parser): char_literal4_tree = None char_literal6_tree = None char_literal7_tree = None - stream_27 = RewriteRuleTokenStream(self.adaptor, "token 27") + stream_30 = RewriteRuleTokenStream(self.adaptor, "token 30") stream_28 = RewriteRuleTokenStream(self.adaptor, "token 28") stream_29 = RewriteRuleTokenStream(self.adaptor, "token 29") stream_mapMaterial = RewriteRuleSubtreeStream(self.adaptor, "rule mapMaterial") stream_mapType = RewriteRuleSubtreeStream(self.adaptor, "rule mapType") try: try: - # XKBGrammar.g:60:2: ( mapType '{' ( mapMaterial )+ '}' ';' -> ^( SECTION mapType ^( MAPMATERIAL ( mapMaterial )+ ) ) ) - # XKBGrammar.g:60:4: mapType '{' ( mapMaterial )+ '}' ';' - self._state.following.append(self.FOLLOW_mapType_in_section163) + # XKBGrammar.g:61:2: ( mapType '{' ( mapMaterial )+ '}' ';' -> ^( SECTION mapType ^( MAPMATERIAL ( mapMaterial )+ ) ) ) + # XKBGrammar.g:61:4: mapType '{' ( mapMaterial )+ '}' ';' + self._state.following.append(self.FOLLOW_mapType_in_section167) mapType3 = self.mapType() self._state.following.pop() stream_mapType.add(mapType3.tree) char_literal4 = self.input.LT(1) - self.match(self.input, 27, self.FOLLOW_27_in_section165) - stream_27.add(char_literal4) - # XKBGrammar.g:60:16: ( mapMaterial )+ + self.match(self.input, 28, self.FOLLOW_28_in_section169) + stream_28.add(char_literal4) + # XKBGrammar.g:61:16: ( mapMaterial )+ cnt2 = 0 while True: #loop2 alt2 = 2 LA2_0 = self.input.LA(1) - if ((30 <= LA2_0 <= 31) or (35 <= LA2_0 <= 37)) : + if ((31 <= LA2_0 <= 32) or (36 <= LA2_0 <= 39)) : alt2 = 1 if alt2 == 1: - # XKBGrammar.g:60:16: mapMaterial - self._state.following.append(self.FOLLOW_mapMaterial_in_section167) + # XKBGrammar.g:61:16: mapMaterial + self._state.following.append(self.FOLLOW_mapMaterial_in_section171) mapMaterial5 = self.mapMaterial() self._state.following.pop() @@ -307,11 +311,11 @@ class XKBGrammarParser(Parser): char_literal6 = self.input.LT(1) - self.match(self.input, 28, self.FOLLOW_28_in_section170) - stream_28.add(char_literal6) + self.match(self.input, 29, self.FOLLOW_29_in_section174) + stream_29.add(char_literal6) char_literal7 = self.input.LT(1) - self.match(self.input, 29, self.FOLLOW_29_in_section172) - stream_29.add(char_literal7) + self.match(self.input, 30, self.FOLLOW_30_in_section176) + stream_30.add(char_literal7) # AST Rewrite # elements: mapMaterial, mapType # token labels: @@ -328,17 +332,17 @@ class XKBGrammarParser(Parser): root_0 = self.adaptor.nil() - # 61:2: -> ^( SECTION mapType ^( MAPMATERIAL ( mapMaterial )+ ) ) - # XKBGrammar.g:61:5: ^( SECTION mapType ^( MAPMATERIAL ( mapMaterial )+ ) ) + # 62:2: -> ^( SECTION mapType ^( MAPMATERIAL ( mapMaterial )+ ) ) + # XKBGrammar.g:62:5: ^( SECTION mapType ^( MAPMATERIAL ( mapMaterial )+ ) ) root_1 = self.adaptor.nil() root_1 = self.adaptor.becomeRoot(self.adaptor.createFromType(SECTION, "SECTION"), root_1) self.adaptor.addChild(root_1, stream_mapType.nextTree()) - # XKBGrammar.g:61:23: ^( MAPMATERIAL ( mapMaterial )+ ) + # XKBGrammar.g:62:23: ^( MAPMATERIAL ( mapMaterial )+ ) root_2 = self.adaptor.nil() root_2 = self.adaptor.becomeRoot(self.adaptor.createFromType(MAPMATERIAL, "MAPMATERIAL"), root_2) - # XKBGrammar.g:61:37: ( mapMaterial )+ + # XKBGrammar.g:62:37: ( mapMaterial )+ if not (stream_mapMaterial.hasNext()): raise RewriteEarlyExitException() @@ -389,7 +393,7 @@ class XKBGrammarParser(Parser): # $ANTLR start mapType - # XKBGrammar.g:64:1: mapType : ( mapOptions )+ DQSTRING -> ^( MAPTYPE ^( MAPOPTIONS ( mapOptions )+ ) ^( MAPNAME DQSTRING ) ) ; + # XKBGrammar.g:65:1: mapType : ( mapOptions )+ DQSTRING -> ^( MAPTYPE ^( MAPOPTIONS ( mapOptions )+ ) ^( MAPNAME DQSTRING ) ) ; def mapType(self, ): retval = self.mapType_return() @@ -406,21 +410,21 @@ class XKBGrammarParser(Parser): stream_mapOptions = RewriteRuleSubtreeStream(self.adaptor, "rule mapOptions") try: try: - # XKBGrammar.g:65:2: ( ( mapOptions )+ DQSTRING -> ^( MAPTYPE ^( MAPOPTIONS ( mapOptions )+ ) ^( MAPNAME DQSTRING ) ) ) - # XKBGrammar.g:65:4: ( mapOptions )+ DQSTRING - # XKBGrammar.g:65:4: ( mapOptions )+ + # XKBGrammar.g:66:2: ( ( mapOptions )+ DQSTRING -> ^( MAPTYPE ^( MAPOPTIONS ( mapOptions )+ ) ^( MAPNAME DQSTRING ) ) ) + # XKBGrammar.g:66:4: ( mapOptions )+ DQSTRING + # XKBGrammar.g:66:4: ( mapOptions )+ cnt3 = 0 while True: #loop3 alt3 = 2 LA3_0 = self.input.LA(1) - if ((42 <= LA3_0 <= 48)) : + if ((44 <= LA3_0 <= 51)) : alt3 = 1 if alt3 == 1: - # XKBGrammar.g:65:4: mapOptions - self._state.following.append(self.FOLLOW_mapOptions_in_mapType200) + # XKBGrammar.g:66:4: mapOptions + self._state.following.append(self.FOLLOW_mapOptions_in_mapType204) mapOptions8 = self.mapOptions() self._state.following.pop() @@ -439,7 +443,7 @@ class XKBGrammarParser(Parser): DQSTRING9 = self.input.LT(1) - self.match(self.input, DQSTRING, self.FOLLOW_DQSTRING_in_mapType203) + self.match(self.input, DQSTRING, self.FOLLOW_DQSTRING_in_mapType207) stream_DQSTRING.add(DQSTRING9) # AST Rewrite # elements: DQSTRING, mapOptions @@ -457,16 +461,16 @@ class XKBGrammarParser(Parser): root_0 = self.adaptor.nil() - # 66:2: -> ^( MAPTYPE ^( MAPOPTIONS ( mapOptions )+ ) ^( MAPNAME DQSTRING ) ) - # XKBGrammar.g:66:5: ^( MAPTYPE ^( MAPOPTIONS ( mapOptions )+ ) ^( MAPNAME DQSTRING ) ) + # 67:2: -> ^( MAPTYPE ^( MAPOPTIONS ( mapOptions )+ ) ^( MAPNAME DQSTRING ) ) + # XKBGrammar.g:67:5: ^( MAPTYPE ^( MAPOPTIONS ( mapOptions )+ ) ^( MAPNAME DQSTRING ) ) root_1 = self.adaptor.nil() root_1 = self.adaptor.becomeRoot(self.adaptor.createFromType(MAPTYPE, "MAPTYPE"), root_1) - # XKBGrammar.g:66:15: ^( MAPOPTIONS ( mapOptions )+ ) + # XKBGrammar.g:67:15: ^( MAPOPTIONS ( mapOptions )+ ) root_2 = self.adaptor.nil() root_2 = self.adaptor.becomeRoot(self.adaptor.createFromType(MAPOPTIONS, "MAPOPTIONS"), root_2) - # XKBGrammar.g:66:28: ( mapOptions )+ + # XKBGrammar.g:67:28: ( mapOptions )+ if not (stream_mapOptions.hasNext()): raise RewriteEarlyExitException() @@ -477,7 +481,7 @@ class XKBGrammarParser(Parser): stream_mapOptions.reset() self.adaptor.addChild(root_1, root_2) - # XKBGrammar.g:66:41: ^( MAPNAME DQSTRING ) + # XKBGrammar.g:67:41: ^( MAPNAME DQSTRING ) root_2 = self.adaptor.nil() root_2 = self.adaptor.becomeRoot(self.adaptor.createFromType(MAPNAME, "MAPNAME"), root_2) @@ -524,7 +528,7 @@ class XKBGrammarParser(Parser): # $ANTLR start mapMaterial - # XKBGrammar.g:69:1: mapMaterial : ( line_include | line_name ';' | line_keytype ';' | line_key ';' | line_modifier_map ';' ); + # XKBGrammar.g:70:1: mapMaterial : ( line_include | line_name ';' | line_keytype ';' | line_key ';' | line_modifier_map ';' ); def mapMaterial(self, ): retval = self.mapMaterial_return() @@ -554,18 +558,18 @@ class XKBGrammarParser(Parser): try: try: - # XKBGrammar.g:70:2: ( line_include | line_name ';' | line_keytype ';' | line_key ';' | line_modifier_map ';' ) + # XKBGrammar.g:71:2: ( line_include | line_name ';' | line_keytype ';' | line_key ';' | line_modifier_map ';' ) alt4 = 5 LA4 = self.input.LA(1) - if LA4 == 30: + if LA4 == 31: alt4 = 1 - elif LA4 == 31: + elif LA4 == 32: alt4 = 2 - elif LA4 == 35: - alt4 = 3 elif LA4 == 36: + alt4 = 3 + elif LA4 == 37 or LA4 == 38: alt4 = 4 - elif LA4 == 37: + elif LA4 == 39: alt4 = 5 else: nvae = NoViableAltException("", 4, 0, self.input) @@ -573,10 +577,10 @@ class XKBGrammarParser(Parser): raise nvae if alt4 == 1: - # XKBGrammar.g:70:4: line_include + # XKBGrammar.g:71:4: line_include root_0 = self.adaptor.nil() - self._state.following.append(self.FOLLOW_line_include_in_mapMaterial235) + self._state.following.append(self.FOLLOW_line_include_in_mapMaterial239) line_include10 = self.line_include() self._state.following.pop() @@ -585,58 +589,58 @@ class XKBGrammarParser(Parser): elif alt4 == 2: - # XKBGrammar.g:71:4: line_name ';' + # XKBGrammar.g:72:4: line_name ';' root_0 = self.adaptor.nil() - self._state.following.append(self.FOLLOW_line_name_in_mapMaterial241) + self._state.following.append(self.FOLLOW_line_name_in_mapMaterial245) line_name11 = self.line_name() self._state.following.pop() self.adaptor.addChild(root_0, line_name11.tree) char_literal12 = self.input.LT(1) - self.match(self.input, 29, self.FOLLOW_29_in_mapMaterial243) + self.match(self.input, 30, self.FOLLOW_30_in_mapMaterial247) elif alt4 == 3: - # XKBGrammar.g:72:4: line_keytype ';' + # XKBGrammar.g:73:4: line_keytype ';' root_0 = self.adaptor.nil() - self._state.following.append(self.FOLLOW_line_keytype_in_mapMaterial249) + self._state.following.append(self.FOLLOW_line_keytype_in_mapMaterial253) line_keytype13 = self.line_keytype() self._state.following.pop() self.adaptor.addChild(root_0, line_keytype13.tree) char_literal14 = self.input.LT(1) - self.match(self.input, 29, self.FOLLOW_29_in_mapMaterial251) + self.match(self.input, 30, self.FOLLOW_30_in_mapMaterial255) elif alt4 == 4: - # XKBGrammar.g:73:4: line_key ';' + # XKBGrammar.g:74:4: line_key ';' root_0 = self.adaptor.nil() - self._state.following.append(self.FOLLOW_line_key_in_mapMaterial257) + self._state.following.append(self.FOLLOW_line_key_in_mapMaterial261) line_key15 = self.line_key() self._state.following.pop() self.adaptor.addChild(root_0, line_key15.tree) char_literal16 = self.input.LT(1) - self.match(self.input, 29, self.FOLLOW_29_in_mapMaterial259) + self.match(self.input, 30, self.FOLLOW_30_in_mapMaterial263) elif alt4 == 5: - # XKBGrammar.g:74:4: line_modifier_map ';' + # XKBGrammar.g:75:4: line_modifier_map ';' root_0 = self.adaptor.nil() - self._state.following.append(self.FOLLOW_line_modifier_map_in_mapMaterial265) + self._state.following.append(self.FOLLOW_line_modifier_map_in_mapMaterial269) line_modifier_map17 = self.line_modifier_map() self._state.following.pop() self.adaptor.addChild(root_0, line_modifier_map17.tree) char_literal18 = self.input.LT(1) - self.match(self.input, 29, self.FOLLOW_29_in_mapMaterial267) + self.match(self.input, 30, self.FOLLOW_30_in_mapMaterial271) @@ -670,7 +674,7 @@ class XKBGrammarParser(Parser): # $ANTLR start line_include - # XKBGrammar.g:77:1: line_include : 'include' DQSTRING -> ^( TOKEN_INCLUDE DQSTRING ) ; + # XKBGrammar.g:78:1: line_include : 'include' DQSTRING -> ^( TOKEN_INCLUDE DQSTRING ) ; def line_include(self, ): retval = self.line_include_return() @@ -683,18 +687,18 @@ class XKBGrammarParser(Parser): string_literal19_tree = None DQSTRING20_tree = None - stream_30 = RewriteRuleTokenStream(self.adaptor, "token 30") + stream_31 = RewriteRuleTokenStream(self.adaptor, "token 31") stream_DQSTRING = RewriteRuleTokenStream(self.adaptor, "token DQSTRING") try: try: - # XKBGrammar.g:78:2: ( 'include' DQSTRING -> ^( TOKEN_INCLUDE DQSTRING ) ) - # XKBGrammar.g:78:4: 'include' DQSTRING + # XKBGrammar.g:79:2: ( 'include' DQSTRING -> ^( TOKEN_INCLUDE DQSTRING ) ) + # XKBGrammar.g:79:4: 'include' DQSTRING string_literal19 = self.input.LT(1) - self.match(self.input, 30, self.FOLLOW_30_in_line_include279) - stream_30.add(string_literal19) + self.match(self.input, 31, self.FOLLOW_31_in_line_include283) + stream_31.add(string_literal19) DQSTRING20 = self.input.LT(1) - self.match(self.input, DQSTRING, self.FOLLOW_DQSTRING_in_line_include281) + self.match(self.input, DQSTRING, self.FOLLOW_DQSTRING_in_line_include285) stream_DQSTRING.add(DQSTRING20) # AST Rewrite # elements: DQSTRING @@ -712,8 +716,8 @@ class XKBGrammarParser(Parser): root_0 = self.adaptor.nil() - # 79:2: -> ^( TOKEN_INCLUDE DQSTRING ) - # XKBGrammar.g:79:5: ^( TOKEN_INCLUDE DQSTRING ) + # 80:2: -> ^( TOKEN_INCLUDE DQSTRING ) + # XKBGrammar.g:80:5: ^( TOKEN_INCLUDE DQSTRING ) root_1 = self.adaptor.nil() root_1 = self.adaptor.becomeRoot(self.adaptor.createFromType(TOKEN_INCLUDE, "TOKEN_INCLUDE"), root_1) @@ -758,7 +762,7 @@ class XKBGrammarParser(Parser): # $ANTLR start line_name - # XKBGrammar.g:82:1: line_name : 'name' '[' n1= NAME ']' '=' n2= DQSTRING -> ^( TOKEN_NAME $n1 ^( VALUE $n2) ) ; + # XKBGrammar.g:83:1: line_name : 'name' '[' n1= NAME ']' '=' n2= DQSTRING -> ^( TOKEN_NAME $n1 ^( VALUE $n2) ) ; def line_name(self, ): retval = self.line_name_return() @@ -781,32 +785,32 @@ class XKBGrammarParser(Parser): char_literal24_tree = None stream_NAME = RewriteRuleTokenStream(self.adaptor, "token NAME") stream_32 = RewriteRuleTokenStream(self.adaptor, "token 32") - stream_31 = RewriteRuleTokenStream(self.adaptor, "token 31") + stream_35 = RewriteRuleTokenStream(self.adaptor, "token 35") stream_DQSTRING = RewriteRuleTokenStream(self.adaptor, "token DQSTRING") stream_33 = RewriteRuleTokenStream(self.adaptor, "token 33") stream_34 = RewriteRuleTokenStream(self.adaptor, "token 34") try: try: - # XKBGrammar.g:83:2: ( 'name' '[' n1= NAME ']' '=' n2= DQSTRING -> ^( TOKEN_NAME $n1 ^( VALUE $n2) ) ) - # XKBGrammar.g:83:4: 'name' '[' n1= NAME ']' '=' n2= DQSTRING + # XKBGrammar.g:84:2: ( 'name' '[' n1= NAME ']' '=' n2= DQSTRING -> ^( TOKEN_NAME $n1 ^( VALUE $n2) ) ) + # XKBGrammar.g:84:4: 'name' '[' n1= NAME ']' '=' n2= DQSTRING string_literal21 = self.input.LT(1) - self.match(self.input, 31, self.FOLLOW_31_in_line_name301) - stream_31.add(string_literal21) + self.match(self.input, 32, self.FOLLOW_32_in_line_name305) + stream_32.add(string_literal21) char_literal22 = self.input.LT(1) - self.match(self.input, 32, self.FOLLOW_32_in_line_name303) - stream_32.add(char_literal22) + self.match(self.input, 33, self.FOLLOW_33_in_line_name307) + stream_33.add(char_literal22) n1 = self.input.LT(1) - self.match(self.input, NAME, self.FOLLOW_NAME_in_line_name307) + self.match(self.input, NAME, self.FOLLOW_NAME_in_line_name311) stream_NAME.add(n1) char_literal23 = self.input.LT(1) - self.match(self.input, 33, self.FOLLOW_33_in_line_name309) - stream_33.add(char_literal23) + self.match(self.input, 34, self.FOLLOW_34_in_line_name313) + stream_34.add(char_literal23) char_literal24 = self.input.LT(1) - self.match(self.input, 34, self.FOLLOW_34_in_line_name311) - stream_34.add(char_literal24) + self.match(self.input, 35, self.FOLLOW_35_in_line_name315) + stream_35.add(char_literal24) n2 = self.input.LT(1) - self.match(self.input, DQSTRING, self.FOLLOW_DQSTRING_in_line_name315) + self.match(self.input, DQSTRING, self.FOLLOW_DQSTRING_in_line_name319) stream_DQSTRING.add(n2) # AST Rewrite # elements: n2, n1 @@ -826,13 +830,13 @@ class XKBGrammarParser(Parser): root_0 = self.adaptor.nil() - # 84:2: -> ^( TOKEN_NAME $n1 ^( VALUE $n2) ) - # XKBGrammar.g:84:5: ^( TOKEN_NAME $n1 ^( VALUE $n2) ) + # 85:2: -> ^( TOKEN_NAME $n1 ^( VALUE $n2) ) + # XKBGrammar.g:85:5: ^( TOKEN_NAME $n1 ^( VALUE $n2) ) root_1 = self.adaptor.nil() root_1 = self.adaptor.becomeRoot(self.adaptor.createFromType(TOKEN_NAME, "TOKEN_NAME"), root_1) self.adaptor.addChild(root_1, stream_n1.nextNode()) - # XKBGrammar.g:84:22: ^( VALUE $n2) + # XKBGrammar.g:85:22: ^( VALUE $n2) root_2 = self.adaptor.nil() root_2 = self.adaptor.becomeRoot(self.adaptor.createFromType(VALUE, "VALUE"), root_2) @@ -879,7 +883,7 @@ class XKBGrammarParser(Parser): # $ANTLR start line_keytype - # XKBGrammar.g:87:1: line_keytype : 'key.type' '[' n1= NAME ']' '=' n2= DQSTRING -> ^( TOKEN_KEY_TYPE $n1 ^( VALUE $n2) ) ; + # XKBGrammar.g:88:1: line_keytype : 'key.type' '[' n1= NAME ']' '=' n2= DQSTRING -> ^( TOKEN_KEY_TYPE $n1 ^( VALUE $n2) ) ; def line_keytype(self, ): retval = self.line_keytype_return() @@ -901,33 +905,33 @@ class XKBGrammarParser(Parser): char_literal27_tree = None char_literal28_tree = None stream_NAME = RewriteRuleTokenStream(self.adaptor, "token NAME") - stream_32 = RewriteRuleTokenStream(self.adaptor, "token 32") stream_35 = RewriteRuleTokenStream(self.adaptor, "token 35") stream_DQSTRING = RewriteRuleTokenStream(self.adaptor, "token DQSTRING") + stream_36 = RewriteRuleTokenStream(self.adaptor, "token 36") stream_33 = RewriteRuleTokenStream(self.adaptor, "token 33") stream_34 = RewriteRuleTokenStream(self.adaptor, "token 34") try: try: - # XKBGrammar.g:88:2: ( 'key.type' '[' n1= NAME ']' '=' n2= DQSTRING -> ^( TOKEN_KEY_TYPE $n1 ^( VALUE $n2) ) ) - # XKBGrammar.g:88:4: 'key.type' '[' n1= NAME ']' '=' n2= DQSTRING + # XKBGrammar.g:89:2: ( 'key.type' '[' n1= NAME ']' '=' n2= DQSTRING -> ^( TOKEN_KEY_TYPE $n1 ^( VALUE $n2) ) ) + # XKBGrammar.g:89:4: 'key.type' '[' n1= NAME ']' '=' n2= DQSTRING string_literal25 = self.input.LT(1) - self.match(self.input, 35, self.FOLLOW_35_in_line_keytype343) - stream_35.add(string_literal25) + self.match(self.input, 36, self.FOLLOW_36_in_line_keytype347) + stream_36.add(string_literal25) char_literal26 = self.input.LT(1) - self.match(self.input, 32, self.FOLLOW_32_in_line_keytype345) - stream_32.add(char_literal26) + self.match(self.input, 33, self.FOLLOW_33_in_line_keytype349) + stream_33.add(char_literal26) n1 = self.input.LT(1) - self.match(self.input, NAME, self.FOLLOW_NAME_in_line_keytype349) + self.match(self.input, NAME, self.FOLLOW_NAME_in_line_keytype353) stream_NAME.add(n1) char_literal27 = self.input.LT(1) - self.match(self.input, 33, self.FOLLOW_33_in_line_keytype351) - stream_33.add(char_literal27) + self.match(self.input, 34, self.FOLLOW_34_in_line_keytype355) + stream_34.add(char_literal27) char_literal28 = self.input.LT(1) - self.match(self.input, 34, self.FOLLOW_34_in_line_keytype353) - stream_34.add(char_literal28) + self.match(self.input, 35, self.FOLLOW_35_in_line_keytype357) + stream_35.add(char_literal28) n2 = self.input.LT(1) - self.match(self.input, DQSTRING, self.FOLLOW_DQSTRING_in_line_keytype357) + self.match(self.input, DQSTRING, self.FOLLOW_DQSTRING_in_line_keytype361) stream_DQSTRING.add(n2) # AST Rewrite # elements: n1, n2 @@ -947,13 +951,13 @@ class XKBGrammarParser(Parser): root_0 = self.adaptor.nil() - # 89:2: -> ^( TOKEN_KEY_TYPE $n1 ^( VALUE $n2) ) - # XKBGrammar.g:89:5: ^( TOKEN_KEY_TYPE $n1 ^( VALUE $n2) ) + # 90:2: -> ^( TOKEN_KEY_TYPE $n1 ^( VALUE $n2) ) + # XKBGrammar.g:90:5: ^( TOKEN_KEY_TYPE $n1 ^( VALUE $n2) ) root_1 = self.adaptor.nil() root_1 = self.adaptor.becomeRoot(self.adaptor.createFromType(TOKEN_KEY_TYPE, "TOKEN_KEY_TYPE"), root_1) self.adaptor.addChild(root_1, stream_n1.nextNode()) - # XKBGrammar.g:89:26: ^( VALUE $n2) + # XKBGrammar.g:90:26: ^( VALUE $n2) root_2 = self.adaptor.nil() root_2 = self.adaptor.becomeRoot(self.adaptor.createFromType(VALUE, "VALUE"), root_2) @@ -1000,7 +1004,7 @@ class XKBGrammarParser(Parser): # $ANTLR start line_key - # XKBGrammar.g:92:1: line_key : 'key' keycode keysyms -> ^( TOKEN_KEY keycode keysyms ) ; + # XKBGrammar.g:93:1: line_key : (override= 'override' )? 'key' keycode keysyms -> ^( TOKEN_KEY ( ^( OVERRIDE $override) )? keycode keysyms ) ; def line_key(self, ): retval = self.line_key_return() @@ -1008,41 +1012,60 @@ class XKBGrammarParser(Parser): root_0 = None + override = None string_literal29 = None keycode30 = None keysyms31 = None + override_tree = None string_literal29_tree = None - stream_36 = RewriteRuleTokenStream(self.adaptor, "token 36") + stream_37 = RewriteRuleTokenStream(self.adaptor, "token 37") + stream_38 = RewriteRuleTokenStream(self.adaptor, "token 38") stream_keysyms = RewriteRuleSubtreeStream(self.adaptor, "rule keysyms") stream_keycode = RewriteRuleSubtreeStream(self.adaptor, "rule keycode") try: try: - # XKBGrammar.g:93:2: ( 'key' keycode keysyms -> ^( TOKEN_KEY keycode keysyms ) ) - # XKBGrammar.g:93:4: 'key' keycode keysyms + # XKBGrammar.g:94:2: ( (override= 'override' )? 'key' keycode keysyms -> ^( TOKEN_KEY ( ^( OVERRIDE $override) )? keycode keysyms ) ) + # XKBGrammar.g:94:4: (override= 'override' )? 'key' keycode keysyms + # XKBGrammar.g:94:12: (override= 'override' )? + alt5 = 2 + LA5_0 = self.input.LA(1) + + if (LA5_0 == 37) : + alt5 = 1 + if alt5 == 1: + # XKBGrammar.g:94:12: override= 'override' + override = self.input.LT(1) + self.match(self.input, 37, self.FOLLOW_37_in_line_key391) + stream_37.add(override) + + + + string_literal29 = self.input.LT(1) - self.match(self.input, 36, self.FOLLOW_36_in_line_key385) - stream_36.add(string_literal29) - self._state.following.append(self.FOLLOW_keycode_in_line_key387) + self.match(self.input, 38, self.FOLLOW_38_in_line_key394) + stream_38.add(string_literal29) + self._state.following.append(self.FOLLOW_keycode_in_line_key396) keycode30 = self.keycode() self._state.following.pop() stream_keycode.add(keycode30.tree) - self._state.following.append(self.FOLLOW_keysyms_in_line_key389) + self._state.following.append(self.FOLLOW_keysyms_in_line_key398) keysyms31 = self.keysyms() self._state.following.pop() stream_keysyms.add(keysyms31.tree) # AST Rewrite - # elements: keysyms, keycode - # token labels: + # elements: keycode, override, keysyms + # token labels: override # rule labels: retval # token list labels: # rule list labels: retval.tree = root_0 + stream_override = RewriteRuleTokenStream(self.adaptor, "token override", override) if retval is not None: stream_retval = RewriteRuleSubtreeStream(self.adaptor, "token retval", retval.tree) @@ -1051,11 +1074,23 @@ class XKBGrammarParser(Parser): root_0 = self.adaptor.nil() - # 94:2: -> ^( TOKEN_KEY keycode keysyms ) - # XKBGrammar.g:94:5: ^( TOKEN_KEY keycode keysyms ) + # 95:2: -> ^( TOKEN_KEY ( ^( OVERRIDE $override) )? keycode keysyms ) + # XKBGrammar.g:95:5: ^( TOKEN_KEY ( ^( OVERRIDE $override) )? keycode keysyms ) root_1 = self.adaptor.nil() root_1 = self.adaptor.becomeRoot(self.adaptor.createFromType(TOKEN_KEY, "TOKEN_KEY"), root_1) + # XKBGrammar.g:95:17: ( ^( OVERRIDE $override) )? + if stream_override.hasNext(): + # XKBGrammar.g:95:17: ^( OVERRIDE $override) + root_2 = self.adaptor.nil() + root_2 = self.adaptor.becomeRoot(self.adaptor.createFromType(OVERRIDE, "OVERRIDE"), root_2) + + self.adaptor.addChild(root_2, stream_override.nextNode()) + + self.adaptor.addChild(root_1, root_2) + + + stream_override.reset(); self.adaptor.addChild(root_1, stream_keycode.nextTree()) self.adaptor.addChild(root_1, stream_keysyms.nextTree()) @@ -1098,7 +1133,7 @@ class XKBGrammarParser(Parser): # $ANTLR start line_modifier_map - # XKBGrammar.g:97:1: line_modifier_map : 'modifier_map' state '{' keycode ( ',' keycode )* '}' -> ^( TOKEN_MODIFIER_MAP state ( keycode )+ ) ; + # XKBGrammar.g:98:1: line_modifier_map : 'modifier_map' state '{' keycode ( ',' keycode )* '}' -> ^( TOKEN_MODIFIER_MAP state ( keycode )+ ) ; def line_modifier_map(self, ): retval = self.line_modifier_map_return() @@ -1121,47 +1156,47 @@ class XKBGrammarParser(Parser): char_literal34_tree = None char_literal36_tree = None char_literal38_tree = None - stream_27 = RewriteRuleTokenStream(self.adaptor, "token 27") - stream_37 = RewriteRuleTokenStream(self.adaptor, "token 37") + stream_40 = RewriteRuleTokenStream(self.adaptor, "token 40") + stream_39 = RewriteRuleTokenStream(self.adaptor, "token 39") stream_28 = RewriteRuleTokenStream(self.adaptor, "token 28") - stream_38 = RewriteRuleTokenStream(self.adaptor, "token 38") + stream_29 = RewriteRuleTokenStream(self.adaptor, "token 29") stream_state = RewriteRuleSubtreeStream(self.adaptor, "rule state") stream_keycode = RewriteRuleSubtreeStream(self.adaptor, "rule keycode") try: try: - # XKBGrammar.g:98:2: ( 'modifier_map' state '{' keycode ( ',' keycode )* '}' -> ^( TOKEN_MODIFIER_MAP state ( keycode )+ ) ) - # XKBGrammar.g:98:4: 'modifier_map' state '{' keycode ( ',' keycode )* '}' + # XKBGrammar.g:99:2: ( 'modifier_map' state '{' keycode ( ',' keycode )* '}' -> ^( TOKEN_MODIFIER_MAP state ( keycode )+ ) ) + # XKBGrammar.g:99:4: 'modifier_map' state '{' keycode ( ',' keycode )* '}' string_literal32 = self.input.LT(1) - self.match(self.input, 37, self.FOLLOW_37_in_line_modifier_map411) - stream_37.add(string_literal32) - self._state.following.append(self.FOLLOW_state_in_line_modifier_map413) + self.match(self.input, 39, self.FOLLOW_39_in_line_modifier_map428) + stream_39.add(string_literal32) + self._state.following.append(self.FOLLOW_state_in_line_modifier_map430) state33 = self.state() self._state.following.pop() stream_state.add(state33.tree) char_literal34 = self.input.LT(1) - self.match(self.input, 27, self.FOLLOW_27_in_line_modifier_map415) - stream_27.add(char_literal34) - self._state.following.append(self.FOLLOW_keycode_in_line_modifier_map417) + self.match(self.input, 28, self.FOLLOW_28_in_line_modifier_map432) + stream_28.add(char_literal34) + self._state.following.append(self.FOLLOW_keycode_in_line_modifier_map434) keycode35 = self.keycode() self._state.following.pop() stream_keycode.add(keycode35.tree) - # XKBGrammar.g:98:37: ( ',' keycode )* - while True: #loop5 - alt5 = 2 - LA5_0 = self.input.LA(1) + # XKBGrammar.g:99:37: ( ',' keycode )* + while True: #loop6 + alt6 = 2 + LA6_0 = self.input.LA(1) - if (LA5_0 == 38) : - alt5 = 1 + if (LA6_0 == 40) : + alt6 = 1 - if alt5 == 1: - # XKBGrammar.g:98:38: ',' keycode + if alt6 == 1: + # XKBGrammar.g:99:38: ',' keycode char_literal36 = self.input.LT(1) - self.match(self.input, 38, self.FOLLOW_38_in_line_modifier_map420) - stream_38.add(char_literal36) - self._state.following.append(self.FOLLOW_keycode_in_line_modifier_map422) + self.match(self.input, 40, self.FOLLOW_40_in_line_modifier_map437) + stream_40.add(char_literal36) + self._state.following.append(self.FOLLOW_keycode_in_line_modifier_map439) keycode37 = self.keycode() self._state.following.pop() @@ -1170,14 +1205,14 @@ class XKBGrammarParser(Parser): else: - break #loop5 + break #loop6 char_literal38 = self.input.LT(1) - self.match(self.input, 28, self.FOLLOW_28_in_line_modifier_map426) - stream_28.add(char_literal38) + self.match(self.input, 29, self.FOLLOW_29_in_line_modifier_map443) + stream_29.add(char_literal38) # AST Rewrite - # elements: state, keycode + # elements: keycode, state # token labels: # rule labels: retval # token list labels: @@ -1192,13 +1227,13 @@ class XKBGrammarParser(Parser): root_0 = self.adaptor.nil() - # 99:2: -> ^( TOKEN_MODIFIER_MAP state ( keycode )+ ) - # XKBGrammar.g:99:5: ^( TOKEN_MODIFIER_MAP state ( keycode )+ ) + # 100:2: -> ^( TOKEN_MODIFIER_MAP state ( keycode )+ ) + # XKBGrammar.g:100:5: ^( TOKEN_MODIFIER_MAP state ( keycode )+ ) root_1 = self.adaptor.nil() root_1 = self.adaptor.becomeRoot(self.adaptor.createFromType(TOKEN_MODIFIER_MAP, "TOKEN_MODIFIER_MAP"), root_1) self.adaptor.addChild(root_1, stream_state.nextTree()) - # XKBGrammar.g:99:32: ( keycode )+ + # XKBGrammar.g:100:32: ( keycode )+ if not (stream_keycode.hasNext()): raise RewriteEarlyExitException() @@ -1247,7 +1282,7 @@ class XKBGrammarParser(Parser): # $ANTLR start keycode - # XKBGrammar.g:102:1: keycode : ( NAME -> ^( KEYCODE NAME ) | '<' NAME '>' -> ^( KEYCODEX NAME ) ); + # XKBGrammar.g:103:1: keycode : ( NAME -> ^( KEYCODE NAME ) | '<' NAME '>' -> ^( KEYCODEX NAME ) ); def keycode(self, ): retval = self.keycode_return() @@ -1265,28 +1300,28 @@ class XKBGrammarParser(Parser): NAME41_tree = None char_literal42_tree = None stream_NAME = RewriteRuleTokenStream(self.adaptor, "token NAME") - stream_40 = RewriteRuleTokenStream(self.adaptor, "token 40") - stream_39 = RewriteRuleTokenStream(self.adaptor, "token 39") + stream_42 = RewriteRuleTokenStream(self.adaptor, "token 42") + stream_41 = RewriteRuleTokenStream(self.adaptor, "token 41") try: try: - # XKBGrammar.g:103:2: ( NAME -> ^( KEYCODE NAME ) | '<' NAME '>' -> ^( KEYCODEX NAME ) ) - alt6 = 2 - LA6_0 = self.input.LA(1) + # XKBGrammar.g:104:2: ( NAME -> ^( KEYCODE NAME ) | '<' NAME '>' -> ^( KEYCODEX NAME ) ) + alt7 = 2 + LA7_0 = self.input.LA(1) - if (LA6_0 == NAME) : - alt6 = 1 - elif (LA6_0 == 39) : - alt6 = 2 + if (LA7_0 == NAME) : + alt7 = 1 + elif (LA7_0 == 41) : + alt7 = 2 else: - nvae = NoViableAltException("", 6, 0, self.input) + nvae = NoViableAltException("", 7, 0, self.input) raise nvae - if alt6 == 1: - # XKBGrammar.g:103:4: NAME + if alt7 == 1: + # XKBGrammar.g:104:4: NAME NAME39 = self.input.LT(1) - self.match(self.input, NAME, self.FOLLOW_NAME_in_keycode450) + self.match(self.input, NAME, self.FOLLOW_NAME_in_keycode467) stream_NAME.add(NAME39) # AST Rewrite # elements: NAME @@ -1304,8 +1339,8 @@ class XKBGrammarParser(Parser): root_0 = self.adaptor.nil() - # 103:9: -> ^( KEYCODE NAME ) - # XKBGrammar.g:103:12: ^( KEYCODE NAME ) + # 104:9: -> ^( KEYCODE NAME ) + # XKBGrammar.g:104:12: ^( KEYCODE NAME ) root_1 = self.adaptor.nil() root_1 = self.adaptor.becomeRoot(self.adaptor.createFromType(KEYCODE, "KEYCODE"), root_1) @@ -1319,17 +1354,17 @@ class XKBGrammarParser(Parser): - elif alt6 == 2: - # XKBGrammar.g:104:4: '<' NAME '>' + elif alt7 == 2: + # XKBGrammar.g:105:4: '<' NAME '>' char_literal40 = self.input.LT(1) - self.match(self.input, 39, self.FOLLOW_39_in_keycode463) - stream_39.add(char_literal40) + self.match(self.input, 41, self.FOLLOW_41_in_keycode480) + stream_41.add(char_literal40) NAME41 = self.input.LT(1) - self.match(self.input, NAME, self.FOLLOW_NAME_in_keycode465) + self.match(self.input, NAME, self.FOLLOW_NAME_in_keycode482) stream_NAME.add(NAME41) char_literal42 = self.input.LT(1) - self.match(self.input, 40, self.FOLLOW_40_in_keycode467) - stream_40.add(char_literal42) + self.match(self.input, 42, self.FOLLOW_42_in_keycode484) + stream_42.add(char_literal42) # AST Rewrite # elements: NAME # token labels: @@ -1346,8 +1381,8 @@ class XKBGrammarParser(Parser): root_0 = self.adaptor.nil() - # 104:17: -> ^( KEYCODEX NAME ) - # XKBGrammar.g:104:20: ^( KEYCODEX NAME ) + # 105:17: -> ^( KEYCODEX NAME ) + # XKBGrammar.g:105:20: ^( KEYCODEX NAME ) root_1 = self.adaptor.nil() root_1 = self.adaptor.becomeRoot(self.adaptor.createFromType(KEYCODEX, "KEYCODEX"), root_1) @@ -1391,7 +1426,7 @@ class XKBGrammarParser(Parser): # $ANTLR start keysyms - # XKBGrammar.g:107:1: keysyms : '{' ( 'type' '[' tn1= NAME ']' '=' tn2= DQSTRING ',' )? keysymgroup ( ',' keysymgroup )* '}' -> ^( KEYSYMS ( ^( TOKEN_TYPE $tn1 $tn2) )? ( keysymgroup )+ ) ; + # XKBGrammar.g:108:1: keysyms : '{' ( 'type' '[' tn1= NAME ']' '=' tn2= DQSTRING ',' )? keysymgroup ( ',' keysymgroup )* '}' -> ^( KEYSYMS ( ^( TOKEN_TYPE $tn1 $tn2) )? ( keysymgroup )+ ) ; def keysyms(self, ): retval = self.keysyms_return() @@ -1425,75 +1460,75 @@ class XKBGrammarParser(Parser): char_literal50_tree = None char_literal52_tree = None stream_NAME = RewriteRuleTokenStream(self.adaptor, "token NAME") - stream_41 = RewriteRuleTokenStream(self.adaptor, "token 41") - stream_32 = RewriteRuleTokenStream(self.adaptor, "token 32") + stream_43 = RewriteRuleTokenStream(self.adaptor, "token 43") + stream_40 = RewriteRuleTokenStream(self.adaptor, "token 40") + stream_35 = RewriteRuleTokenStream(self.adaptor, "token 35") stream_DQSTRING = RewriteRuleTokenStream(self.adaptor, "token DQSTRING") stream_33 = RewriteRuleTokenStream(self.adaptor, "token 33") stream_34 = RewriteRuleTokenStream(self.adaptor, "token 34") - stream_27 = RewriteRuleTokenStream(self.adaptor, "token 27") stream_28 = RewriteRuleTokenStream(self.adaptor, "token 28") - stream_38 = RewriteRuleTokenStream(self.adaptor, "token 38") + stream_29 = RewriteRuleTokenStream(self.adaptor, "token 29") stream_keysymgroup = RewriteRuleSubtreeStream(self.adaptor, "rule keysymgroup") try: try: - # XKBGrammar.g:108:2: ( '{' ( 'type' '[' tn1= NAME ']' '=' tn2= DQSTRING ',' )? keysymgroup ( ',' keysymgroup )* '}' -> ^( KEYSYMS ( ^( TOKEN_TYPE $tn1 $tn2) )? ( keysymgroup )+ ) ) - # XKBGrammar.g:108:4: '{' ( 'type' '[' tn1= NAME ']' '=' tn2= DQSTRING ',' )? keysymgroup ( ',' keysymgroup )* '}' + # XKBGrammar.g:109:2: ( '{' ( 'type' '[' tn1= NAME ']' '=' tn2= DQSTRING ',' )? keysymgroup ( ',' keysymgroup )* '}' -> ^( KEYSYMS ( ^( TOKEN_TYPE $tn1 $tn2) )? ( keysymgroup )+ ) ) + # XKBGrammar.g:109:4: '{' ( 'type' '[' tn1= NAME ']' '=' tn2= DQSTRING ',' )? keysymgroup ( ',' keysymgroup )* '}' char_literal43 = self.input.LT(1) - self.match(self.input, 27, self.FOLLOW_27_in_keysyms486) - stream_27.add(char_literal43) - # XKBGrammar.g:108:8: ( 'type' '[' tn1= NAME ']' '=' tn2= DQSTRING ',' )? - alt7 = 2 - LA7_0 = self.input.LA(1) - - if (LA7_0 == 41) : - alt7 = 1 - if alt7 == 1: - # XKBGrammar.g:108:9: 'type' '[' tn1= NAME ']' '=' tn2= DQSTRING ',' + self.match(self.input, 28, self.FOLLOW_28_in_keysyms503) + stream_28.add(char_literal43) + # XKBGrammar.g:109:8: ( 'type' '[' tn1= NAME ']' '=' tn2= DQSTRING ',' )? + alt8 = 2 + LA8_0 = self.input.LA(1) + + if (LA8_0 == 43) : + alt8 = 1 + if alt8 == 1: + # XKBGrammar.g:109:9: 'type' '[' tn1= NAME ']' '=' tn2= DQSTRING ',' string_literal44 = self.input.LT(1) - self.match(self.input, 41, self.FOLLOW_41_in_keysyms489) - stream_41.add(string_literal44) + self.match(self.input, 43, self.FOLLOW_43_in_keysyms506) + stream_43.add(string_literal44) char_literal45 = self.input.LT(1) - self.match(self.input, 32, self.FOLLOW_32_in_keysyms491) - stream_32.add(char_literal45) + self.match(self.input, 33, self.FOLLOW_33_in_keysyms508) + stream_33.add(char_literal45) tn1 = self.input.LT(1) - self.match(self.input, NAME, self.FOLLOW_NAME_in_keysyms495) + self.match(self.input, NAME, self.FOLLOW_NAME_in_keysyms512) stream_NAME.add(tn1) char_literal46 = self.input.LT(1) - self.match(self.input, 33, self.FOLLOW_33_in_keysyms497) - stream_33.add(char_literal46) + self.match(self.input, 34, self.FOLLOW_34_in_keysyms514) + stream_34.add(char_literal46) char_literal47 = self.input.LT(1) - self.match(self.input, 34, self.FOLLOW_34_in_keysyms499) - stream_34.add(char_literal47) + self.match(self.input, 35, self.FOLLOW_35_in_keysyms516) + stream_35.add(char_literal47) tn2 = self.input.LT(1) - self.match(self.input, DQSTRING, self.FOLLOW_DQSTRING_in_keysyms503) + self.match(self.input, DQSTRING, self.FOLLOW_DQSTRING_in_keysyms520) stream_DQSTRING.add(tn2) char_literal48 = self.input.LT(1) - self.match(self.input, 38, self.FOLLOW_38_in_keysyms505) - stream_38.add(char_literal48) + self.match(self.input, 40, self.FOLLOW_40_in_keysyms522) + stream_40.add(char_literal48) - self._state.following.append(self.FOLLOW_keysymgroup_in_keysyms509) + self._state.following.append(self.FOLLOW_keysymgroup_in_keysyms526) keysymgroup49 = self.keysymgroup() self._state.following.pop() stream_keysymgroup.add(keysymgroup49.tree) - # XKBGrammar.g:108:68: ( ',' keysymgroup )* - while True: #loop8 - alt8 = 2 - LA8_0 = self.input.LA(1) + # XKBGrammar.g:109:68: ( ',' keysymgroup )* + while True: #loop9 + alt9 = 2 + LA9_0 = self.input.LA(1) - if (LA8_0 == 38) : - alt8 = 1 + if (LA9_0 == 40) : + alt9 = 1 - if alt8 == 1: - # XKBGrammar.g:108:69: ',' keysymgroup + if alt9 == 1: + # XKBGrammar.g:109:69: ',' keysymgroup char_literal50 = self.input.LT(1) - self.match(self.input, 38, self.FOLLOW_38_in_keysyms512) - stream_38.add(char_literal50) - self._state.following.append(self.FOLLOW_keysymgroup_in_keysyms514) + self.match(self.input, 40, self.FOLLOW_40_in_keysyms529) + stream_40.add(char_literal50) + self._state.following.append(self.FOLLOW_keysymgroup_in_keysyms531) keysymgroup51 = self.keysymgroup() self._state.following.pop() @@ -1502,14 +1537,14 @@ class XKBGrammarParser(Parser): else: - break #loop8 + break #loop9 char_literal52 = self.input.LT(1) - self.match(self.input, 28, self.FOLLOW_28_in_keysyms518) - stream_28.add(char_literal52) + self.match(self.input, 29, self.FOLLOW_29_in_keysyms535) + stream_29.add(char_literal52) # AST Rewrite - # elements: tn2, keysymgroup, tn1 + # elements: keysymgroup, tn1, tn2 # token labels: tn1, tn2 # rule labels: retval # token list labels: @@ -1526,14 +1561,14 @@ class XKBGrammarParser(Parser): root_0 = self.adaptor.nil() - # 109:2: -> ^( KEYSYMS ( ^( TOKEN_TYPE $tn1 $tn2) )? ( keysymgroup )+ ) - # XKBGrammar.g:109:5: ^( KEYSYMS ( ^( TOKEN_TYPE $tn1 $tn2) )? ( keysymgroup )+ ) + # 110:2: -> ^( KEYSYMS ( ^( TOKEN_TYPE $tn1 $tn2) )? ( keysymgroup )+ ) + # XKBGrammar.g:110:5: ^( KEYSYMS ( ^( TOKEN_TYPE $tn1 $tn2) )? ( keysymgroup )+ ) root_1 = self.adaptor.nil() root_1 = self.adaptor.becomeRoot(self.adaptor.createFromType(KEYSYMS, "KEYSYMS"), root_1) - # XKBGrammar.g:109:15: ( ^( TOKEN_TYPE $tn1 $tn2) )? - if stream_tn2.hasNext() or stream_tn1.hasNext(): - # XKBGrammar.g:109:15: ^( TOKEN_TYPE $tn1 $tn2) + # XKBGrammar.g:110:15: ( ^( TOKEN_TYPE $tn1 $tn2) )? + if stream_tn1.hasNext() or stream_tn2.hasNext(): + # XKBGrammar.g:110:15: ^( TOKEN_TYPE $tn1 $tn2) root_2 = self.adaptor.nil() root_2 = self.adaptor.becomeRoot(self.adaptor.createFromType(TOKEN_TYPE, "TOKEN_TYPE"), root_2) @@ -1543,9 +1578,9 @@ class XKBGrammarParser(Parser): self.adaptor.addChild(root_1, root_2) - stream_tn2.reset(); stream_tn1.reset(); - # XKBGrammar.g:109:40: ( keysymgroup )+ + stream_tn2.reset(); + # XKBGrammar.g:110:40: ( keysymgroup )+ if not (stream_keysymgroup.hasNext()): raise RewriteEarlyExitException() @@ -1594,7 +1629,7 @@ class XKBGrammarParser(Parser): # $ANTLR start keysymgroup - # XKBGrammar.g:112:1: keysymgroup : '[' keysym+= NAME ( ',' keysym+= NAME )* ']' -> ^( KEYSYMGROUP ( $keysym)+ ) ; + # XKBGrammar.g:113:1: keysymgroup : '[' keysym+= NAME ( ',' keysym+= NAME )* ']' -> ^( KEYSYMGROUP ( $keysym)+ ) ; def keysymgroup(self, ): retval = self.keysymgroup_return() @@ -1613,40 +1648,40 @@ class XKBGrammarParser(Parser): char_literal55_tree = None keysym_tree = None stream_NAME = RewriteRuleTokenStream(self.adaptor, "token NAME") - stream_32 = RewriteRuleTokenStream(self.adaptor, "token 32") + stream_40 = RewriteRuleTokenStream(self.adaptor, "token 40") stream_33 = RewriteRuleTokenStream(self.adaptor, "token 33") - stream_38 = RewriteRuleTokenStream(self.adaptor, "token 38") + stream_34 = RewriteRuleTokenStream(self.adaptor, "token 34") try: try: - # XKBGrammar.g:113:2: ( '[' keysym+= NAME ( ',' keysym+= NAME )* ']' -> ^( KEYSYMGROUP ( $keysym)+ ) ) - # XKBGrammar.g:113:4: '[' keysym+= NAME ( ',' keysym+= NAME )* ']' + # XKBGrammar.g:114:2: ( '[' keysym+= NAME ( ',' keysym+= NAME )* ']' -> ^( KEYSYMGROUP ( $keysym)+ ) ) + # XKBGrammar.g:114:4: '[' keysym+= NAME ( ',' keysym+= NAME )* ']' char_literal53 = self.input.LT(1) - self.match(self.input, 32, self.FOLLOW_32_in_keysymgroup550) - stream_32.add(char_literal53) + self.match(self.input, 33, self.FOLLOW_33_in_keysymgroup567) + stream_33.add(char_literal53) keysym = self.input.LT(1) - self.match(self.input, NAME, self.FOLLOW_NAME_in_keysymgroup554) + self.match(self.input, NAME, self.FOLLOW_NAME_in_keysymgroup571) stream_NAME.add(keysym) if list_keysym is None: list_keysym = [] list_keysym.append(keysym) - # XKBGrammar.g:113:21: ( ',' keysym+= NAME )* - while True: #loop9 - alt9 = 2 - LA9_0 = self.input.LA(1) + # XKBGrammar.g:114:21: ( ',' keysym+= NAME )* + while True: #loop10 + alt10 = 2 + LA10_0 = self.input.LA(1) - if (LA9_0 == 38) : - alt9 = 1 + if (LA10_0 == 40) : + alt10 = 1 - if alt9 == 1: - # XKBGrammar.g:113:22: ',' keysym+= NAME + if alt10 == 1: + # XKBGrammar.g:114:22: ',' keysym+= NAME char_literal54 = self.input.LT(1) - self.match(self.input, 38, self.FOLLOW_38_in_keysymgroup557) - stream_38.add(char_literal54) + self.match(self.input, 40, self.FOLLOW_40_in_keysymgroup574) + stream_40.add(char_literal54) keysym = self.input.LT(1) - self.match(self.input, NAME, self.FOLLOW_NAME_in_keysymgroup561) + self.match(self.input, NAME, self.FOLLOW_NAME_in_keysymgroup578) stream_NAME.add(keysym) if list_keysym is None: list_keysym = [] @@ -1656,12 +1691,12 @@ class XKBGrammarParser(Parser): else: - break #loop9 + break #loop10 char_literal55 = self.input.LT(1) - self.match(self.input, 33, self.FOLLOW_33_in_keysymgroup565) - stream_33.add(char_literal55) + self.match(self.input, 34, self.FOLLOW_34_in_keysymgroup582) + stream_34.add(char_literal55) # AST Rewrite # elements: keysym # token labels: @@ -1679,12 +1714,12 @@ class XKBGrammarParser(Parser): root_0 = self.adaptor.nil() - # 114:2: -> ^( KEYSYMGROUP ( $keysym)+ ) - # XKBGrammar.g:114:5: ^( KEYSYMGROUP ( $keysym)+ ) + # 115:2: -> ^( KEYSYMGROUP ( $keysym)+ ) + # XKBGrammar.g:115:5: ^( KEYSYMGROUP ( $keysym)+ ) root_1 = self.adaptor.nil() root_1 = self.adaptor.becomeRoot(self.adaptor.createFromType(KEYSYMGROUP, "KEYSYMGROUP"), root_1) - # XKBGrammar.g:114:19: ( $keysym)+ + # XKBGrammar.g:115:19: ( $keysym)+ if not (stream_keysym.hasNext()): raise RewriteEarlyExitException() @@ -1733,7 +1768,7 @@ class XKBGrammarParser(Parser): # $ANTLR start mapOptions - # XKBGrammar.g:117:1: mapOptions : ( 'default' | 'hidden' | 'partial' | 'alphanumeric_keys' | 'modifier_keys' | 'alternate_group' | 'xkb_symbols' ); + # XKBGrammar.g:118:1: mapOptions : ( 'default' | 'hidden' | 'partial' | 'alphanumeric_keys' | 'keypad_keys' | 'modifier_keys' | 'alternate_group' | 'xkb_symbols' ); def mapOptions(self, ): retval = self.mapOptions_return() @@ -1747,12 +1782,12 @@ class XKBGrammarParser(Parser): try: try: - # XKBGrammar.g:118:2: ( 'default' | 'hidden' | 'partial' | 'alphanumeric_keys' | 'modifier_keys' | 'alternate_group' | 'xkb_symbols' ) + # XKBGrammar.g:119:2: ( 'default' | 'hidden' | 'partial' | 'alphanumeric_keys' | 'keypad_keys' | 'modifier_keys' | 'alternate_group' | 'xkb_symbols' ) # XKBGrammar.g: root_0 = self.adaptor.nil() set56 = self.input.LT(1) - if (42 <= self.input.LA(1) <= 48): + if (44 <= self.input.LA(1) <= 51): self.input.consume(); self.adaptor.addChild(root_0, self.adaptor.createWithPayload(set56)) self._state.errorRecovery = False @@ -1795,7 +1830,7 @@ class XKBGrammarParser(Parser): # $ANTLR start state - # XKBGrammar.g:127:1: state : ( 'Shift' | 'Control' | 'Lock' | 'Mod1' | 'Mod2' | 'Mod3' | 'Mod4' | 'Mod5' ); + # XKBGrammar.g:129:1: state : ( 'Shift' | 'Control' | 'Lock' | 'Mod1' | 'Mod2' | 'Mod3' | 'Mod4' | 'Mod5' ); def state(self, ): retval = self.state_return() @@ -1809,12 +1844,12 @@ class XKBGrammarParser(Parser): try: try: - # XKBGrammar.g:128:2: ( 'Shift' | 'Control' | 'Lock' | 'Mod1' | 'Mod2' | 'Mod3' | 'Mod4' | 'Mod5' ) + # XKBGrammar.g:130:2: ( 'Shift' | 'Control' | 'Lock' | 'Mod1' | 'Mod2' | 'Mod3' | 'Mod4' | 'Mod5' ) # XKBGrammar.g: root_0 = self.adaptor.nil() set57 = self.input.LT(1) - if (49 <= self.input.LA(1) <= 56): + if (52 <= self.input.LA(1) <= 59): self.input.consume(); self.adaptor.addChild(root_0, self.adaptor.createWithPayload(set57)) self._state.errorRecovery = False @@ -1852,69 +1887,70 @@ class XKBGrammarParser(Parser): - FOLLOW_section_in_layout137 = frozenset([42, 43, 44, 45, 46, 47, 48]) - FOLLOW_EOF_in_layout140 = frozenset([1]) - FOLLOW_mapType_in_section163 = frozenset([27]) - FOLLOW_27_in_section165 = frozenset([30, 31, 35, 36, 37]) - FOLLOW_mapMaterial_in_section167 = frozenset([28, 30, 31, 35, 36, 37]) - FOLLOW_28_in_section170 = frozenset([29]) - FOLLOW_29_in_section172 = frozenset([1]) - FOLLOW_mapOptions_in_mapType200 = frozenset([22, 42, 43, 44, 45, 46, 47, 48]) - FOLLOW_DQSTRING_in_mapType203 = frozenset([1]) - FOLLOW_line_include_in_mapMaterial235 = frozenset([1]) - FOLLOW_line_name_in_mapMaterial241 = frozenset([29]) - FOLLOW_29_in_mapMaterial243 = frozenset([1]) - FOLLOW_line_keytype_in_mapMaterial249 = frozenset([29]) - FOLLOW_29_in_mapMaterial251 = frozenset([1]) - FOLLOW_line_key_in_mapMaterial257 = frozenset([29]) - FOLLOW_29_in_mapMaterial259 = frozenset([1]) - FOLLOW_line_modifier_map_in_mapMaterial265 = frozenset([29]) - FOLLOW_29_in_mapMaterial267 = frozenset([1]) - FOLLOW_30_in_line_include279 = frozenset([22]) - FOLLOW_DQSTRING_in_line_include281 = frozenset([1]) - FOLLOW_31_in_line_name301 = frozenset([32]) - FOLLOW_32_in_line_name303 = frozenset([23]) - FOLLOW_NAME_in_line_name307 = frozenset([33]) - FOLLOW_33_in_line_name309 = frozenset([34]) - FOLLOW_34_in_line_name311 = frozenset([22]) - FOLLOW_DQSTRING_in_line_name315 = frozenset([1]) - FOLLOW_35_in_line_keytype343 = frozenset([32]) - FOLLOW_32_in_line_keytype345 = frozenset([23]) - FOLLOW_NAME_in_line_keytype349 = frozenset([33]) - FOLLOW_33_in_line_keytype351 = frozenset([34]) - FOLLOW_34_in_line_keytype353 = frozenset([22]) - FOLLOW_DQSTRING_in_line_keytype357 = frozenset([1]) - FOLLOW_36_in_line_key385 = frozenset([23, 39]) - FOLLOW_keycode_in_line_key387 = frozenset([27]) - FOLLOW_keysyms_in_line_key389 = frozenset([1]) - FOLLOW_37_in_line_modifier_map411 = frozenset([49, 50, 51, 52, 53, 54, 55, 56]) - FOLLOW_state_in_line_modifier_map413 = frozenset([27]) - FOLLOW_27_in_line_modifier_map415 = frozenset([23, 39]) - FOLLOW_keycode_in_line_modifier_map417 = frozenset([28, 38]) - FOLLOW_38_in_line_modifier_map420 = frozenset([23, 39]) - FOLLOW_keycode_in_line_modifier_map422 = frozenset([28, 38]) - FOLLOW_28_in_line_modifier_map426 = frozenset([1]) - FOLLOW_NAME_in_keycode450 = frozenset([1]) - FOLLOW_39_in_keycode463 = frozenset([23]) - FOLLOW_NAME_in_keycode465 = frozenset([40]) - FOLLOW_40_in_keycode467 = frozenset([1]) - FOLLOW_27_in_keysyms486 = frozenset([32, 41]) - FOLLOW_41_in_keysyms489 = frozenset([32]) - FOLLOW_32_in_keysyms491 = frozenset([23]) - FOLLOW_NAME_in_keysyms495 = frozenset([33]) - FOLLOW_33_in_keysyms497 = frozenset([34]) - FOLLOW_34_in_keysyms499 = frozenset([22]) - FOLLOW_DQSTRING_in_keysyms503 = frozenset([38]) - FOLLOW_38_in_keysyms505 = frozenset([32, 41]) - FOLLOW_keysymgroup_in_keysyms509 = frozenset([28, 38]) - FOLLOW_38_in_keysyms512 = frozenset([32, 41]) - FOLLOW_keysymgroup_in_keysyms514 = frozenset([28, 38]) - FOLLOW_28_in_keysyms518 = frozenset([1]) - FOLLOW_32_in_keysymgroup550 = frozenset([23]) - FOLLOW_NAME_in_keysymgroup554 = frozenset([33, 38]) - FOLLOW_38_in_keysymgroup557 = frozenset([23]) - FOLLOW_NAME_in_keysymgroup561 = frozenset([33, 38]) - FOLLOW_33_in_keysymgroup565 = frozenset([1]) + FOLLOW_section_in_layout141 = frozenset([44, 45, 46, 47, 48, 49, 50, 51]) + FOLLOW_EOF_in_layout144 = frozenset([1]) + FOLLOW_mapType_in_section167 = frozenset([28]) + FOLLOW_28_in_section169 = frozenset([31, 32, 36, 37, 38, 39]) + FOLLOW_mapMaterial_in_section171 = frozenset([29, 31, 32, 36, 37, 38, 39]) + FOLLOW_29_in_section174 = frozenset([30]) + FOLLOW_30_in_section176 = frozenset([1]) + FOLLOW_mapOptions_in_mapType204 = frozenset([23, 44, 45, 46, 47, 48, 49, 50, 51]) + FOLLOW_DQSTRING_in_mapType207 = frozenset([1]) + FOLLOW_line_include_in_mapMaterial239 = frozenset([1]) + FOLLOW_line_name_in_mapMaterial245 = frozenset([30]) + FOLLOW_30_in_mapMaterial247 = frozenset([1]) + FOLLOW_line_keytype_in_mapMaterial253 = frozenset([30]) + FOLLOW_30_in_mapMaterial255 = frozenset([1]) + FOLLOW_line_key_in_mapMaterial261 = frozenset([30]) + FOLLOW_30_in_mapMaterial263 = frozenset([1]) + FOLLOW_line_modifier_map_in_mapMaterial269 = frozenset([30]) + FOLLOW_30_in_mapMaterial271 = frozenset([1]) + FOLLOW_31_in_line_include283 = frozenset([23]) + FOLLOW_DQSTRING_in_line_include285 = frozenset([1]) + FOLLOW_32_in_line_name305 = frozenset([33]) + FOLLOW_33_in_line_name307 = frozenset([24]) + FOLLOW_NAME_in_line_name311 = frozenset([34]) + FOLLOW_34_in_line_name313 = frozenset([35]) + FOLLOW_35_in_line_name315 = frozenset([23]) + FOLLOW_DQSTRING_in_line_name319 = frozenset([1]) + FOLLOW_36_in_line_keytype347 = frozenset([33]) + FOLLOW_33_in_line_keytype349 = frozenset([24]) + FOLLOW_NAME_in_line_keytype353 = frozenset([34]) + FOLLOW_34_in_line_keytype355 = frozenset([35]) + FOLLOW_35_in_line_keytype357 = frozenset([23]) + FOLLOW_DQSTRING_in_line_keytype361 = frozenset([1]) + FOLLOW_37_in_line_key391 = frozenset([38]) + FOLLOW_38_in_line_key394 = frozenset([24, 41]) + FOLLOW_keycode_in_line_key396 = frozenset([28]) + FOLLOW_keysyms_in_line_key398 = frozenset([1]) + FOLLOW_39_in_line_modifier_map428 = frozenset([52, 53, 54, 55, 56, 57, 58, 59]) + FOLLOW_state_in_line_modifier_map430 = frozenset([28]) + FOLLOW_28_in_line_modifier_map432 = frozenset([24, 41]) + FOLLOW_keycode_in_line_modifier_map434 = frozenset([29, 40]) + FOLLOW_40_in_line_modifier_map437 = frozenset([24, 41]) + FOLLOW_keycode_in_line_modifier_map439 = frozenset([29, 40]) + FOLLOW_29_in_line_modifier_map443 = frozenset([1]) + FOLLOW_NAME_in_keycode467 = frozenset([1]) + FOLLOW_41_in_keycode480 = frozenset([24]) + FOLLOW_NAME_in_keycode482 = frozenset([42]) + FOLLOW_42_in_keycode484 = frozenset([1]) + FOLLOW_28_in_keysyms503 = frozenset([33, 43]) + FOLLOW_43_in_keysyms506 = frozenset([33]) + FOLLOW_33_in_keysyms508 = frozenset([24]) + FOLLOW_NAME_in_keysyms512 = frozenset([34]) + FOLLOW_34_in_keysyms514 = frozenset([35]) + FOLLOW_35_in_keysyms516 = frozenset([23]) + FOLLOW_DQSTRING_in_keysyms520 = frozenset([40]) + FOLLOW_40_in_keysyms522 = frozenset([33, 43]) + FOLLOW_keysymgroup_in_keysyms526 = frozenset([29, 40]) + FOLLOW_40_in_keysyms529 = frozenset([33, 43]) + FOLLOW_keysymgroup_in_keysyms531 = frozenset([29, 40]) + FOLLOW_29_in_keysyms535 = frozenset([1]) + FOLLOW_33_in_keysymgroup567 = frozenset([24]) + FOLLOW_NAME_in_keysymgroup571 = frozenset([34, 40]) + FOLLOW_40_in_keysymgroup574 = frozenset([24]) + FOLLOW_NAME_in_keysymgroup578 = frozenset([34, 40]) + FOLLOW_34_in_keysymgroup582 = frozenset([1]) FOLLOW_set_in_mapOptions0 = frozenset([1]) FOLLOW_set_in_state0 = frozenset([1]) diff --git a/XKBGrammar/XKBGrammarParser.pyc b/XKBGrammar/XKBGrammarParser.pyc Binary files differ. diff --git a/XKBGrammar/XKBGrammarWalker.g b/XKBGrammar/XKBGrammarWalker.g @@ -49,6 +49,7 @@ mapOptions | 'hidden' | 'partial' | 'alphanumeric_keys' + | 'keypad_keys' | 'alternate_group' | 'modifier_keys' | 'xkb_symbols' @@ -69,7 +70,7 @@ mapMaterial : ^(TOKEN_INCLUDE DQSTRING) | ^(TOKEN_NAME NAME ^(VALUE DQSTRING)) | ^(TOKEN_KEY_TYPE NAME ^(VALUE DQSTRING)) - | ^(TOKEN_KEY keycode keysyms) + | ^(TOKEN_KEY ^(OVERRIDE 'override') keycode keysyms) | ^(TOKEN_MODIFIER_MAP state keycode+) ; diff --git a/XKBGrammar/check_xkb.py b/XKBGrammar/check_xkb.py @@ -6,7 +6,7 @@ import sys import pdb import antlr3 -from XKBGrammarLexer import XKBGrammarLexer, SECTION, MAPTYPE, MAPNAME, MAPOPTIONS, MAPMATERIAL, TOKEN_INCLUDE, TOKEN_NAME, TOKEN_KEY_TYPE, TOKEN_KEY, VALUE, KEYCODE, KEYCODEX, KEYSYMS, TOKEN_TYPE,KEYSYMGROUP +from XKBGrammarLexer import XKBGrammarLexer, SECTION, MAPTYPE, MAPNAME, MAPOPTIONS, MAPMATERIAL, TOKEN_INCLUDE, TOKEN_NAME, TOKEN_KEY_TYPE, TOKEN_KEY, VALUE, KEYCODE, KEYCODEX, KEYSYMS, TOKEN_TYPE,KEYSYMGROUP, OVERRIDE from XKBGrammarParser import XKBGrammarParser from XKBGrammarWalker import XKBGrammarWalker @@ -96,10 +96,14 @@ for section in result.tree.getChildren(): keycode = getChildrenListByType(keyset, KEYCODE) keycodex = getChildrenListByType(keyset, KEYCODEX) keysyms = getChildrenByType(keyset, KEYSYMS) + override = getChildrenListByType(keyset, OVERRIDE) + print '\t', + if len(override) == 1: + print 'override', if len(keycode) == 1: - print '\tkey %(kc)s = { ' % { "kc": keycode[0].getChild(0).getText() }, + print 'key %(kc)s = { ' % { "kc": keycode[0].getChild(0).getText() }, elif len(keycodex) == 1: - print '\tkey <%(kc)s> = { ' % { "kc": keycodex[0].getChild(0).getText() }, + print 'key <%(kc)s> = { ' % { "kc": keycodex[0].getChild(0).getText() }, else: print "\tInternal error keycode/keycodex:", len(keycode), len(keycodex) sys.exit(-1) diff --git a/XKBGrammar/gr b/XKBGrammar/gr @@ -3,8 +3,8 @@ xkb_symbols "extended" { include "gr(basic)" name[Group1] = "Greece-Extended"; key.type[Group1] = "THREE_LEVEL"; // yeah, comment - key <AD01> { type[Group1] = "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC", + override key <AD01> { type[Group1] = "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC", [ U1C9, U1C8], [ any, U1C7 ] }; // q - key <AD02> { type[Group1] = "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC", + override key <AD02> { type[Group1] = "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC", [ U1CC, U1CB, any, U1CA ] }; // w };