keyboardlayouteditor

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

commit 854893f6b0f9e93c9d80d8bc747f9cbb91609715
parent 16639db38edc9a6fd19f4f9432116604698fa148
Author: simos.lists <simos.lists@70737e48-4f4a-0410-8df8-290828ad50c4>
Date:   Thu,  8 May 2008 00:19:19 +0000

Now can parse, then print most layout files

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

Diffstat:
MXKBGrammar/XKBGrammar.g | 67++++++++++++++++++++++++++++++++++++++++++++++++-------------------
MXKBGrammar/XKBGrammar.tokens | 79+++++++++++++++++++++++++++++++++++++++++--------------------------------------
MXKBGrammar/XKBGrammarLexer.py | 531++++++++++++++++++++++++++++++++++++++++++-------------------------------------
MXKBGrammar/XKBGrammarLexer.pyc | 0
MXKBGrammar/XKBGrammarParser.py | 1176+++++++++++++++++++++++++++++++++++++++++++------------------------------------
MXKBGrammar/XKBGrammarParser.pyc | 0
MXKBGrammar/XKBGrammar__.g | 15++++++++-------
MXKBGrammar/check_xkb.py | 16+++-------------
MXKBGrammar/gr | 13+++++--------
9 files changed, 1035 insertions(+), 862 deletions(-)

diff --git a/XKBGrammar/XKBGrammar.g b/XKBGrammar/XKBGrammar.g @@ -22,6 +22,7 @@ tokens TOKEN_KEY_TYPE = 'key.type'; TOKEN_NAME = 'name'; TOKEN_KEY = 'key'; + TOKEN_MODIFIER_MAP = 'modifier_map'; // Punctuators LBRACKET = '['; @@ -43,7 +44,6 @@ tokens ATTRIBUTES; ATTRIBUTE; - KEYCODE; INCLUDE; NAME; KEY; @@ -52,62 +52,91 @@ tokens SECTIONNAME; } -layout : section* EOF! +layout : section* EOF! ; section - : preamble quotedstring LCURLY sectionmaterial+ RCURLY SEMICOLON -> ^(SECTION) + : + preamble sectionmaterial + { print '}' } + -> ^(SECTION) ; -preamble: attribute_xkb+; +preamble : attribute_xkb+ sectionname=quotedstring + { print '%(sname)s {' % { "sname": $sectionname.text } } + ; -quotedstring - : DQUOTE sectionname+=~(DQUOTE)+ DQUOTE -> ^(SECTIONNAME $sectionname) +quotedstring returns [value] + : DQUOTE sectionname+=~(DQUOTE)+ DQUOTE +{ +qstring = ['"'] +for elem in $sectionname: + qstring.append(elem.getText()) +qstring.append('"') +$value = "".join(qstring) +} ; sectionmaterial - : line_include + : LCURLY (line_include | line_name | line_keytype | line_key +// | line_modifiermap + | line_comment)+ RCURLY SEMICOLON ; -// line_comment -// : COMMENT; +line_comment + : COMMENT { skip(); } ; line_include //: KEYWORD_INCLUDE DQUOTE NAME_INCLUDE DQUOTE COMMENT* - : TOKEN_INCLUDE quotedstring + : TOKEN_INCLUDE include=quotedstring + { print '\tinclude %(inc)s' % { "inc": $include.text } } ; line_name - : TOKEN_NAME LBRACKET name=NAME RBRACKET EQUAL quotedstring SEMICOLON + : TOKEN_NAME LBRACKET name=NAME RBRACKET EQUAL nameval=quotedstring SEMICOLON + { print '\tname[\%(name)s] = %(nameval)s;' % { "name": $name.text, "nameval": $nameval.text } } ; line_keytype : TOKEN_KEY_TYPE LBRACKET keytype=NAME RBRACKET EQUAL DQUOTE keytypevalue=NAME DQUOTE SEMICOLON + { print '\tkey.type[\%(kt)s] = \"%(ktv)s\";' % { "kt": $keytype.text, "ktv": $keytypevalue.text } } ; +// line_modifiermap +// : TOKEN_MODIFIER_MAP mapname=NAME mapsyms SEMICOLON +// { print "\tmodifier_map \%(mapname)s %(mapsyms)s ;" % { "mapname": $mapname.text, "mapsyms": $mapsyms.text } } +// ; + line_key : TOKEN_KEY keycode keysyms SEMICOLON + { print "\tkey \%(keycode)s %(keysyms)s ;" % { "keycode": $keycode.text, "keysyms": $keysyms.text } } ; keycode - : LOWERTHAN NAME GREATERTHAN -> ^(INCLUDE NAME) + : LOWERTHAN NAME GREATERTHAN + -> ^(INCLUDE NAME) ; keysyms : LCURLY LBRACKET (NAME|NAME_KEYSYM) (COMMA (NAME|NAME_KEYSYM))* RBRACKET RCURLY ; +// mapsyms +// : LCURLY LBRACKET (NAME|keycode) (COMMA (NAME|keycode))* RBRACKET RCURLY +// ; + attribute_xkb - : TOKEN_DEFAULT - | TOKEN_HIDDEN - | TOKEN_PARTIAL - | TOKEN_ALPHANUMERIC_KEYS - | TOKEN_MODIFIER_KEYS - | TOKEN_ALTERNATE_GROUP - | TOKEN_XKB_SYMBOLS -> ^(ATTRIBUTES ATTRIBUTE) + : TOKEN_DEFAULT { print "default", } + | TOKEN_HIDDEN { print "hidden", } + | TOKEN_PARTIAL { print "partial", } + | TOKEN_ALPHANUMERIC_KEYS { print "alphanumeric_keys", } +// | TOKEN_MODIFIER_KEYS { print "modifier_keys", } + | TOKEN_ALTERNATE_GROUP { print "alternate_group", } + | TOKEN_XKB_SYMBOLS { print "xkb_symbols", } + -> ^(ATTRIBUTES ATTRIBUTE) ; /* diff --git a/XKBGrammar/XKBGrammar.tokens b/XKBGrammar/XKBGrammar.tokens @@ -1,61 +1,64 @@ TOKEN_ALTERNATE_GROUP=9 -ATTRIBUTES=28 -KEYCODE=30 +ATTRIBUTES=29 +SECTION=35 TOKEN_INCLUDE=11 KEY=33 KEYTYPE=34 -ATTRIBUTE=29 +ATTRIBUTE=30 TOKEN_NAME=13 -DQUOTE=20 -LCURLY=17 -SEMICOLON=23 -NAME_INCLUDE=36 -MINUS=21 +DQUOTE=21 +LCURLY=18 +SEMICOLON=24 +TOKEN_MODIFIER_MAP=15 +NAME_INCLUDE=39 +MINUS=22 TOKEN_XKB_SYMBOLS=10 -NAME_KEYSYM=35 -NAME_GROUP=37 -LBRACKET=15 +SECTIONNAME=36 +NAME_KEYSYM=38 +NAME_GROUP=40 +LBRACKET=16 NAME=32 TOKEN_PARTIAL=6 -WS=40 -NEWLINE=39 +WS=42 +NEWLINE=41 TOKEN_ALPHANUMERIC_KEYS=7 TOKEN_HIDDEN=5 -COMMA=19 -LOWERTHAN=25 +COMMA=20 +LOWERTHAN=26 INCLUDE=31 -EQUAL=24 -RCURLY=18 +EQUAL=25 +RCURLY=19 TOKEN_MODIFIER_KEYS=8 -PLUS=22 +PLUS=23 TOKEN_KEY=14 -RBRACKET=16 -COMMENT=38 -DOT=27 +RBRACKET=17 +COMMENT=37 +DOT=28 TOKEN_DEFAULT=4 TOKEN_KEY_TYPE=12 -GREATERTHAN=26 +GREATERTHAN=27 'alphanumeric_keys'=7 -'"'=20 -'}'=18 'alternate_group'=9 -'key'=14 -'partial'=6 -'>'=26 -'{'=17 +'>'=27 'include'=11 'hidden'=5 +';'=24 +'='=25 +'xkb_symbols'=10 +'+'=23 +'.'=28 +'"'=21 +'}'=19 +'key'=14 +'partial'=6 +'{'=18 'modifier_keys'=8 -';'=23 -'='=24 -'<'=25 'key.type'=12 -'xkb_symbols'=10 -'-'=21 -'['=15 -'+'=22 +'<'=26 +'['=16 +'-'=22 'name'=13 -','=19 -'.'=27 +','=20 +'modifier_map'=15 'default'=4 -']'=16 +']'=17 diff --git a/XKBGrammar/XKBGrammarLexer.py b/XKBGrammar/XKBGrammarLexer.py @@ -1,4 +1,4 @@ -# $ANTLR 3.0.1 XKBGrammar.g 2008-04-30 19:41:41 +# $ANTLR 3.0.1 XKBGrammar.g 2008-05-08 01:14:04 from antlr3 import * from antlr3.compat import set, frozenset @@ -8,45 +8,47 @@ from antlr3.compat import set, frozenset HIDDEN = BaseRecognizer.HIDDEN # token types -TOKEN_ALTERNATE_GROUP=9 -ATTRIBUTES=28 +ATTRIBUTES=29 TOKEN_INCLUDE=11 -KEYCODE=30 -KEY=33 -KEYTYPE=34 -ATTRIBUTE=29 -TOKEN_NAME=13 -DQUOTE=20 -LCURLY=17 -SEMICOLON=23 -NAME_INCLUDE=36 -MINUS=21 +ATTRIBUTE=30 +DQUOTE=21 +TOKEN_MODIFIER_MAP=15 TOKEN_XKB_SYMBOLS=10 -Tokens=41 +NAME_INCLUDE=39 EOF=-1 -NAME_KEYSYM=35 -NAME_GROUP=37 -LBRACKET=15 -TOKEN_PARTIAL=6 +SECTIONNAME=36 +NAME_KEYSYM=38 +NAME_GROUP=40 +LBRACKET=16 NAME=32 -WS=40 -TOKEN_HIDDEN=5 -TOKEN_ALPHANUMERIC_KEYS=7 -NEWLINE=39 -COMMA=19 -LOWERTHAN=25 -EQUAL=24 +TOKEN_PARTIAL=6 +COMMA=20 INCLUDE=31 -RCURLY=18 +EQUAL=25 +PLUS=23 +RBRACKET=17 +COMMENT=37 +DOT=28 +TOKEN_DEFAULT=4 +GREATERTHAN=27 +TOKEN_ALTERNATE_GROUP=9 +SECTION=35 +KEY=33 +KEYTYPE=34 +TOKEN_NAME=13 +LCURLY=18 +SEMICOLON=24 +MINUS=22 +Tokens=43 +WS=42 +NEWLINE=41 +TOKEN_ALPHANUMERIC_KEYS=7 +TOKEN_HIDDEN=5 +LOWERTHAN=26 +RCURLY=19 TOKEN_MODIFIER_KEYS=8 -PLUS=22 TOKEN_KEY=14 -RBRACKET=16 -DOT=27 -COMMENT=38 -TOKEN_DEFAULT=4 TOKEN_KEY_TYPE=12 -GREATERTHAN=26 class XKBGrammarLexer(Lexer): @@ -323,14 +325,37 @@ class XKBGrammarLexer(Lexer): + # $ANTLR start TOKEN_MODIFIER_MAP + def mTOKEN_MODIFIER_MAP(self, ): + + try: + self.type = TOKEN_MODIFIER_MAP + + # XKBGrammar.g:18:20: ( 'modifier_map' ) + # XKBGrammar.g:18:22: 'modifier_map' + self.match("modifier_map") + + + + + + + finally: + + pass + + # $ANTLR end TOKEN_MODIFIER_MAP + + + # $ANTLR start LBRACKET def mLBRACKET(self, ): try: self.type = LBRACKET - # XKBGrammar.g:18:10: ( '[' ) - # XKBGrammar.g:18:12: '[' + # XKBGrammar.g:19:10: ( '[' ) + # XKBGrammar.g:19:12: '[' self.match(u'[') @@ -351,8 +376,8 @@ class XKBGrammarLexer(Lexer): try: self.type = RBRACKET - # XKBGrammar.g:19:10: ( ']' ) - # XKBGrammar.g:19:12: ']' + # XKBGrammar.g:20:10: ( ']' ) + # XKBGrammar.g:20:12: ']' self.match(u']') @@ -373,8 +398,8 @@ class XKBGrammarLexer(Lexer): try: self.type = LCURLY - # XKBGrammar.g:20:8: ( '{' ) - # XKBGrammar.g:20:10: '{' + # XKBGrammar.g:21:8: ( '{' ) + # XKBGrammar.g:21:10: '{' self.match(u'{') @@ -395,8 +420,8 @@ class XKBGrammarLexer(Lexer): try: self.type = RCURLY - # XKBGrammar.g:21:8: ( '}' ) - # XKBGrammar.g:21:10: '}' + # XKBGrammar.g:22:8: ( '}' ) + # XKBGrammar.g:22:10: '}' self.match(u'}') @@ -417,8 +442,8 @@ class XKBGrammarLexer(Lexer): try: self.type = COMMA - # XKBGrammar.g:22:7: ( ',' ) - # XKBGrammar.g:22:9: ',' + # XKBGrammar.g:23:7: ( ',' ) + # XKBGrammar.g:23:9: ',' self.match(u',') @@ -439,8 +464,8 @@ class XKBGrammarLexer(Lexer): try: self.type = DQUOTE - # XKBGrammar.g:23:8: ( '\"' ) - # XKBGrammar.g:23:10: '\"' + # XKBGrammar.g:24:8: ( '\"' ) + # XKBGrammar.g:24:10: '\"' self.match(u'"') @@ -461,8 +486,8 @@ class XKBGrammarLexer(Lexer): try: self.type = MINUS - # XKBGrammar.g:24:7: ( '-' ) - # XKBGrammar.g:24:9: '-' + # XKBGrammar.g:25:7: ( '-' ) + # XKBGrammar.g:25:9: '-' self.match(u'-') @@ -483,8 +508,8 @@ class XKBGrammarLexer(Lexer): try: self.type = PLUS - # XKBGrammar.g:25:6: ( '+' ) - # XKBGrammar.g:25:8: '+' + # XKBGrammar.g:26:6: ( '+' ) + # XKBGrammar.g:26:8: '+' self.match(u'+') @@ -505,8 +530,8 @@ class XKBGrammarLexer(Lexer): try: self.type = SEMICOLON - # XKBGrammar.g:26:11: ( ';' ) - # XKBGrammar.g:26:13: ';' + # XKBGrammar.g:27:11: ( ';' ) + # XKBGrammar.g:27:13: ';' self.match(u';') @@ -527,8 +552,8 @@ class XKBGrammarLexer(Lexer): try: self.type = EQUAL - # XKBGrammar.g:27:7: ( '=' ) - # XKBGrammar.g:27:9: '=' + # XKBGrammar.g:28:7: ( '=' ) + # XKBGrammar.g:28:9: '=' self.match(u'=') @@ -549,8 +574,8 @@ class XKBGrammarLexer(Lexer): try: self.type = LOWERTHAN - # XKBGrammar.g:28:11: ( '<' ) - # XKBGrammar.g:28:13: '<' + # XKBGrammar.g:29:11: ( '<' ) + # XKBGrammar.g:29:13: '<' self.match(u'<') @@ -571,8 +596,8 @@ class XKBGrammarLexer(Lexer): try: self.type = GREATERTHAN - # XKBGrammar.g:29:13: ( '>' ) - # XKBGrammar.g:29:15: '>' + # XKBGrammar.g:30:13: ( '>' ) + # XKBGrammar.g:30:15: '>' self.match(u'>') @@ -593,8 +618,8 @@ class XKBGrammarLexer(Lexer): try: self.type = DOT - # XKBGrammar.g:30:5: ( '.' ) - # XKBGrammar.g:30:7: '.' + # XKBGrammar.g:31:5: ( '.' ) + # XKBGrammar.g:31:7: '.' self.match(u'.') @@ -615,8 +640,8 @@ class XKBGrammarLexer(Lexer): try: self.type = NAME - # XKBGrammar.g:124:2: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) - # XKBGrammar.g:124:4: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* + # XKBGrammar.g:155:2: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) + # XKBGrammar.g:155:4: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* if (u'A' <= self.input.LA(1) <= u'Z') or self.input.LA(1) == u'_' or (u'a' <= self.input.LA(1) <= u'z'): self.input.consume(); @@ -626,7 +651,7 @@ class XKBGrammarLexer(Lexer): raise mse - # XKBGrammar.g:124:27: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* + # XKBGrammar.g:155:27: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* while True: #loop1 alt1 = 2 LA1_0 = self.input.LA(1) @@ -670,8 +695,8 @@ class XKBGrammarLexer(Lexer): try: self.type = NAME_INCLUDE - # XKBGrammar.g:128:2: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '(' | ')' | '0' .. '9' )* ) - # XKBGrammar.g:128:4: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '(' | ')' | '0' .. '9' )* + # XKBGrammar.g:159:2: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '(' | ')' | '0' .. '9' )* ) + # XKBGrammar.g:159:4: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '(' | ')' | '0' .. '9' )* if (u'A' <= self.input.LA(1) <= u'Z') or self.input.LA(1) == u'_' or (u'a' <= self.input.LA(1) <= u'z'): self.input.consume(); @@ -681,7 +706,7 @@ class XKBGrammarLexer(Lexer): raise mse - # XKBGrammar.g:128:27: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '(' | ')' | '0' .. '9' )* + # XKBGrammar.g:159:27: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '(' | ')' | '0' .. '9' )* while True: #loop2 alt2 = 2 LA2_0 = self.input.LA(1) @@ -725,8 +750,8 @@ class XKBGrammarLexer(Lexer): try: self.type = NAME_KEYSYM - # XKBGrammar.g:132:2: ( ( '0' .. '9' | 'a' .. 'z' | 'A' .. 'Z' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) - # XKBGrammar.g:132:4: ( '0' .. '9' | 'a' .. 'z' | 'A' .. 'Z' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* + # XKBGrammar.g:163:2: ( ( '0' .. '9' | 'a' .. 'z' | 'A' .. 'Z' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) + # XKBGrammar.g:163:4: ( '0' .. '9' | 'a' .. 'z' | 'A' .. 'Z' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* if (u'0' <= self.input.LA(1) <= u'9') or (u'A' <= self.input.LA(1) <= u'Z') or (u'a' <= self.input.LA(1) <= u'z'): self.input.consume(); @@ -736,7 +761,7 @@ class XKBGrammarLexer(Lexer): raise mse - # XKBGrammar.g:132:32: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* + # XKBGrammar.g:163:32: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* while True: #loop3 alt3 = 2 LA3_0 = self.input.LA(1) @@ -780,8 +805,8 @@ class XKBGrammarLexer(Lexer): try: self.type = NAME_GROUP - # XKBGrammar.g:136:2: ( ( '0' .. '9' | 'a' .. 'z' | 'A' .. 'Z' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '-' | '.' | '0' .. '9' )* ) - # XKBGrammar.g:136:4: ( '0' .. '9' | 'a' .. 'z' | 'A' .. 'Z' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '-' | '.' | '0' .. '9' )* + # XKBGrammar.g:167:2: ( ( '0' .. '9' | 'a' .. 'z' | 'A' .. 'Z' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '-' | '.' | '0' .. '9' )* ) + # XKBGrammar.g:167:4: ( '0' .. '9' | 'a' .. 'z' | 'A' .. 'Z' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '-' | '.' | '0' .. '9' )* if (u'0' <= self.input.LA(1) <= u'9') or (u'A' <= self.input.LA(1) <= u'Z') or (u'a' <= self.input.LA(1) <= u'z'): self.input.consume(); @@ -791,7 +816,7 @@ class XKBGrammarLexer(Lexer): raise mse - # XKBGrammar.g:136:32: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '-' | '.' | '0' .. '9' )* + # XKBGrammar.g:167:32: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '-' | '.' | '0' .. '9' )* while True: #loop4 alt4 = 2 LA4_0 = self.input.LA(1) @@ -835,12 +860,12 @@ class XKBGrammarLexer(Lexer): try: self.type = COMMENT - # XKBGrammar.g:139:9: ( '//' (~ ( '\\n' | '\\r' ) )* ) - # XKBGrammar.g:139:11: '//' (~ ( '\\n' | '\\r' ) )* + # XKBGrammar.g:170:9: ( '//' (~ ( '\\n' | '\\r' ) )* ) + # XKBGrammar.g:170:11: '//' (~ ( '\\n' | '\\r' ) )* self.match("//") - # XKBGrammar.g:139:16: (~ ( '\\n' | '\\r' ) )* + # XKBGrammar.g:170:16: (~ ( '\\n' | '\\r' ) )* while True: #loop5 alt5 = 2 LA5_0 = self.input.LA(1) @@ -850,7 +875,7 @@ class XKBGrammarLexer(Lexer): if alt5 == 1: - # XKBGrammar.g:139:17: ~ ( '\\n' | '\\r' ) + # XKBGrammar.g:170:17: ~ ( '\\n' | '\\r' ) if (u'\u0000' <= self.input.LA(1) <= u'\t') or (u'\u000B' <= self.input.LA(1) <= u'\f') or (u'\u000E' <= self.input.LA(1) <= u'\uFFFE'): self.input.consume(); @@ -887,9 +912,9 @@ class XKBGrammarLexer(Lexer): try: self.type = WS - # XKBGrammar.g:143:9: ( ( '\\t' | ' ' | NEWLINE )+ ) - # XKBGrammar.g:143:17: ( '\\t' | ' ' | NEWLINE )+ - # XKBGrammar.g:143:17: ( '\\t' | ' ' | NEWLINE )+ + # XKBGrammar.g:174:9: ( ( '\\t' | ' ' | NEWLINE )+ ) + # XKBGrammar.g:174:17: ( '\\t' | ' ' | NEWLINE )+ + # XKBGrammar.g:174:17: ( '\\t' | ' ' | NEWLINE )+ cnt6 = 0 while True: #loop6 alt6 = 2 @@ -941,7 +966,7 @@ class XKBGrammarLexer(Lexer): def mNEWLINE(self, ): try: - # XKBGrammar.g:148:9: ( '\\r' | '\\n' ) + # XKBGrammar.g:179:9: ( '\\r' | '\\n' ) # XKBGrammar.g: if self.input.LA(1) == u'\n' or self.input.LA(1) == u'\r': self.input.consume(); @@ -965,8 +990,8 @@ class XKBGrammarLexer(Lexer): def mTokens(self): - # XKBGrammar.g:1:8: ( TOKEN_DEFAULT | TOKEN_HIDDEN | TOKEN_PARTIAL | TOKEN_ALPHANUMERIC_KEYS | TOKEN_MODIFIER_KEYS | TOKEN_ALTERNATE_GROUP | TOKEN_XKB_SYMBOLS | TOKEN_INCLUDE | TOKEN_KEY_TYPE | TOKEN_NAME | TOKEN_KEY | LBRACKET | RBRACKET | LCURLY | RCURLY | COMMA | DQUOTE | MINUS | PLUS | SEMICOLON | EQUAL | LOWERTHAN | GREATERTHAN | DOT | NAME | NAME_INCLUDE | NAME_KEYSYM | NAME_GROUP | COMMENT | WS ) - alt7 = 30 + # XKBGrammar.g:1:8: ( TOKEN_DEFAULT | TOKEN_HIDDEN | TOKEN_PARTIAL | TOKEN_ALPHANUMERIC_KEYS | TOKEN_MODIFIER_KEYS | TOKEN_ALTERNATE_GROUP | TOKEN_XKB_SYMBOLS | TOKEN_INCLUDE | TOKEN_KEY_TYPE | TOKEN_NAME | TOKEN_KEY | TOKEN_MODIFIER_MAP | LBRACKET | RBRACKET | LCURLY | RCURLY | COMMA | DQUOTE | MINUS | PLUS | SEMICOLON | EQUAL | LOWERTHAN | GREATERTHAN | DOT | NAME | NAME_INCLUDE | NAME_KEYSYM | NAME_GROUP | COMMENT | WS ) + alt7 = 31 alt7 = self.dfa7.predict(self.input) if alt7 == 1: # XKBGrammar.g:1:10: TOKEN_DEFAULT @@ -1035,115 +1060,121 @@ class XKBGrammarLexer(Lexer): elif alt7 == 12: - # XKBGrammar.g:1:185: LBRACKET - self.mLBRACKET() + # XKBGrammar.g:1:185: TOKEN_MODIFIER_MAP + self.mTOKEN_MODIFIER_MAP() elif alt7 == 13: - # XKBGrammar.g:1:194: RBRACKET - self.mRBRACKET() + # XKBGrammar.g:1:204: LBRACKET + self.mLBRACKET() elif alt7 == 14: - # XKBGrammar.g:1:203: LCURLY - self.mLCURLY() + # XKBGrammar.g:1:213: RBRACKET + self.mRBRACKET() elif alt7 == 15: - # XKBGrammar.g:1:210: RCURLY - self.mRCURLY() + # XKBGrammar.g:1:222: LCURLY + self.mLCURLY() elif alt7 == 16: - # XKBGrammar.g:1:217: COMMA - self.mCOMMA() + # XKBGrammar.g:1:229: RCURLY + self.mRCURLY() elif alt7 == 17: - # XKBGrammar.g:1:223: DQUOTE - self.mDQUOTE() + # XKBGrammar.g:1:236: COMMA + self.mCOMMA() elif alt7 == 18: - # XKBGrammar.g:1:230: MINUS - self.mMINUS() + # XKBGrammar.g:1:242: DQUOTE + self.mDQUOTE() elif alt7 == 19: - # XKBGrammar.g:1:236: PLUS - self.mPLUS() + # XKBGrammar.g:1:249: MINUS + self.mMINUS() elif alt7 == 20: - # XKBGrammar.g:1:241: SEMICOLON - self.mSEMICOLON() + # XKBGrammar.g:1:255: PLUS + self.mPLUS() elif alt7 == 21: - # XKBGrammar.g:1:251: EQUAL - self.mEQUAL() + # XKBGrammar.g:1:260: SEMICOLON + self.mSEMICOLON() elif alt7 == 22: - # XKBGrammar.g:1:257: LOWERTHAN - self.mLOWERTHAN() + # XKBGrammar.g:1:270: EQUAL + self.mEQUAL() elif alt7 == 23: - # XKBGrammar.g:1:267: GREATERTHAN - self.mGREATERTHAN() + # XKBGrammar.g:1:276: LOWERTHAN + self.mLOWERTHAN() elif alt7 == 24: - # XKBGrammar.g:1:279: DOT - self.mDOT() + # XKBGrammar.g:1:286: GREATERTHAN + self.mGREATERTHAN() elif alt7 == 25: - # XKBGrammar.g:1:283: NAME - self.mNAME() + # XKBGrammar.g:1:298: DOT + self.mDOT() elif alt7 == 26: - # XKBGrammar.g:1:288: NAME_INCLUDE - self.mNAME_INCLUDE() + # XKBGrammar.g:1:302: NAME + self.mNAME() elif alt7 == 27: - # XKBGrammar.g:1:301: NAME_KEYSYM - self.mNAME_KEYSYM() + # XKBGrammar.g:1:307: NAME_INCLUDE + self.mNAME_INCLUDE() elif alt7 == 28: - # XKBGrammar.g:1:313: NAME_GROUP - self.mNAME_GROUP() + # XKBGrammar.g:1:320: NAME_KEYSYM + self.mNAME_KEYSYM() elif alt7 == 29: - # XKBGrammar.g:1:324: COMMENT - self.mCOMMENT() + # XKBGrammar.g:1:332: NAME_GROUP + self.mNAME_GROUP() elif alt7 == 30: - # XKBGrammar.g:1:332: WS + # XKBGrammar.g:1:343: COMMENT + self.mCOMMENT() + + + + elif alt7 == 31: + # XKBGrammar.g:1:351: WS self.mWS() @@ -1157,40 +1188,41 @@ class XKBGrammarLexer(Lexer): DFA7_eot = DFA.unpack( u"\1\uffff\11\36\15\uffff\2\36\1\53\2\uffff\2\36\3\uffff\11\36\1" - u"\53\1\uffff\10\36\1\77\11\36\1\37\1\uffff\1\112\10\36\1\37\1\uffff" - u"\1\36\1\125\6\36\1\37\1\135\1\uffff\1\136\4\36\1\143\1\37\2\uffff" - u"\4\36\1\uffff\1\151\4\36\1\uffff\7\36\1\165\3\36\1\uffff\2\36\1" - u"\173\2\36\1\uffff\1\36\1\177\1\36\1\uffff\1\u0081\1\uffff" + u"\53\1\uffff\10\36\1\77\11\36\1\40\1\uffff\1\112\10\36\1\40\1\uffff" + u"\1\36\1\125\6\36\1\40\1\135\1\uffff\1\136\4\36\1\143\1\40\2\uffff" + u"\4\36\1\uffff\1\151\4\36\1\uffff\11\36\1\170\2\36\1\173\1\36\1" + u"\uffff\2\36\1\uffff\1\177\2\36\1\uffff\1\36\1\u0083\1\36\1\uffff" + u"\1\u0085\1\uffff" ) DFA7_eof = DFA.unpack( - u"\u0082\uffff" + u"\u0086\uffff" ) DFA7_min = DFA.unpack( u"\1\11\11\50\15\uffff\2\50\1\55\2\uffff\2\50\3\uffff\11\50\1\55" u"\1\uffff\22\50\1\164\1\uffff\11\50\1\171\1\uffff\10\50\1\160\1" - u"\50\1\uffff\6\50\1\145\2\uffff\4\50\1\uffff\1\55\4\50\1\uffff\13" - u"\50\1\uffff\5\50\1\uffff\3\50\1\uffff\1\50\1\uffff" + u"\50\1\uffff\6\50\1\145\2\uffff\4\50\1\uffff\1\55\4\50\1\uffff\16" + u"\50\1\uffff\2\50\1\uffff\3\50\1\uffff\3\50\1\uffff\1\50\1\uffff" ) DFA7_max = DFA.unpack( u"\1\175\11\172\15\uffff\3\172\2\uffff\2\172\3\uffff\12\172\1\uffff" u"\22\172\1\164\1\uffff\11\172\1\171\1\uffff\10\172\1\160\1\172\1" - u"\uffff\6\172\1\145\2\uffff\4\172\1\uffff\5\172\1\uffff\13\172\1" - u"\uffff\5\172\1\uffff\3\172\1\uffff\1\172\1\uffff" + u"\uffff\6\172\1\145\2\uffff\4\172\1\uffff\5\172\1\uffff\16\172\1" + u"\uffff\2\172\1\uffff\3\172\1\uffff\3\172\1\uffff\1\172\1\uffff" ) DFA7_accept = DFA.unpack( - u"\12\uffff\1\14\1\15\1\16\1\17\1\20\1\21\1\22\1\23\1\24\1\25\1\26" - u"\1\27\1\30\3\uffff\1\35\1\36\2\uffff\1\31\1\34\1\32\12\uffff\1" - u"\33\23\uffff\1\13\12\uffff\1\12\12\uffff\1\2\7\uffff\1\1\1\3\4" - u"\uffff\1\10\5\uffff\1\11\13\uffff\1\7\5\uffff\1\5\3\uffff\1\6\1" - u"\uffff\1\4" + u"\12\uffff\1\15\1\16\1\17\1\20\1\21\1\22\1\23\1\24\1\25\1\26\1\27" + u"\1\30\1\31\3\uffff\1\36\1\37\2\uffff\1\32\1\33\1\35\12\uffff\1" + u"\34\23\uffff\1\13\12\uffff\1\12\12\uffff\1\2\7\uffff\1\1\1\3\4" + u"\uffff\1\10\5\uffff\1\11\16\uffff\1\7\2\uffff\1\14\3\uffff\1\5" + u"\3\uffff\1\6\1\uffff\1\4" ) DFA7_special = DFA.unpack( - u"\u0082\uffff" + u"\u0086\uffff" ) @@ -1200,23 +1232,23 @@ class XKBGrammarLexer(Lexer): u"\32\27\1\12\1\uffff\1\13\1\uffff\1\30\1\uffff\1\4\2\27\1\1\3\27" u"\1\2\1\7\1\27\1\10\1\27\1\5\1\11\1\27\1\3\7\27\1\6\2\27\1\14\1" u"\uffff\1\15"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\4\35\1\34\25\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\10\35\1\41\21\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\1\42\31\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\13\35\1\43\16\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\16\35\1\44\13\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\12\35\1\45\17\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\15\35\1\46\14\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\4\35\1\47\25\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\1\50\31\35"), DFA.unpack(u""), DFA.unpack(u""), @@ -1231,197 +1263,204 @@ class XKBGrammarLexer(Lexer): DFA.unpack(u""), DFA.unpack(u""), DFA.unpack(u""), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\32\35"), - DFA.unpack(u"\2\40\6\uffff\12\51\7\uffff\32\51\4\uffff\1\51\1\uffff" + DFA.unpack(u"\2\37\6\uffff\12\51\7\uffff\32\51\4\uffff\1\51\1\uffff" u"\32\51"), - DFA.unpack(u"\2\37\1\uffff\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff" + DFA.unpack(u"\2\40\1\uffff\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff" u"\32\52"), DFA.unpack(u""), DFA.unpack(u""), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\5\35\1\54\24\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\32\35"), DFA.unpack(u""), DFA.unpack(u""), DFA.unpack(u""), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\3\35\1\55\26\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\21\35\1\56\10\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\17\35\1\57\3\35\1\60\6\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\3\35\1\61\26\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\1\35\1\62\30\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\2\35\1\63\27\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\30\35\1\64\1\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\14\35\1\65\15\35"), - DFA.unpack(u"\2\40\6\uffff\12\51\7\uffff\32\51\4\uffff\1\51\1\uffff" + DFA.unpack(u"\2\37\6\uffff\12\51\7\uffff\32\51\4\uffff\1\51\1\uffff" u"\32\51"), - DFA.unpack(u"\2\37\1\uffff\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff" + DFA.unpack(u"\2\40\1\uffff\12\52\7\uffff\32\52\4\uffff\1\52\1\uffff" u"\32\52"), DFA.unpack(u""), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\1\66\31\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\3\35\1\67\26\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\23\35\1\70\6\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\7\35\1\71\22\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\4\35\1\72\25\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\10\35\1\73\21\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\74\1\uffff\32\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\13\35\1\75\16\35"), - DFA.unpack(u"\2\40\3\uffff\1\37\1\76\1\uffff\12\35\7\uffff\32\35" + DFA.unpack(u"\2\37\3\uffff\1\40\1\76\1\uffff\12\35\7\uffff\32\35" u"\4\uffff\1\35\1\uffff\32\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\4\35\1\100\25\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\24\35\1\101\5\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\4\35\1\102\25\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\10\35\1\103\21\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\1\104\31\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\21\35\1\105\10\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\5\35\1\106\24\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\22\35\1\107\7\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\24\35\1\110\5\35"), DFA.unpack(u"\1\111"), DFA.unpack(u""), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\32\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\13\35\1\113\16\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\15\35\1\114\14\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\1\115\31\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\15\35\1\116\14\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\15\35\1\117\14\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\10\35\1\120\21\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\30\35\1\121\1\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\3\35\1\122\26\35"), DFA.unpack(u"\1\123"), DFA.unpack(u""), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\23\35\1\124\6\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\32\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\13\35\1\126\16\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\24\35\1\127\5\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\1\130\31\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\4\35\1\131\25\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\14\35\1\132\15\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\4\35\1\133\25\35"), DFA.unpack(u"\1\134"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\32\35"), DFA.unpack(u""), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\32\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\14\35\1\137\15\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\23\35\1\140\6\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\21\35\1\141\10\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\1\35\1\142\30\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\32\35"), DFA.unpack(u"\1\144"), DFA.unpack(u""), DFA.unpack(u""), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\4\35\1\145\25\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\4\35\1\146\25\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\147\1\uffff\32\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\16\35\1\150\13\35"), DFA.unpack(u""), - DFA.unpack(u"\2\37\1\uffff\12\37\7\uffff\32\37\4\uffff\1\37\1\uffff" - u"\32\37"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\40\1\uffff\12\40\7\uffff\32\40\4\uffff\1\40\1\uffff" + u"\32\40"), + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\21\35\1\152\10\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\153\1\uffff\32\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" - u"\1\35\1\uffff\12\35\1\154\17\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" - u"\1\35\1\uffff\13\35\1\155\16\35"), + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" + u"\1\35\1\uffff\12\35\1\155\1\35\1\154\15\35"), + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" + u"\1\35\1\uffff\13\35\1\156\16\35"), DFA.unpack(u""), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" - u"\1\35\1\uffff\10\35\1\156\21\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" - u"\1\35\1\uffff\6\35\1\157\23\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" - u"\1\35\1\uffff\4\35\1\160\25\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" - u"\1\35\1\uffff\22\35\1\161\7\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" - u"\1\35\1\uffff\2\35\1\162\27\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" - u"\1\35\1\uffff\21\35\1\163\10\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" - u"\1\35\1\uffff\30\35\1\164\1\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" + u"\1\35\1\uffff\10\35\1\157\21\35"), + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" + u"\1\35\1\uffff\6\35\1\160\23\35"), + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" + u"\1\35\1\uffff\1\161\31\35"), + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" + u"\1\35\1\uffff\4\35\1\162\25\35"), + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" + u"\1\35\1\uffff\22\35\1\163\7\35"), + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" + u"\1\35\1\uffff\2\35\1\164\27\35"), + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" + u"\1\35\1\uffff\21\35\1\165\10\35"), + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" + u"\1\35\1\uffff\17\35\1\166\12\35"), + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" + u"\1\35\1\uffff\30\35\1\167\1\35"), + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\32\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" - u"\1\166\1\uffff\32\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" - u"\1\35\1\uffff\16\35\1\167\13\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" - u"\1\35\1\uffff\22\35\1\170\7\35"), + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" + u"\1\171\1\uffff\32\35"), + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" + u"\1\35\1\uffff\16\35\1\172\13\35"), + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" + u"\1\35\1\uffff\32\35"), + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" + u"\1\35\1\uffff\22\35\1\174\7\35"), + DFA.unpack(u""), + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" + u"\1\35\1\uffff\12\35\1\175\17\35"), + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" + u"\1\35\1\uffff\24\35\1\176\5\35"), DFA.unpack(u""), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" - u"\1\35\1\uffff\12\35\1\171\17\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" - u"\1\35\1\uffff\24\35\1\172\5\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\32\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" - u"\1\35\1\uffff\4\35\1\174\25\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" - u"\1\35\1\uffff\17\35\1\175\12\35"), + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" + u"\1\35\1\uffff\4\35\1\u0080\25\35"), + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" + u"\1\35\1\uffff\17\35\1\u0081\12\35"), DFA.unpack(u""), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" - u"\1\35\1\uffff\30\35\1\176\1\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" + u"\1\35\1\uffff\30\35\1\u0082\1\35"), + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\32\35"), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" - u"\1\35\1\uffff\22\35\1\u0080\7\35"), + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" + u"\1\35\1\uffff\22\35\1\u0084\7\35"), DFA.unpack(u""), - DFA.unpack(u"\2\40\3\uffff\2\37\1\uffff\12\35\7\uffff\32\35\4\uffff" + DFA.unpack(u"\2\37\3\uffff\2\40\1\uffff\12\35\7\uffff\32\35\4\uffff" u"\1\35\1\uffff\32\35"), 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.0.1 XKBGrammar.g 2008-04-30 19:41:41 +# $ANTLR 3.0.1 XKBGrammar.g 2008-05-08 01:14:03 from antlr3 import * from antlr3.compat import set, frozenset @@ -12,54 +12,56 @@ HIDDEN = BaseRecognizer.HIDDEN # token types TOKEN_ALTERNATE_GROUP=9 -ATTRIBUTES=28 -KEYCODE=30 +ATTRIBUTES=29 +SECTION=35 TOKEN_INCLUDE=11 KEY=33 KEYTYPE=34 -ATTRIBUTE=29 +ATTRIBUTE=30 TOKEN_NAME=13 -DQUOTE=20 -LCURLY=17 -SEMICOLON=23 -NAME_INCLUDE=36 -MINUS=21 +DQUOTE=21 +LCURLY=18 +SEMICOLON=24 +TOKEN_MODIFIER_MAP=15 +NAME_INCLUDE=39 +MINUS=22 TOKEN_XKB_SYMBOLS=10 EOF=-1 -NAME_KEYSYM=35 -NAME_GROUP=37 -LBRACKET=15 +SECTIONNAME=36 +NAME_KEYSYM=38 +NAME_GROUP=40 +LBRACKET=16 NAME=32 TOKEN_PARTIAL=6 -WS=40 -NEWLINE=39 +WS=42 +NEWLINE=41 TOKEN_ALPHANUMERIC_KEYS=7 TOKEN_HIDDEN=5 -COMMA=19 -LOWERTHAN=25 +COMMA=20 +LOWERTHAN=26 INCLUDE=31 -EQUAL=24 -RCURLY=18 +EQUAL=25 +RCURLY=19 TOKEN_MODIFIER_KEYS=8 -PLUS=22 +PLUS=23 TOKEN_KEY=14 -RBRACKET=16 -COMMENT=38 -DOT=27 +RBRACKET=17 +COMMENT=37 +DOT=28 TOKEN_DEFAULT=4 TOKEN_KEY_TYPE=12 -GREATERTHAN=26 +GREATERTHAN=27 # token names tokenNames = [ "<invalid>", "<EOR>", "<DOWN>", "<UP>", "TOKEN_DEFAULT", "TOKEN_HIDDEN", "TOKEN_PARTIAL", "TOKEN_ALPHANUMERIC_KEYS", "TOKEN_MODIFIER_KEYS", "TOKEN_ALTERNATE_GROUP", "TOKEN_XKB_SYMBOLS", - "TOKEN_INCLUDE", "TOKEN_KEY_TYPE", "TOKEN_NAME", "TOKEN_KEY", "LBRACKET", - "RBRACKET", "LCURLY", "RCURLY", "COMMA", "DQUOTE", "MINUS", "PLUS", - "SEMICOLON", "EQUAL", "LOWERTHAN", "GREATERTHAN", "DOT", "ATTRIBUTES", - "ATTRIBUTE", "KEYCODE", "INCLUDE", "NAME", "KEY", "KEYTYPE", "NAME_KEYSYM", - "NAME_INCLUDE", "NAME_GROUP", "COMMENT", "NEWLINE", "WS" + "TOKEN_INCLUDE", "TOKEN_KEY_TYPE", "TOKEN_NAME", "TOKEN_KEY", "TOKEN_MODIFIER_MAP", + "LBRACKET", "RBRACKET", "LCURLY", "RCURLY", "COMMA", "DQUOTE", "MINUS", + "PLUS", "SEMICOLON", "EQUAL", "LOWERTHAN", "GREATERTHAN", "DOT", "ATTRIBUTES", + "ATTRIBUTE", "INCLUDE", "NAME", "KEY", "KEYTYPE", "SECTION", "SECTIONNAME", + "COMMENT", "NAME_KEYSYM", "NAME_INCLUDE", "NAME_GROUP", "NEWLINE", "WS" ] @@ -88,7 +90,7 @@ class XKBGrammarParser(Parser): # $ANTLR start layout - # XKBGrammar.g:53:1: layout : ( statement )* EOF ; + # XKBGrammar.g:55:1: layout : ( section )* EOF ; def layout(self, ): retval = self.layout_return() @@ -97,33 +99,33 @@ class XKBGrammarParser(Parser): root_0 = None EOF2 = None - statement1 = None + section1 = None EOF2_tree = None try: try: - # XKBGrammar.g:53:9: ( ( statement )* EOF ) - # XKBGrammar.g:53:11: ( statement )* EOF + # XKBGrammar.g:55:9: ( ( section )* EOF ) + # XKBGrammar.g:55:11: ( section )* EOF root_0 = self.adaptor.nil() - # XKBGrammar.g:53:11: ( statement )* + # XKBGrammar.g:55:11: ( section )* while True: #loop1 alt1 = 2 LA1_0 = self.input.LA(1) - if ((TOKEN_DEFAULT <= LA1_0 <= TOKEN_XKB_SYMBOLS)) : + if ((TOKEN_DEFAULT <= LA1_0 <= TOKEN_ALPHANUMERIC_KEYS) or (TOKEN_ALTERNATE_GROUP <= LA1_0 <= TOKEN_XKB_SYMBOLS)) : alt1 = 1 if alt1 == 1: - # XKBGrammar.g:53:11: statement - self.following.append(self.FOLLOW_statement_in_layout336) - statement1 = self.statement() + # XKBGrammar.g:55:11: section + self.following.append(self.FOLLOW_section_in_layout349) + section1 = self.section() self.following.pop() - self.adaptor.addChild(root_0, statement1.tree) + self.adaptor.addChild(root_0, section1.tree) else: @@ -131,7 +133,7 @@ class XKBGrammarParser(Parser): EOF2 = self.input.LT(1) - self.match(self.input, EOF, self.FOLLOW_EOF_in_layout339) + self.match(self.input, EOF, self.FOLLOW_EOF_in_layout352) @@ -153,7 +155,7 @@ class XKBGrammarParser(Parser): # $ANTLR end layout - class statement_return(object): + class section_return(object): def __init__(self): self.start = None self.stop = None @@ -161,94 +163,63 @@ class XKBGrammarParser(Parser): self.tree = None - # $ANTLR start statement - # XKBGrammar.g:56:1: statement : preamble quotedstring LCURLY ( sectionmaterial )+ RCURLY SEMICOLON ; - def statement(self, ): + # $ANTLR start section + # XKBGrammar.g:58:1: section : preamble sectionmaterial -> ^( SECTION ) ; + def section(self, ): - retval = self.statement_return() + retval = self.section_return() retval.start = self.input.LT(1) root_0 = None - LCURLY5 = None - RCURLY7 = None - SEMICOLON8 = None preamble3 = None - quotedstring4 = None + sectionmaterial4 = None - sectionmaterial6 = None - - - LCURLY5_tree = None - RCURLY7_tree = None - SEMICOLON8_tree = None + stream_preamble = RewriteRuleSubtreeStream(self.adaptor, "rule preamble") + stream_sectionmaterial = RewriteRuleSubtreeStream(self.adaptor, "rule sectionmaterial") try: try: - # XKBGrammar.g:57:2: ( preamble quotedstring LCURLY ( sectionmaterial )+ RCURLY SEMICOLON ) - # XKBGrammar.g:57:4: preamble quotedstring LCURLY ( sectionmaterial )+ RCURLY SEMICOLON - root_0 = self.adaptor.nil() - - self.following.append(self.FOLLOW_preamble_in_statement352) + # XKBGrammar.g:59:2: ( preamble sectionmaterial -> ^( SECTION ) ) + # XKBGrammar.g:60:2: preamble sectionmaterial + self.following.append(self.FOLLOW_preamble_in_section368) preamble3 = self.preamble() self.following.pop() - self.adaptor.addChild(root_0, preamble3.tree) - self.following.append(self.FOLLOW_quotedstring_in_statement354) - quotedstring4 = self.quotedstring() + stream_preamble.add(preamble3.tree) + self.following.append(self.FOLLOW_sectionmaterial_in_section370) + sectionmaterial4 = self.sectionmaterial() self.following.pop() - self.adaptor.addChild(root_0, quotedstring4.tree) - LCURLY5 = self.input.LT(1) - self.match(self.input, LCURLY, self.FOLLOW_LCURLY_in_statement356) - - - LCURLY5_tree = self.adaptor.createWithPayload(LCURLY5) - self.adaptor.addChild(root_0, LCURLY5_tree) - - # XKBGrammar.g:57:33: ( sectionmaterial )+ - cnt2 = 0 - while True: #loop2 - alt2 = 2 - LA2_0 = self.input.LA(1) - - if ((TOKEN_INCLUDE <= LA2_0 <= TOKEN_KEY)) : - alt2 = 1 - - - if alt2 == 1: - # XKBGrammar.g:57:33: sectionmaterial - self.following.append(self.FOLLOW_sectionmaterial_in_statement358) - sectionmaterial6 = self.sectionmaterial() - self.following.pop() - - self.adaptor.addChild(root_0, sectionmaterial6.tree) - - - else: - if cnt2 >= 1: - break #loop2 - - eee = EarlyExitException(2, self.input) - raise eee - - cnt2 += 1 + stream_sectionmaterial.add(sectionmaterial4.tree) + #action start + print '}' + #action end + # AST Rewrite + # elements: + # token labels: + # rule labels: retval + # token list labels: + # rule list labels: + retval.tree = root_0 - RCURLY7 = self.input.LT(1) - self.match(self.input, RCURLY, self.FOLLOW_RCURLY_in_statement361) + if retval is not None: + stream_retval = RewriteRuleSubtreeStream(self.adaptor, "token retval", retval.tree) + else: + stream_retval = RewriteRuleSubtreeStream(self.adaptor, "token retval", None) - RCURLY7_tree = self.adaptor.createWithPayload(RCURLY7) - self.adaptor.addChild(root_0, RCURLY7_tree) + root_0 = self.adaptor.nil() + # 62:2: -> ^( SECTION ) + # XKBGrammar.g:62:5: ^( SECTION ) + root_1 = self.adaptor.nil() + root_1 = self.adaptor.becomeRoot(self.adaptor.createFromType(SECTION, "SECTION"), root_1) - SEMICOLON8 = self.input.LT(1) - self.match(self.input, SEMICOLON, self.FOLLOW_SEMICOLON_in_statement363) + self.adaptor.addChild(root_0, root_1) - SEMICOLON8_tree = self.adaptor.createWithPayload(SEMICOLON8) - self.adaptor.addChild(root_0, SEMICOLON8_tree) @@ -268,7 +239,7 @@ class XKBGrammarParser(Parser): return retval - # $ANTLR end statement + # $ANTLR end section class preamble_return(object): def __init__(self): @@ -279,7 +250,7 @@ class XKBGrammarParser(Parser): # $ANTLR start preamble - # XKBGrammar.g:60:1: preamble : ( attribute_xkb )+ ; + # XKBGrammar.g:65:1: preamble : ( attribute_xkb )+ sectionname= quotedstring ; def preamble(self, ): retval = self.preamble_return() @@ -287,45 +258,55 @@ class XKBGrammarParser(Parser): root_0 = None - attribute_xkb9 = None + sectionname = None + + attribute_xkb5 = None try: try: - # XKBGrammar.g:60:9: ( ( attribute_xkb )+ ) - # XKBGrammar.g:60:11: ( attribute_xkb )+ + # XKBGrammar.g:65:10: ( ( attribute_xkb )+ sectionname= quotedstring ) + # XKBGrammar.g:65:12: ( attribute_xkb )+ sectionname= quotedstring root_0 = self.adaptor.nil() - # XKBGrammar.g:60:11: ( attribute_xkb )+ - cnt3 = 0 - while True: #loop3 - alt3 = 2 - LA3_0 = self.input.LA(1) + # XKBGrammar.g:65:12: ( attribute_xkb )+ + cnt2 = 0 + while True: #loop2 + alt2 = 2 + LA2_0 = self.input.LA(1) - if ((TOKEN_DEFAULT <= LA3_0 <= TOKEN_XKB_SYMBOLS)) : - alt3 = 1 + if ((TOKEN_DEFAULT <= LA2_0 <= TOKEN_ALPHANUMERIC_KEYS) or (TOKEN_ALTERNATE_GROUP <= LA2_0 <= TOKEN_XKB_SYMBOLS)) : + alt2 = 1 - if alt3 == 1: - # XKBGrammar.g:60:11: attribute_xkb - self.following.append(self.FOLLOW_attribute_xkb_in_preamble373) - attribute_xkb9 = self.attribute_xkb() + if alt2 == 1: + # XKBGrammar.g:65:12: attribute_xkb + self.following.append(self.FOLLOW_attribute_xkb_in_preamble391) + attribute_xkb5 = self.attribute_xkb() self.following.pop() - self.adaptor.addChild(root_0, attribute_xkb9.tree) + self.adaptor.addChild(root_0, attribute_xkb5.tree) else: - if cnt3 >= 1: - break #loop3 + if cnt2 >= 1: + break #loop2 - eee = EarlyExitException(3, self.input) + eee = EarlyExitException(2, self.input) raise eee - cnt3 += 1 + cnt2 += 1 + + self.following.append(self.FOLLOW_quotedstring_in_preamble396) + sectionname = self.quotedstring() + self.following.pop() + self.adaptor.addChild(root_0, sectionname.tree) + #action start + print '%(sname)s {' % { "sname": self.input.toString(sectionname.start,sectionname.stop) } + #action end @@ -351,11 +332,12 @@ class XKBGrammarParser(Parser): self.start = None self.stop = None + self.value = None self.tree = None # $ANTLR start quotedstring - # XKBGrammar.g:62:1: quotedstring : DQUOTE (~ ( DQUOTE ) )+ DQUOTE ; + # XKBGrammar.g:69:1: quotedstring returns [value] : DQUOTE (sectionname+=~ ( DQUOTE ) )+ DQUOTE ; def quotedstring(self, ): retval = self.quotedstring_return() @@ -363,72 +345,86 @@ class XKBGrammarParser(Parser): root_0 = None - DQUOTE10 = None - set11 = None - DQUOTE12 = None + DQUOTE6 = None + DQUOTE7 = None + sectionname = None + list_sectionname = None - DQUOTE10_tree = None - set11_tree = None - DQUOTE12_tree = None + DQUOTE6_tree = None + DQUOTE7_tree = None + sectionname_tree = None try: try: - # XKBGrammar.g:63:2: ( DQUOTE (~ ( DQUOTE ) )+ DQUOTE ) - # XKBGrammar.g:63:4: DQUOTE (~ ( DQUOTE ) )+ DQUOTE + # XKBGrammar.g:70:2: ( DQUOTE (sectionname+=~ ( DQUOTE ) )+ DQUOTE ) + # XKBGrammar.g:70:4: DQUOTE (sectionname+=~ ( DQUOTE ) )+ DQUOTE root_0 = self.adaptor.nil() - DQUOTE10 = self.input.LT(1) - self.match(self.input, DQUOTE, self.FOLLOW_DQUOTE_in_quotedstring383) + DQUOTE6 = self.input.LT(1) + self.match(self.input, DQUOTE, self.FOLLOW_DQUOTE_in_quotedstring414) - DQUOTE10_tree = self.adaptor.createWithPayload(DQUOTE10) - self.adaptor.addChild(root_0, DQUOTE10_tree) + DQUOTE6_tree = self.adaptor.createWithPayload(DQUOTE6) + self.adaptor.addChild(root_0, DQUOTE6_tree) - # XKBGrammar.g:63:11: (~ ( DQUOTE ) )+ - cnt4 = 0 - while True: #loop4 - alt4 = 2 - LA4_0 = self.input.LA(1) + # XKBGrammar.g:70:22: (sectionname+=~ ( DQUOTE ) )+ + cnt3 = 0 + while True: #loop3 + alt3 = 2 + LA3_0 = self.input.LA(1) - if ((TOKEN_DEFAULT <= LA4_0 <= COMMA) or (MINUS <= LA4_0 <= WS)) : - alt4 = 1 + if ((TOKEN_DEFAULT <= LA3_0 <= COMMA) or (MINUS <= LA3_0 <= WS)) : + alt3 = 1 - if alt4 == 1: - # XKBGrammar.g:63:11: ~ ( DQUOTE ) - set11 = self.input.LT(1) + if alt3 == 1: + # XKBGrammar.g:70:22: sectionname+=~ ( DQUOTE ) + sectionname = self.input.LT(1) if (TOKEN_DEFAULT <= self.input.LA(1) <= COMMA) or (MINUS <= self.input.LA(1) <= WS): self.input.consume(); - self.adaptor.addChild(root_0, self.adaptor.createWithPayload(set11)) + self.adaptor.addChild(root_0, self.adaptor.createWithPayload(sectionname)) self.errorRecovery = False else: mse = MismatchedSetException(None, self.input) self.recoverFromMismatchedSet( - self.input, mse, self.FOLLOW_set_in_quotedstring385 + self.input, mse, self.FOLLOW_set_in_quotedstring418 ) raise mse + if list_sectionname is None: + list_sectionname = [] + list_sectionname.append(sectionname) + else: - if cnt4 >= 1: - break #loop4 + if cnt3 >= 1: + break #loop3 - eee = EarlyExitException(4, self.input) + eee = EarlyExitException(3, self.input) raise eee - cnt4 += 1 + cnt3 += 1 + + DQUOTE7 = self.input.LT(1) + self.match(self.input, DQUOTE, self.FOLLOW_DQUOTE_in_quotedstring424) - DQUOTE12 = self.input.LT(1) - self.match(self.input, DQUOTE, self.FOLLOW_DQUOTE_in_quotedstring391) + DQUOTE7_tree = self.adaptor.createWithPayload(DQUOTE7) + self.adaptor.addChild(root_0, DQUOTE7_tree) - DQUOTE12_tree = self.adaptor.createWithPayload(DQUOTE12) - self.adaptor.addChild(root_0, DQUOTE12_tree) + #action start + + qstring = ['"'] + for elem in list_sectionname: + qstring.append(elem.getText()) + qstring.append('"') + retval.value = "".join(qstring) + #action end @@ -458,7 +454,7 @@ class XKBGrammarParser(Parser): # $ANTLR start sectionmaterial - # XKBGrammar.g:66:1: sectionmaterial : ( line_include | line_name | line_keytype | line_key ); + # XKBGrammar.g:80:1: sectionmaterial : LCURLY ( line_include | line_name | line_keytype | line_key | line_comment )+ RCURLY SEMICOLON ; def sectionmaterial(self, ): retval = self.sectionmaterial_return() @@ -466,76 +462,123 @@ class XKBGrammarParser(Parser): root_0 = None - line_include13 = None + LCURLY8 = None + RCURLY14 = None + SEMICOLON15 = None + line_include9 = None + + line_name10 = None - line_name14 = None + line_keytype11 = None - line_keytype15 = None + line_key12 = None - line_key16 = None + line_comment13 = None + LCURLY8_tree = None + RCURLY14_tree = None + SEMICOLON15_tree = None try: try: - # XKBGrammar.g:67:2: ( line_include | line_name | line_keytype | line_key ) - alt5 = 4 - LA5 = self.input.LA(1) - if LA5 == TOKEN_INCLUDE: - alt5 = 1 - elif LA5 == TOKEN_NAME: - alt5 = 2 - elif LA5 == TOKEN_KEY_TYPE: - alt5 = 3 - elif LA5 == TOKEN_KEY: - alt5 = 4 - else: - nvae = NoViableAltException("66:1: sectionmaterial : ( line_include | line_name | line_keytype | line_key );", 5, 0, self.input) + # XKBGrammar.g:81:2: ( LCURLY ( line_include | line_name | line_keytype | line_key | line_comment )+ RCURLY SEMICOLON ) + # XKBGrammar.g:81:4: LCURLY ( line_include | line_name | line_keytype | line_key | line_comment )+ RCURLY SEMICOLON + root_0 = self.adaptor.nil() - raise nvae + LCURLY8 = self.input.LT(1) + self.match(self.input, LCURLY, self.FOLLOW_LCURLY_in_sectionmaterial438) - if alt5 == 1: - # XKBGrammar.g:67:4: line_include - root_0 = self.adaptor.nil() - self.following.append(self.FOLLOW_line_include_in_sectionmaterial402) - line_include13 = self.line_include() - self.following.pop() + LCURLY8_tree = self.adaptor.createWithPayload(LCURLY8) + self.adaptor.addChild(root_0, LCURLY8_tree) - self.adaptor.addChild(root_0, line_include13.tree) + # XKBGrammar.g:81:11: ( line_include | line_name | line_keytype | line_key | line_comment )+ + cnt4 = 0 + while True: #loop4 + alt4 = 6 + LA4 = self.input.LA(1) + if LA4 == TOKEN_INCLUDE: + alt4 = 1 + elif LA4 == TOKEN_NAME: + alt4 = 2 + elif LA4 == TOKEN_KEY_TYPE: + alt4 = 3 + elif LA4 == TOKEN_KEY: + alt4 = 4 + elif LA4 == COMMENT: + alt4 = 5 + if alt4 == 1: + # XKBGrammar.g:81:12: line_include + self.following.append(self.FOLLOW_line_include_in_sectionmaterial441) + line_include9 = self.line_include() + self.following.pop() - elif alt5 == 2: - # XKBGrammar.g:68:4: line_name - root_0 = self.adaptor.nil() + self.adaptor.addChild(root_0, line_include9.tree) - self.following.append(self.FOLLOW_line_name_in_sectionmaterial408) - line_name14 = self.line_name() - self.following.pop() - self.adaptor.addChild(root_0, line_name14.tree) + elif alt4 == 2: + # XKBGrammar.g:82:4: line_name + self.following.append(self.FOLLOW_line_name_in_sectionmaterial447) + line_name10 = self.line_name() + self.following.pop() + self.adaptor.addChild(root_0, line_name10.tree) - elif alt5 == 3: - # XKBGrammar.g:69:4: line_keytype - root_0 = self.adaptor.nil() - self.following.append(self.FOLLOW_line_keytype_in_sectionmaterial414) - line_keytype15 = self.line_keytype() - self.following.pop() + elif alt4 == 3: + # XKBGrammar.g:83:4: line_keytype + self.following.append(self.FOLLOW_line_keytype_in_sectionmaterial453) + line_keytype11 = self.line_keytype() + self.following.pop() - self.adaptor.addChild(root_0, line_keytype15.tree) + self.adaptor.addChild(root_0, line_keytype11.tree) - elif alt5 == 4: - # XKBGrammar.g:70:4: line_key - root_0 = self.adaptor.nil() + elif alt4 == 4: + # XKBGrammar.g:84:4: line_key + self.following.append(self.FOLLOW_line_key_in_sectionmaterial459) + line_key12 = self.line_key() + self.following.pop() + + self.adaptor.addChild(root_0, line_key12.tree) + + + elif alt4 == 5: + # XKBGrammar.g:86:4: line_comment + self.following.append(self.FOLLOW_line_comment_in_sectionmaterial466) + line_comment13 = self.line_comment() + self.following.pop() + + self.adaptor.addChild(root_0, line_comment13.tree) + + + else: + if cnt4 >= 1: + break #loop4 + + eee = EarlyExitException(4, self.input) + raise eee + + cnt4 += 1 + + + RCURLY14 = self.input.LT(1) + self.match(self.input, RCURLY, self.FOLLOW_RCURLY_in_sectionmaterial470) + + + RCURLY14_tree = self.adaptor.createWithPayload(RCURLY14) + self.adaptor.addChild(root_0, RCURLY14_tree) + + SEMICOLON15 = self.input.LT(1) + self.match(self.input, SEMICOLON, self.FOLLOW_SEMICOLON_in_sectionmaterial472) + + + SEMICOLON15_tree = self.adaptor.createWithPayload(SEMICOLON15) + self.adaptor.addChild(root_0, SEMICOLON15_tree) - self.following.append(self.FOLLOW_line_key_in_sectionmaterial420) - line_key16 = self.line_key() - self.following.pop() - self.adaptor.addChild(root_0, line_key16.tree) retval.stop = self.input.LT(-1) @@ -555,6 +598,63 @@ class XKBGrammarParser(Parser): # $ANTLR end sectionmaterial + class line_comment_return(object): + def __init__(self): + self.start = None + self.stop = None + + self.tree = None + + + # $ANTLR start line_comment + # XKBGrammar.g:89:1: line_comment : COMMENT ; + def line_comment(self, ): + + retval = self.line_comment_return() + retval.start = self.input.LT(1) + + root_0 = None + + COMMENT16 = None + + COMMENT16_tree = None + + try: + try: + # XKBGrammar.g:90:2: ( COMMENT ) + # XKBGrammar.g:90:4: COMMENT + root_0 = self.adaptor.nil() + + COMMENT16 = self.input.LT(1) + self.match(self.input, COMMENT, self.FOLLOW_COMMENT_in_line_comment483) + + + COMMENT16_tree = self.adaptor.createWithPayload(COMMENT16) + self.adaptor.addChild(root_0, COMMENT16_tree) + + #action start + skip(); + #action end + + + + retval.stop = self.input.LT(-1) + + + retval.tree = self.adaptor.rulePostProcessing(root_0) + self.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop) + + except RecognitionException, re: + self.reportError(re) + self.recover(self.input, re) + finally: + + pass + + return retval + + # $ANTLR end line_comment + class line_include_return(object): def __init__(self): self.start = None @@ -564,7 +664,7 @@ class XKBGrammarParser(Parser): # $ANTLR start line_include - # XKBGrammar.g:76:1: line_include : TOKEN_INCLUDE quotedstring ; + # XKBGrammar.g:92:1: line_include : TOKEN_INCLUDE include= quotedstring ; def line_include(self, ): retval = self.line_include_return() @@ -573,29 +673,32 @@ class XKBGrammarParser(Parser): root_0 = None TOKEN_INCLUDE17 = None - quotedstring18 = None + include = None TOKEN_INCLUDE17_tree = None try: try: - # XKBGrammar.g:78:2: ( TOKEN_INCLUDE quotedstring ) - # XKBGrammar.g:78:4: TOKEN_INCLUDE quotedstring + # XKBGrammar.g:94:2: ( TOKEN_INCLUDE include= quotedstring ) + # XKBGrammar.g:94:4: TOKEN_INCLUDE include= quotedstring root_0 = self.adaptor.nil() TOKEN_INCLUDE17 = self.input.LT(1) - self.match(self.input, TOKEN_INCLUDE, self.FOLLOW_TOKEN_INCLUDE_in_line_include437) + self.match(self.input, TOKEN_INCLUDE, self.FOLLOW_TOKEN_INCLUDE_in_line_include497) TOKEN_INCLUDE17_tree = self.adaptor.createWithPayload(TOKEN_INCLUDE17) self.adaptor.addChild(root_0, TOKEN_INCLUDE17_tree) - self.following.append(self.FOLLOW_quotedstring_in_line_include439) - quotedstring18 = self.quotedstring() + self.following.append(self.FOLLOW_quotedstring_in_line_include501) + include = self.quotedstring() self.following.pop() - self.adaptor.addChild(root_0, quotedstring18.tree) + self.adaptor.addChild(root_0, include.tree) + #action start + print '\tinclude %(inc)s' % { "inc": self.input.toString(include.start,include.stop) } + #action end @@ -625,7 +728,7 @@ class XKBGrammarParser(Parser): # $ANTLR start line_name - # XKBGrammar.g:81:1: line_name : TOKEN_NAME LBRACKET name= NAME RBRACKET EQUAL quotedstring SEMICOLON ; + # XKBGrammar.g:98:1: line_name : TOKEN_NAME LBRACKET name= NAME RBRACKET EQUAL nameval= quotedstring SEMICOLON ; def line_name(self, ): retval = self.line_name_return() @@ -634,74 +737,77 @@ class XKBGrammarParser(Parser): root_0 = None name = None - TOKEN_NAME19 = None - LBRACKET20 = None - RBRACKET21 = None - EQUAL22 = None - SEMICOLON24 = None - quotedstring23 = None + TOKEN_NAME18 = None + LBRACKET19 = None + RBRACKET20 = None + EQUAL21 = None + SEMICOLON22 = None + nameval = None name_tree = None - TOKEN_NAME19_tree = None - LBRACKET20_tree = None - RBRACKET21_tree = None - EQUAL22_tree = None - SEMICOLON24_tree = None + TOKEN_NAME18_tree = None + LBRACKET19_tree = None + RBRACKET20_tree = None + EQUAL21_tree = None + SEMICOLON22_tree = None try: try: - # XKBGrammar.g:82:2: ( TOKEN_NAME LBRACKET name= NAME RBRACKET EQUAL quotedstring SEMICOLON ) - # XKBGrammar.g:82:4: TOKEN_NAME LBRACKET name= NAME RBRACKET EQUAL quotedstring SEMICOLON + # XKBGrammar.g:99:2: ( TOKEN_NAME LBRACKET name= NAME RBRACKET EQUAL nameval= quotedstring SEMICOLON ) + # XKBGrammar.g:99:4: TOKEN_NAME LBRACKET name= NAME RBRACKET EQUAL nameval= quotedstring SEMICOLON root_0 = self.adaptor.nil() - TOKEN_NAME19 = self.input.LT(1) - self.match(self.input, TOKEN_NAME, self.FOLLOW_TOKEN_NAME_in_line_name450) + TOKEN_NAME18 = self.input.LT(1) + self.match(self.input, TOKEN_NAME, self.FOLLOW_TOKEN_NAME_in_line_name516) - TOKEN_NAME19_tree = self.adaptor.createWithPayload(TOKEN_NAME19) - self.adaptor.addChild(root_0, TOKEN_NAME19_tree) + TOKEN_NAME18_tree = self.adaptor.createWithPayload(TOKEN_NAME18) + self.adaptor.addChild(root_0, TOKEN_NAME18_tree) - LBRACKET20 = self.input.LT(1) - self.match(self.input, LBRACKET, self.FOLLOW_LBRACKET_in_line_name452) + LBRACKET19 = self.input.LT(1) + self.match(self.input, LBRACKET, self.FOLLOW_LBRACKET_in_line_name518) - LBRACKET20_tree = self.adaptor.createWithPayload(LBRACKET20) - self.adaptor.addChild(root_0, LBRACKET20_tree) + LBRACKET19_tree = self.adaptor.createWithPayload(LBRACKET19) + self.adaptor.addChild(root_0, LBRACKET19_tree) name = self.input.LT(1) - self.match(self.input, NAME, self.FOLLOW_NAME_in_line_name456) + self.match(self.input, NAME, self.FOLLOW_NAME_in_line_name522) name_tree = self.adaptor.createWithPayload(name) self.adaptor.addChild(root_0, name_tree) - RBRACKET21 = self.input.LT(1) - self.match(self.input, RBRACKET, self.FOLLOW_RBRACKET_in_line_name458) + RBRACKET20 = self.input.LT(1) + self.match(self.input, RBRACKET, self.FOLLOW_RBRACKET_in_line_name524) - RBRACKET21_tree = self.adaptor.createWithPayload(RBRACKET21) - self.adaptor.addChild(root_0, RBRACKET21_tree) + RBRACKET20_tree = self.adaptor.createWithPayload(RBRACKET20) + self.adaptor.addChild(root_0, RBRACKET20_tree) - EQUAL22 = self.input.LT(1) - self.match(self.input, EQUAL, self.FOLLOW_EQUAL_in_line_name460) + EQUAL21 = self.input.LT(1) + self.match(self.input, EQUAL, self.FOLLOW_EQUAL_in_line_name526) - EQUAL22_tree = self.adaptor.createWithPayload(EQUAL22) - self.adaptor.addChild(root_0, EQUAL22_tree) + EQUAL21_tree = self.adaptor.createWithPayload(EQUAL21) + self.adaptor.addChild(root_0, EQUAL21_tree) - self.following.append(self.FOLLOW_quotedstring_in_line_name462) - quotedstring23 = self.quotedstring() + self.following.append(self.FOLLOW_quotedstring_in_line_name530) + nameval = self.quotedstring() self.following.pop() - self.adaptor.addChild(root_0, quotedstring23.tree) - SEMICOLON24 = self.input.LT(1) - self.match(self.input, SEMICOLON, self.FOLLOW_SEMICOLON_in_line_name464) + self.adaptor.addChild(root_0, nameval.tree) + SEMICOLON22 = self.input.LT(1) + self.match(self.input, SEMICOLON, self.FOLLOW_SEMICOLON_in_line_name532) - SEMICOLON24_tree = self.adaptor.createWithPayload(SEMICOLON24) - self.adaptor.addChild(root_0, SEMICOLON24_tree) + SEMICOLON22_tree = self.adaptor.createWithPayload(SEMICOLON22) + self.adaptor.addChild(root_0, SEMICOLON22_tree) + #action start + print '\tname[%(name)s] = %(nameval)s;' % { "name": name.text, "nameval": self.input.toString(nameval.start,nameval.stop) } + #action end @@ -731,7 +837,7 @@ class XKBGrammarParser(Parser): # $ANTLR start line_keytype - # XKBGrammar.g:85:1: line_keytype : TOKEN_KEY_TYPE LBRACKET keytype= NAME RBRACKET EQUAL DQUOTE keytypevalue= NAME DQUOTE SEMICOLON ; + # XKBGrammar.g:103:1: line_keytype : TOKEN_KEY_TYPE LBRACKET keytype= NAME RBRACKET EQUAL DQUOTE keytypevalue= NAME DQUOTE SEMICOLON ; def line_keytype(self, ): retval = self.line_keytype_return() @@ -741,93 +847,96 @@ class XKBGrammarParser(Parser): keytype = None keytypevalue = None - TOKEN_KEY_TYPE25 = None - LBRACKET26 = None - RBRACKET27 = None - EQUAL28 = None - DQUOTE29 = None - DQUOTE30 = None - SEMICOLON31 = None + TOKEN_KEY_TYPE23 = None + LBRACKET24 = None + RBRACKET25 = None + EQUAL26 = None + DQUOTE27 = None + DQUOTE28 = None + SEMICOLON29 = None keytype_tree = None keytypevalue_tree = None - TOKEN_KEY_TYPE25_tree = None - LBRACKET26_tree = None - RBRACKET27_tree = None - EQUAL28_tree = None - DQUOTE29_tree = None - DQUOTE30_tree = None - SEMICOLON31_tree = None + TOKEN_KEY_TYPE23_tree = None + LBRACKET24_tree = None + RBRACKET25_tree = None + EQUAL26_tree = None + DQUOTE27_tree = None + DQUOTE28_tree = None + SEMICOLON29_tree = None try: try: - # XKBGrammar.g:86:2: ( TOKEN_KEY_TYPE LBRACKET keytype= NAME RBRACKET EQUAL DQUOTE keytypevalue= NAME DQUOTE SEMICOLON ) - # XKBGrammar.g:86:4: TOKEN_KEY_TYPE LBRACKET keytype= NAME RBRACKET EQUAL DQUOTE keytypevalue= NAME DQUOTE SEMICOLON + # XKBGrammar.g:104:2: ( TOKEN_KEY_TYPE LBRACKET keytype= NAME RBRACKET EQUAL DQUOTE keytypevalue= NAME DQUOTE SEMICOLON ) + # XKBGrammar.g:104:4: TOKEN_KEY_TYPE LBRACKET keytype= NAME RBRACKET EQUAL DQUOTE keytypevalue= NAME DQUOTE SEMICOLON root_0 = self.adaptor.nil() - TOKEN_KEY_TYPE25 = self.input.LT(1) - self.match(self.input, TOKEN_KEY_TYPE, self.FOLLOW_TOKEN_KEY_TYPE_in_line_keytype475) + TOKEN_KEY_TYPE23 = self.input.LT(1) + self.match(self.input, TOKEN_KEY_TYPE, self.FOLLOW_TOKEN_KEY_TYPE_in_line_keytype546) - TOKEN_KEY_TYPE25_tree = self.adaptor.createWithPayload(TOKEN_KEY_TYPE25) - self.adaptor.addChild(root_0, TOKEN_KEY_TYPE25_tree) + TOKEN_KEY_TYPE23_tree = self.adaptor.createWithPayload(TOKEN_KEY_TYPE23) + self.adaptor.addChild(root_0, TOKEN_KEY_TYPE23_tree) - LBRACKET26 = self.input.LT(1) - self.match(self.input, LBRACKET, self.FOLLOW_LBRACKET_in_line_keytype477) + LBRACKET24 = self.input.LT(1) + self.match(self.input, LBRACKET, self.FOLLOW_LBRACKET_in_line_keytype548) - LBRACKET26_tree = self.adaptor.createWithPayload(LBRACKET26) - self.adaptor.addChild(root_0, LBRACKET26_tree) + LBRACKET24_tree = self.adaptor.createWithPayload(LBRACKET24) + self.adaptor.addChild(root_0, LBRACKET24_tree) keytype = self.input.LT(1) - self.match(self.input, NAME, self.FOLLOW_NAME_in_line_keytype481) + self.match(self.input, NAME, self.FOLLOW_NAME_in_line_keytype552) keytype_tree = self.adaptor.createWithPayload(keytype) self.adaptor.addChild(root_0, keytype_tree) - RBRACKET27 = self.input.LT(1) - self.match(self.input, RBRACKET, self.FOLLOW_RBRACKET_in_line_keytype483) + RBRACKET25 = self.input.LT(1) + self.match(self.input, RBRACKET, self.FOLLOW_RBRACKET_in_line_keytype554) - RBRACKET27_tree = self.adaptor.createWithPayload(RBRACKET27) - self.adaptor.addChild(root_0, RBRACKET27_tree) + RBRACKET25_tree = self.adaptor.createWithPayload(RBRACKET25) + self.adaptor.addChild(root_0, RBRACKET25_tree) - EQUAL28 = self.input.LT(1) - self.match(self.input, EQUAL, self.FOLLOW_EQUAL_in_line_keytype485) + EQUAL26 = self.input.LT(1) + self.match(self.input, EQUAL, self.FOLLOW_EQUAL_in_line_keytype556) - EQUAL28_tree = self.adaptor.createWithPayload(EQUAL28) - self.adaptor.addChild(root_0, EQUAL28_tree) + EQUAL26_tree = self.adaptor.createWithPayload(EQUAL26) + self.adaptor.addChild(root_0, EQUAL26_tree) - DQUOTE29 = self.input.LT(1) - self.match(self.input, DQUOTE, self.FOLLOW_DQUOTE_in_line_keytype487) + DQUOTE27 = self.input.LT(1) + self.match(self.input, DQUOTE, self.FOLLOW_DQUOTE_in_line_keytype558) - DQUOTE29_tree = self.adaptor.createWithPayload(DQUOTE29) - self.adaptor.addChild(root_0, DQUOTE29_tree) + DQUOTE27_tree = self.adaptor.createWithPayload(DQUOTE27) + self.adaptor.addChild(root_0, DQUOTE27_tree) keytypevalue = self.input.LT(1) - self.match(self.input, NAME, self.FOLLOW_NAME_in_line_keytype491) + self.match(self.input, NAME, self.FOLLOW_NAME_in_line_keytype562) keytypevalue_tree = self.adaptor.createWithPayload(keytypevalue) self.adaptor.addChild(root_0, keytypevalue_tree) - DQUOTE30 = self.input.LT(1) - self.match(self.input, DQUOTE, self.FOLLOW_DQUOTE_in_line_keytype493) + DQUOTE28 = self.input.LT(1) + self.match(self.input, DQUOTE, self.FOLLOW_DQUOTE_in_line_keytype564) - DQUOTE30_tree = self.adaptor.createWithPayload(DQUOTE30) - self.adaptor.addChild(root_0, DQUOTE30_tree) + DQUOTE28_tree = self.adaptor.createWithPayload(DQUOTE28) + self.adaptor.addChild(root_0, DQUOTE28_tree) - SEMICOLON31 = self.input.LT(1) - self.match(self.input, SEMICOLON, self.FOLLOW_SEMICOLON_in_line_keytype495) + SEMICOLON29 = self.input.LT(1) + self.match(self.input, SEMICOLON, self.FOLLOW_SEMICOLON_in_line_keytype566) - SEMICOLON31_tree = self.adaptor.createWithPayload(SEMICOLON31) - self.adaptor.addChild(root_0, SEMICOLON31_tree) + SEMICOLON29_tree = self.adaptor.createWithPayload(SEMICOLON29) + self.adaptor.addChild(root_0, SEMICOLON29_tree) + #action start + print '\tkey.type[%(kt)s] = \"%(ktv)s\";' % { "kt": keytype.text, "ktv": keytypevalue.text } + #action end @@ -857,7 +966,7 @@ class XKBGrammarParser(Parser): # $ANTLR start line_key - # XKBGrammar.g:89:1: line_key : TOKEN_KEY keycode keysyms SEMICOLON ; + # XKBGrammar.g:113:1: line_key : TOKEN_KEY keycode keysyms SEMICOLON ; def line_key(self, ): retval = self.line_key_return() @@ -865,46 +974,49 @@ class XKBGrammarParser(Parser): root_0 = None - TOKEN_KEY32 = None - SEMICOLON35 = None - keycode33 = None + TOKEN_KEY30 = None + SEMICOLON33 = None + keycode31 = None - keysyms34 = None + keysyms32 = None - TOKEN_KEY32_tree = None - SEMICOLON35_tree = None + TOKEN_KEY30_tree = None + SEMICOLON33_tree = None try: try: - # XKBGrammar.g:90:2: ( TOKEN_KEY keycode keysyms SEMICOLON ) - # XKBGrammar.g:90:4: TOKEN_KEY keycode keysyms SEMICOLON + # XKBGrammar.g:114:2: ( TOKEN_KEY keycode keysyms SEMICOLON ) + # XKBGrammar.g:114:4: TOKEN_KEY keycode keysyms SEMICOLON root_0 = self.adaptor.nil() - TOKEN_KEY32 = self.input.LT(1) - self.match(self.input, TOKEN_KEY, self.FOLLOW_TOKEN_KEY_in_line_key507) + TOKEN_KEY30 = self.input.LT(1) + self.match(self.input, TOKEN_KEY, self.FOLLOW_TOKEN_KEY_in_line_key586) - TOKEN_KEY32_tree = self.adaptor.createWithPayload(TOKEN_KEY32) - self.adaptor.addChild(root_0, TOKEN_KEY32_tree) + TOKEN_KEY30_tree = self.adaptor.createWithPayload(TOKEN_KEY30) + self.adaptor.addChild(root_0, TOKEN_KEY30_tree) - self.following.append(self.FOLLOW_keycode_in_line_key509) - keycode33 = self.keycode() + self.following.append(self.FOLLOW_keycode_in_line_key588) + keycode31 = self.keycode() self.following.pop() - self.adaptor.addChild(root_0, keycode33.tree) - self.following.append(self.FOLLOW_keysyms_in_line_key511) - keysyms34 = self.keysyms() + self.adaptor.addChild(root_0, keycode31.tree) + self.following.append(self.FOLLOW_keysyms_in_line_key590) + keysyms32 = self.keysyms() self.following.pop() - self.adaptor.addChild(root_0, keysyms34.tree) - SEMICOLON35 = self.input.LT(1) - self.match(self.input, SEMICOLON, self.FOLLOW_SEMICOLON_in_line_key513) + self.adaptor.addChild(root_0, keysyms32.tree) + SEMICOLON33 = self.input.LT(1) + self.match(self.input, SEMICOLON, self.FOLLOW_SEMICOLON_in_line_key592) - SEMICOLON35_tree = self.adaptor.createWithPayload(SEMICOLON35) - self.adaptor.addChild(root_0, SEMICOLON35_tree) + SEMICOLON33_tree = self.adaptor.createWithPayload(SEMICOLON33) + self.adaptor.addChild(root_0, SEMICOLON33_tree) + #action start + print "\tkey %(keycode)s %(keysyms)s ;" % { "keycode": self.input.toString(keycode31.start,keycode31.stop), "keysyms": self.input.toString(keysyms32.start,keysyms32.stop) } + #action end @@ -934,7 +1046,7 @@ class XKBGrammarParser(Parser): # $ANTLR start keycode - # XKBGrammar.g:93:1: keycode : LOWERTHAN NAME GREATERTHAN -> ^( INCLUDE NAME ) ; + # XKBGrammar.g:118:1: keycode : LOWERTHAN NAME GREATERTHAN -> ^( INCLUDE NAME ) ; def keycode(self, ): retval = self.keycode_return() @@ -942,33 +1054,33 @@ class XKBGrammarParser(Parser): root_0 = None - LOWERTHAN36 = None - NAME37 = None - GREATERTHAN38 = None + LOWERTHAN34 = None + NAME35 = None + GREATERTHAN36 = None - LOWERTHAN36_tree = None - NAME37_tree = None - GREATERTHAN38_tree = None + LOWERTHAN34_tree = None + NAME35_tree = None + GREATERTHAN36_tree = None stream_NAME = RewriteRuleTokenStream(self.adaptor, "token NAME") stream_LOWERTHAN = RewriteRuleTokenStream(self.adaptor, "token LOWERTHAN") stream_GREATERTHAN = RewriteRuleTokenStream(self.adaptor, "token GREATERTHAN") try: try: - # XKBGrammar.g:94:2: ( LOWERTHAN NAME GREATERTHAN -> ^( INCLUDE NAME ) ) - # XKBGrammar.g:94:4: LOWERTHAN NAME GREATERTHAN - LOWERTHAN36 = self.input.LT(1) - self.match(self.input, LOWERTHAN, self.FOLLOW_LOWERTHAN_in_keycode526) + # XKBGrammar.g:119:2: ( LOWERTHAN NAME GREATERTHAN -> ^( INCLUDE NAME ) ) + # XKBGrammar.g:119:4: LOWERTHAN NAME GREATERTHAN + LOWERTHAN34 = self.input.LT(1) + self.match(self.input, LOWERTHAN, self.FOLLOW_LOWERTHAN_in_keycode608) - stream_LOWERTHAN.add(LOWERTHAN36) - NAME37 = self.input.LT(1) - self.match(self.input, NAME, self.FOLLOW_NAME_in_keycode528) + stream_LOWERTHAN.add(LOWERTHAN34) + NAME35 = self.input.LT(1) + self.match(self.input, NAME, self.FOLLOW_NAME_in_keycode610) - stream_NAME.add(NAME37) - GREATERTHAN38 = self.input.LT(1) - self.match(self.input, GREATERTHAN, self.FOLLOW_GREATERTHAN_in_keycode530) + stream_NAME.add(NAME35) + GREATERTHAN36 = self.input.LT(1) + self.match(self.input, GREATERTHAN, self.FOLLOW_GREATERTHAN_in_keycode612) - stream_GREATERTHAN.add(GREATERTHAN38) + stream_GREATERTHAN.add(GREATERTHAN36) # AST Rewrite # elements: NAME # token labels: @@ -985,8 +1097,8 @@ class XKBGrammarParser(Parser): root_0 = self.adaptor.nil() - # 94:31: -> ^( INCLUDE NAME ) - # XKBGrammar.g:94:34: ^( INCLUDE NAME ) + # 120:2: -> ^( INCLUDE NAME ) + # XKBGrammar.g:120:5: ^( INCLUDE NAME ) root_1 = self.adaptor.nil() root_1 = self.adaptor.becomeRoot(self.adaptor.createFromType(INCLUDE, "INCLUDE"), root_1) @@ -1025,7 +1137,7 @@ class XKBGrammarParser(Parser): # $ANTLR start keysyms - # XKBGrammar.g:97:1: keysyms : LCURLY LBRACKET ( NAME | NAME_KEYSYM ) ( COMMA ( NAME | NAME_KEYSYM ) )* RBRACKET RCURLY ; + # XKBGrammar.g:123:1: keysyms : LCURLY LBRACKET ( NAME | NAME_KEYSYM ) ( COMMA ( NAME | NAME_KEYSYM ) )* RBRACKET RCURLY ; def keysyms(self, ): retval = self.keysyms_return() @@ -1033,84 +1145,84 @@ class XKBGrammarParser(Parser): root_0 = None - LCURLY39 = None - LBRACKET40 = None + LCURLY37 = None + LBRACKET38 = None + set39 = None + COMMA40 = None set41 = None - COMMA42 = None - set43 = None - RBRACKET44 = None - RCURLY45 = None + RBRACKET42 = None + RCURLY43 = None - LCURLY39_tree = None - LBRACKET40_tree = None + LCURLY37_tree = None + LBRACKET38_tree = None + set39_tree = None + COMMA40_tree = None set41_tree = None - COMMA42_tree = None - set43_tree = None - RBRACKET44_tree = None - RCURLY45_tree = None + RBRACKET42_tree = None + RCURLY43_tree = None try: try: - # XKBGrammar.g:98:2: ( LCURLY LBRACKET ( NAME | NAME_KEYSYM ) ( COMMA ( NAME | NAME_KEYSYM ) )* RBRACKET RCURLY ) - # XKBGrammar.g:98:4: LCURLY LBRACKET ( NAME | NAME_KEYSYM ) ( COMMA ( NAME | NAME_KEYSYM ) )* RBRACKET RCURLY + # XKBGrammar.g:124:2: ( LCURLY LBRACKET ( NAME | NAME_KEYSYM ) ( COMMA ( NAME | NAME_KEYSYM ) )* RBRACKET RCURLY ) + # XKBGrammar.g:124:4: LCURLY LBRACKET ( NAME | NAME_KEYSYM ) ( COMMA ( NAME | NAME_KEYSYM ) )* RBRACKET RCURLY root_0 = self.adaptor.nil() - LCURLY39 = self.input.LT(1) - self.match(self.input, LCURLY, self.FOLLOW_LCURLY_in_keysyms550) + LCURLY37 = self.input.LT(1) + self.match(self.input, LCURLY, self.FOLLOW_LCURLY_in_keysyms634) - LCURLY39_tree = self.adaptor.createWithPayload(LCURLY39) - self.adaptor.addChild(root_0, LCURLY39_tree) + LCURLY37_tree = self.adaptor.createWithPayload(LCURLY37) + self.adaptor.addChild(root_0, LCURLY37_tree) - LBRACKET40 = self.input.LT(1) - self.match(self.input, LBRACKET, self.FOLLOW_LBRACKET_in_keysyms552) + LBRACKET38 = self.input.LT(1) + self.match(self.input, LBRACKET, self.FOLLOW_LBRACKET_in_keysyms636) - LBRACKET40_tree = self.adaptor.createWithPayload(LBRACKET40) - self.adaptor.addChild(root_0, LBRACKET40_tree) + LBRACKET38_tree = self.adaptor.createWithPayload(LBRACKET38) + self.adaptor.addChild(root_0, LBRACKET38_tree) - set41 = self.input.LT(1) + set39 = self.input.LT(1) if self.input.LA(1) == NAME or self.input.LA(1) == NAME_KEYSYM: self.input.consume(); - self.adaptor.addChild(root_0, self.adaptor.createWithPayload(set41)) + self.adaptor.addChild(root_0, self.adaptor.createWithPayload(set39)) self.errorRecovery = False else: mse = MismatchedSetException(None, self.input) self.recoverFromMismatchedSet( - self.input, mse, self.FOLLOW_set_in_keysyms554 + self.input, mse, self.FOLLOW_set_in_keysyms638 ) raise mse - # XKBGrammar.g:98:39: ( COMMA ( NAME | NAME_KEYSYM ) )* - while True: #loop6 - alt6 = 2 - LA6_0 = self.input.LA(1) + # XKBGrammar.g:124:39: ( COMMA ( NAME | NAME_KEYSYM ) )* + while True: #loop5 + alt5 = 2 + LA5_0 = self.input.LA(1) - if (LA6_0 == COMMA) : - alt6 = 1 + if (LA5_0 == COMMA) : + alt5 = 1 - if alt6 == 1: - # XKBGrammar.g:98:40: COMMA ( NAME | NAME_KEYSYM ) - COMMA42 = self.input.LT(1) - self.match(self.input, COMMA, self.FOLLOW_COMMA_in_keysyms561) + if alt5 == 1: + # XKBGrammar.g:124:40: COMMA ( NAME | NAME_KEYSYM ) + COMMA40 = self.input.LT(1) + self.match(self.input, COMMA, self.FOLLOW_COMMA_in_keysyms645) - COMMA42_tree = self.adaptor.createWithPayload(COMMA42) - self.adaptor.addChild(root_0, COMMA42_tree) + COMMA40_tree = self.adaptor.createWithPayload(COMMA40) + self.adaptor.addChild(root_0, COMMA40_tree) - set43 = self.input.LT(1) + set41 = self.input.LT(1) if self.input.LA(1) == NAME or self.input.LA(1) == NAME_KEYSYM: self.input.consume(); - self.adaptor.addChild(root_0, self.adaptor.createWithPayload(set43)) + self.adaptor.addChild(root_0, self.adaptor.createWithPayload(set41)) self.errorRecovery = False else: mse = MismatchedSetException(None, self.input) self.recoverFromMismatchedSet( - self.input, mse, self.FOLLOW_set_in_keysyms563 + self.input, mse, self.FOLLOW_set_in_keysyms647 ) raise mse @@ -1118,22 +1230,22 @@ class XKBGrammarParser(Parser): else: - break #loop6 + break #loop5 - RBRACKET44 = self.input.LT(1) - self.match(self.input, RBRACKET, self.FOLLOW_RBRACKET_in_keysyms571) + RBRACKET42 = self.input.LT(1) + self.match(self.input, RBRACKET, self.FOLLOW_RBRACKET_in_keysyms655) - RBRACKET44_tree = self.adaptor.createWithPayload(RBRACKET44) - self.adaptor.addChild(root_0, RBRACKET44_tree) + RBRACKET42_tree = self.adaptor.createWithPayload(RBRACKET42) + self.adaptor.addChild(root_0, RBRACKET42_tree) - RCURLY45 = self.input.LT(1) - self.match(self.input, RCURLY, self.FOLLOW_RCURLY_in_keysyms573) + RCURLY43 = self.input.LT(1) + self.match(self.input, RCURLY, self.FOLLOW_RCURLY_in_keysyms657) - RCURLY45_tree = self.adaptor.createWithPayload(RCURLY45) - self.adaptor.addChild(root_0, RCURLY45_tree) + RCURLY43_tree = self.adaptor.createWithPayload(RCURLY43) + self.adaptor.addChild(root_0, RCURLY43_tree) @@ -1164,7 +1276,7 @@ class XKBGrammarParser(Parser): # $ANTLR start attribute_xkb - # XKBGrammar.g:101:1: attribute_xkb : ( TOKEN_DEFAULT | TOKEN_HIDDEN | TOKEN_PARTIAL | TOKEN_ALPHANUMERIC_KEYS | TOKEN_MODIFIER_KEYS | TOKEN_ALTERNATE_GROUP | TOKEN_XKB_SYMBOLS -> ^( ATTRIBUTES ATTRIBUTE ) ); + # XKBGrammar.g:131:1: attribute_xkb : ( TOKEN_DEFAULT | TOKEN_HIDDEN | TOKEN_PARTIAL | TOKEN_ALPHANUMERIC_KEYS | TOKEN_ALTERNATE_GROUP | TOKEN_XKB_SYMBOLS -> ^( ATTRIBUTES ATTRIBUTE ) ); def attribute_xkb(self, ): retval = self.attribute_xkb_return() @@ -1172,131 +1284,132 @@ class XKBGrammarParser(Parser): root_0 = None - TOKEN_DEFAULT46 = None - TOKEN_HIDDEN47 = None - TOKEN_PARTIAL48 = None - TOKEN_ALPHANUMERIC_KEYS49 = None - TOKEN_MODIFIER_KEYS50 = None - TOKEN_ALTERNATE_GROUP51 = None - TOKEN_XKB_SYMBOLS52 = None - - TOKEN_DEFAULT46_tree = None - TOKEN_HIDDEN47_tree = None - TOKEN_PARTIAL48_tree = None - TOKEN_ALPHANUMERIC_KEYS49_tree = None - TOKEN_MODIFIER_KEYS50_tree = None - TOKEN_ALTERNATE_GROUP51_tree = None - TOKEN_XKB_SYMBOLS52_tree = None + TOKEN_DEFAULT44 = None + TOKEN_HIDDEN45 = None + TOKEN_PARTIAL46 = None + TOKEN_ALPHANUMERIC_KEYS47 = None + TOKEN_ALTERNATE_GROUP48 = None + TOKEN_XKB_SYMBOLS49 = None + + TOKEN_DEFAULT44_tree = None + TOKEN_HIDDEN45_tree = None + TOKEN_PARTIAL46_tree = None + TOKEN_ALPHANUMERIC_KEYS47_tree = None + TOKEN_ALTERNATE_GROUP48_tree = None + TOKEN_XKB_SYMBOLS49_tree = None stream_TOKEN_XKB_SYMBOLS = RewriteRuleTokenStream(self.adaptor, "token TOKEN_XKB_SYMBOLS") try: try: - # XKBGrammar.g:102:2: ( TOKEN_DEFAULT | TOKEN_HIDDEN | TOKEN_PARTIAL | TOKEN_ALPHANUMERIC_KEYS | TOKEN_MODIFIER_KEYS | TOKEN_ALTERNATE_GROUP | TOKEN_XKB_SYMBOLS -> ^( ATTRIBUTES ATTRIBUTE ) ) - alt7 = 7 - LA7 = self.input.LA(1) - if LA7 == TOKEN_DEFAULT: - alt7 = 1 - elif LA7 == TOKEN_HIDDEN: - alt7 = 2 - elif LA7 == TOKEN_PARTIAL: - alt7 = 3 - elif LA7 == TOKEN_ALPHANUMERIC_KEYS: - alt7 = 4 - elif LA7 == TOKEN_MODIFIER_KEYS: - alt7 = 5 - elif LA7 == TOKEN_ALTERNATE_GROUP: - alt7 = 6 - elif LA7 == TOKEN_XKB_SYMBOLS: - alt7 = 7 + # XKBGrammar.g:132:2: ( TOKEN_DEFAULT | TOKEN_HIDDEN | TOKEN_PARTIAL | TOKEN_ALPHANUMERIC_KEYS | TOKEN_ALTERNATE_GROUP | TOKEN_XKB_SYMBOLS -> ^( ATTRIBUTES ATTRIBUTE ) ) + alt6 = 6 + LA6 = self.input.LA(1) + if LA6 == TOKEN_DEFAULT: + alt6 = 1 + elif LA6 == TOKEN_HIDDEN: + alt6 = 2 + elif LA6 == TOKEN_PARTIAL: + alt6 = 3 + elif LA6 == TOKEN_ALPHANUMERIC_KEYS: + alt6 = 4 + elif LA6 == TOKEN_ALTERNATE_GROUP: + alt6 = 5 + elif LA6 == TOKEN_XKB_SYMBOLS: + alt6 = 6 else: - nvae = NoViableAltException("101:1: attribute_xkb : ( TOKEN_DEFAULT | TOKEN_HIDDEN | TOKEN_PARTIAL | TOKEN_ALPHANUMERIC_KEYS | TOKEN_MODIFIER_KEYS | TOKEN_ALTERNATE_GROUP | TOKEN_XKB_SYMBOLS -> ^( ATTRIBUTES ATTRIBUTE ) );", 7, 0, self.input) + nvae = NoViableAltException("131:1: attribute_xkb : ( TOKEN_DEFAULT | TOKEN_HIDDEN | TOKEN_PARTIAL | TOKEN_ALPHANUMERIC_KEYS | TOKEN_ALTERNATE_GROUP | TOKEN_XKB_SYMBOLS -> ^( ATTRIBUTES ATTRIBUTE ) );", 6, 0, self.input) raise nvae - if alt7 == 1: - # XKBGrammar.g:102:4: TOKEN_DEFAULT - root_0 = self.adaptor.nil() - - TOKEN_DEFAULT46 = self.input.LT(1) - self.match(self.input, TOKEN_DEFAULT, self.FOLLOW_TOKEN_DEFAULT_in_attribute_xkb586) - - - TOKEN_DEFAULT46_tree = self.adaptor.createWithPayload(TOKEN_DEFAULT46) - self.adaptor.addChild(root_0, TOKEN_DEFAULT46_tree) - - - - elif alt7 == 2: - # XKBGrammar.g:103:4: TOKEN_HIDDEN + if alt6 == 1: + # XKBGrammar.g:132:4: TOKEN_DEFAULT root_0 = self.adaptor.nil() - TOKEN_HIDDEN47 = self.input.LT(1) - self.match(self.input, TOKEN_HIDDEN, self.FOLLOW_TOKEN_HIDDEN_in_attribute_xkb591) + TOKEN_DEFAULT44 = self.input.LT(1) + self.match(self.input, TOKEN_DEFAULT, self.FOLLOW_TOKEN_DEFAULT_in_attribute_xkb674) - TOKEN_HIDDEN47_tree = self.adaptor.createWithPayload(TOKEN_HIDDEN47) - self.adaptor.addChild(root_0, TOKEN_HIDDEN47_tree) + TOKEN_DEFAULT44_tree = self.adaptor.createWithPayload(TOKEN_DEFAULT44) + self.adaptor.addChild(root_0, TOKEN_DEFAULT44_tree) + #action start + print "default", + #action end - elif alt7 == 3: - # XKBGrammar.g:104:4: TOKEN_PARTIAL + elif alt6 == 2: + # XKBGrammar.g:133:4: TOKEN_HIDDEN root_0 = self.adaptor.nil() - TOKEN_PARTIAL48 = self.input.LT(1) - self.match(self.input, TOKEN_PARTIAL, self.FOLLOW_TOKEN_PARTIAL_in_attribute_xkb600) + TOKEN_HIDDEN45 = self.input.LT(1) + self.match(self.input, TOKEN_HIDDEN, self.FOLLOW_TOKEN_HIDDEN_in_attribute_xkb682) - TOKEN_PARTIAL48_tree = self.adaptor.createWithPayload(TOKEN_PARTIAL48) - self.adaptor.addChild(root_0, TOKEN_PARTIAL48_tree) + TOKEN_HIDDEN45_tree = self.adaptor.createWithPayload(TOKEN_HIDDEN45) + self.adaptor.addChild(root_0, TOKEN_HIDDEN45_tree) + #action start + print "hidden", + #action end - elif alt7 == 4: - # XKBGrammar.g:105:4: TOKEN_ALPHANUMERIC_KEYS + elif alt6 == 3: + # XKBGrammar.g:134:4: TOKEN_PARTIAL root_0 = self.adaptor.nil() - TOKEN_ALPHANUMERIC_KEYS49 = self.input.LT(1) - self.match(self.input, TOKEN_ALPHANUMERIC_KEYS, self.FOLLOW_TOKEN_ALPHANUMERIC_KEYS_in_attribute_xkb609) + TOKEN_PARTIAL46 = self.input.LT(1) + self.match(self.input, TOKEN_PARTIAL, self.FOLLOW_TOKEN_PARTIAL_in_attribute_xkb691) - TOKEN_ALPHANUMERIC_KEYS49_tree = self.adaptor.createWithPayload(TOKEN_ALPHANUMERIC_KEYS49) - self.adaptor.addChild(root_0, TOKEN_ALPHANUMERIC_KEYS49_tree) + TOKEN_PARTIAL46_tree = self.adaptor.createWithPayload(TOKEN_PARTIAL46) + self.adaptor.addChild(root_0, TOKEN_PARTIAL46_tree) + #action start + print "partial", + #action end - elif alt7 == 5: - # XKBGrammar.g:106:4: TOKEN_MODIFIER_KEYS + elif alt6 == 4: + # XKBGrammar.g:135:4: TOKEN_ALPHANUMERIC_KEYS root_0 = self.adaptor.nil() - TOKEN_MODIFIER_KEYS50 = self.input.LT(1) - self.match(self.input, TOKEN_MODIFIER_KEYS, self.FOLLOW_TOKEN_MODIFIER_KEYS_in_attribute_xkb616) + TOKEN_ALPHANUMERIC_KEYS47 = self.input.LT(1) + self.match(self.input, TOKEN_ALPHANUMERIC_KEYS, self.FOLLOW_TOKEN_ALPHANUMERIC_KEYS_in_attribute_xkb700) - TOKEN_MODIFIER_KEYS50_tree = self.adaptor.createWithPayload(TOKEN_MODIFIER_KEYS50) - self.adaptor.addChild(root_0, TOKEN_MODIFIER_KEYS50_tree) + TOKEN_ALPHANUMERIC_KEYS47_tree = self.adaptor.createWithPayload(TOKEN_ALPHANUMERIC_KEYS47) + self.adaptor.addChild(root_0, TOKEN_ALPHANUMERIC_KEYS47_tree) + #action start + print "alphanumeric_keys", + #action end - elif alt7 == 6: - # XKBGrammar.g:107:4: TOKEN_ALTERNATE_GROUP + elif alt6 == 5: + # XKBGrammar.g:137:4: TOKEN_ALTERNATE_GROUP root_0 = self.adaptor.nil() - TOKEN_ALTERNATE_GROUP51 = self.input.LT(1) - self.match(self.input, TOKEN_ALTERNATE_GROUP, self.FOLLOW_TOKEN_ALTERNATE_GROUP_in_attribute_xkb624) + TOKEN_ALTERNATE_GROUP48 = self.input.LT(1) + self.match(self.input, TOKEN_ALTERNATE_GROUP, self.FOLLOW_TOKEN_ALTERNATE_GROUP_in_attribute_xkb710) - TOKEN_ALTERNATE_GROUP51_tree = self.adaptor.createWithPayload(TOKEN_ALTERNATE_GROUP51) - self.adaptor.addChild(root_0, TOKEN_ALTERNATE_GROUP51_tree) + TOKEN_ALTERNATE_GROUP48_tree = self.adaptor.createWithPayload(TOKEN_ALTERNATE_GROUP48) + self.adaptor.addChild(root_0, TOKEN_ALTERNATE_GROUP48_tree) + #action start + print "alternate_group", + #action end - elif alt7 == 7: - # XKBGrammar.g:108:4: TOKEN_XKB_SYMBOLS - TOKEN_XKB_SYMBOLS52 = self.input.LT(1) - self.match(self.input, TOKEN_XKB_SYMBOLS, self.FOLLOW_TOKEN_XKB_SYMBOLS_in_attribute_xkb631) + elif alt6 == 6: + # XKBGrammar.g:138:4: TOKEN_XKB_SYMBOLS + TOKEN_XKB_SYMBOLS49 = self.input.LT(1) + self.match(self.input, TOKEN_XKB_SYMBOLS, self.FOLLOW_TOKEN_XKB_SYMBOLS_in_attribute_xkb717) - stream_TOKEN_XKB_SYMBOLS.add(TOKEN_XKB_SYMBOLS52) + stream_TOKEN_XKB_SYMBOLS.add(TOKEN_XKB_SYMBOLS49) + #action start + print "xkb_symbols", + #action end # AST Rewrite # elements: # token labels: @@ -1313,8 +1426,8 @@ class XKBGrammarParser(Parser): root_0 = self.adaptor.nil() - # 108:22: -> ^( ATTRIBUTES ATTRIBUTE ) - # XKBGrammar.g:108:25: ^( ATTRIBUTES ATTRIBUTE ) + # 139:2: -> ^( ATTRIBUTES ATTRIBUTE ) + # XKBGrammar.g:139:5: ^( ATTRIBUTES ATTRIBUTE ) root_1 = self.adaptor.nil() root_1 = self.adaptor.becomeRoot(self.adaptor.createFromType(ATTRIBUTES, "ATTRIBUTES"), root_1) @@ -1346,59 +1459,60 @@ class XKBGrammarParser(Parser): - FOLLOW_statement_in_layout336 = frozenset([4, 5, 6, 7, 8, 9, 10]) - FOLLOW_EOF_in_layout339 = frozenset([1]) - FOLLOW_preamble_in_statement352 = frozenset([20]) - FOLLOW_quotedstring_in_statement354 = frozenset([17]) - FOLLOW_LCURLY_in_statement356 = frozenset([11, 12, 13, 14]) - FOLLOW_sectionmaterial_in_statement358 = frozenset([11, 12, 13, 14, 18]) - FOLLOW_RCURLY_in_statement361 = frozenset([23]) - FOLLOW_SEMICOLON_in_statement363 = frozenset([1]) - FOLLOW_attribute_xkb_in_preamble373 = frozenset([1, 4, 5, 6, 7, 8, 9, 10]) - FOLLOW_DQUOTE_in_quotedstring383 = frozenset([4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40]) - FOLLOW_set_in_quotedstring385 = frozenset([4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40]) - FOLLOW_DQUOTE_in_quotedstring391 = frozenset([1]) - FOLLOW_line_include_in_sectionmaterial402 = frozenset([1]) - FOLLOW_line_name_in_sectionmaterial408 = frozenset([1]) - FOLLOW_line_keytype_in_sectionmaterial414 = frozenset([1]) - FOLLOW_line_key_in_sectionmaterial420 = frozenset([1]) - FOLLOW_TOKEN_INCLUDE_in_line_include437 = frozenset([20]) - FOLLOW_quotedstring_in_line_include439 = frozenset([1]) - FOLLOW_TOKEN_NAME_in_line_name450 = frozenset([15]) - FOLLOW_LBRACKET_in_line_name452 = frozenset([32]) - FOLLOW_NAME_in_line_name456 = frozenset([16]) - FOLLOW_RBRACKET_in_line_name458 = frozenset([24]) - FOLLOW_EQUAL_in_line_name460 = frozenset([20]) - FOLLOW_quotedstring_in_line_name462 = frozenset([23]) - FOLLOW_SEMICOLON_in_line_name464 = frozenset([1]) - FOLLOW_TOKEN_KEY_TYPE_in_line_keytype475 = frozenset([15]) - FOLLOW_LBRACKET_in_line_keytype477 = frozenset([32]) - FOLLOW_NAME_in_line_keytype481 = frozenset([16]) - FOLLOW_RBRACKET_in_line_keytype483 = frozenset([24]) - FOLLOW_EQUAL_in_line_keytype485 = frozenset([20]) - FOLLOW_DQUOTE_in_line_keytype487 = frozenset([32]) - FOLLOW_NAME_in_line_keytype491 = frozenset([20]) - FOLLOW_DQUOTE_in_line_keytype493 = frozenset([23]) - FOLLOW_SEMICOLON_in_line_keytype495 = frozenset([1]) - FOLLOW_TOKEN_KEY_in_line_key507 = frozenset([25]) - FOLLOW_keycode_in_line_key509 = frozenset([17]) - FOLLOW_keysyms_in_line_key511 = frozenset([23]) - FOLLOW_SEMICOLON_in_line_key513 = frozenset([1]) - FOLLOW_LOWERTHAN_in_keycode526 = frozenset([32]) - FOLLOW_NAME_in_keycode528 = frozenset([26]) - FOLLOW_GREATERTHAN_in_keycode530 = frozenset([1]) - FOLLOW_LCURLY_in_keysyms550 = frozenset([15]) - FOLLOW_LBRACKET_in_keysyms552 = frozenset([32, 35]) - FOLLOW_set_in_keysyms554 = frozenset([16, 19]) - FOLLOW_COMMA_in_keysyms561 = frozenset([32, 35]) - FOLLOW_set_in_keysyms563 = frozenset([16, 19]) - FOLLOW_RBRACKET_in_keysyms571 = frozenset([18]) - FOLLOW_RCURLY_in_keysyms573 = frozenset([1]) - FOLLOW_TOKEN_DEFAULT_in_attribute_xkb586 = frozenset([1]) - FOLLOW_TOKEN_HIDDEN_in_attribute_xkb591 = frozenset([1]) - FOLLOW_TOKEN_PARTIAL_in_attribute_xkb600 = frozenset([1]) - FOLLOW_TOKEN_ALPHANUMERIC_KEYS_in_attribute_xkb609 = frozenset([1]) - FOLLOW_TOKEN_MODIFIER_KEYS_in_attribute_xkb616 = frozenset([1]) - FOLLOW_TOKEN_ALTERNATE_GROUP_in_attribute_xkb624 = frozenset([1]) - FOLLOW_TOKEN_XKB_SYMBOLS_in_attribute_xkb631 = frozenset([1]) + FOLLOW_section_in_layout349 = frozenset([4, 5, 6, 7, 9, 10]) + FOLLOW_EOF_in_layout352 = frozenset([1]) + FOLLOW_preamble_in_section368 = frozenset([18]) + FOLLOW_sectionmaterial_in_section370 = frozenset([1]) + FOLLOW_attribute_xkb_in_preamble391 = frozenset([4, 5, 6, 7, 9, 10, 21]) + FOLLOW_quotedstring_in_preamble396 = frozenset([1]) + FOLLOW_DQUOTE_in_quotedstring414 = frozenset([4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42]) + FOLLOW_set_in_quotedstring418 = frozenset([4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42]) + FOLLOW_DQUOTE_in_quotedstring424 = frozenset([1]) + FOLLOW_LCURLY_in_sectionmaterial438 = frozenset([11, 12, 13, 14, 37]) + FOLLOW_line_include_in_sectionmaterial441 = frozenset([11, 12, 13, 14, 19, 37]) + FOLLOW_line_name_in_sectionmaterial447 = frozenset([11, 12, 13, 14, 19, 37]) + FOLLOW_line_keytype_in_sectionmaterial453 = frozenset([11, 12, 13, 14, 19, 37]) + FOLLOW_line_key_in_sectionmaterial459 = frozenset([11, 12, 13, 14, 19, 37]) + FOLLOW_line_comment_in_sectionmaterial466 = frozenset([11, 12, 13, 14, 19, 37]) + FOLLOW_RCURLY_in_sectionmaterial470 = frozenset([24]) + FOLLOW_SEMICOLON_in_sectionmaterial472 = frozenset([1]) + FOLLOW_COMMENT_in_line_comment483 = frozenset([1]) + FOLLOW_TOKEN_INCLUDE_in_line_include497 = frozenset([21]) + FOLLOW_quotedstring_in_line_include501 = frozenset([1]) + FOLLOW_TOKEN_NAME_in_line_name516 = frozenset([16]) + FOLLOW_LBRACKET_in_line_name518 = frozenset([32]) + FOLLOW_NAME_in_line_name522 = frozenset([17]) + FOLLOW_RBRACKET_in_line_name524 = frozenset([25]) + FOLLOW_EQUAL_in_line_name526 = frozenset([21]) + FOLLOW_quotedstring_in_line_name530 = frozenset([24]) + FOLLOW_SEMICOLON_in_line_name532 = frozenset([1]) + FOLLOW_TOKEN_KEY_TYPE_in_line_keytype546 = frozenset([16]) + FOLLOW_LBRACKET_in_line_keytype548 = frozenset([32]) + FOLLOW_NAME_in_line_keytype552 = frozenset([17]) + FOLLOW_RBRACKET_in_line_keytype554 = frozenset([25]) + FOLLOW_EQUAL_in_line_keytype556 = frozenset([21]) + FOLLOW_DQUOTE_in_line_keytype558 = frozenset([32]) + FOLLOW_NAME_in_line_keytype562 = frozenset([21]) + FOLLOW_DQUOTE_in_line_keytype564 = frozenset([24]) + FOLLOW_SEMICOLON_in_line_keytype566 = frozenset([1]) + FOLLOW_TOKEN_KEY_in_line_key586 = frozenset([26]) + FOLLOW_keycode_in_line_key588 = frozenset([18]) + FOLLOW_keysyms_in_line_key590 = frozenset([24]) + FOLLOW_SEMICOLON_in_line_key592 = frozenset([1]) + FOLLOW_LOWERTHAN_in_keycode608 = frozenset([32]) + FOLLOW_NAME_in_keycode610 = frozenset([27]) + FOLLOW_GREATERTHAN_in_keycode612 = frozenset([1]) + FOLLOW_LCURLY_in_keysyms634 = frozenset([16]) + FOLLOW_LBRACKET_in_keysyms636 = frozenset([32, 38]) + FOLLOW_set_in_keysyms638 = frozenset([17, 20]) + FOLLOW_COMMA_in_keysyms645 = frozenset([32, 38]) + FOLLOW_set_in_keysyms647 = frozenset([17, 20]) + FOLLOW_RBRACKET_in_keysyms655 = frozenset([19]) + FOLLOW_RCURLY_in_keysyms657 = frozenset([1]) + FOLLOW_TOKEN_DEFAULT_in_attribute_xkb674 = frozenset([1]) + FOLLOW_TOKEN_HIDDEN_in_attribute_xkb682 = frozenset([1]) + FOLLOW_TOKEN_PARTIAL_in_attribute_xkb691 = frozenset([1]) + FOLLOW_TOKEN_ALPHANUMERIC_KEYS_in_attribute_xkb700 = frozenset([1]) + FOLLOW_TOKEN_ALTERNATE_GROUP_in_attribute_xkb710 = frozenset([1]) + FOLLOW_TOKEN_XKB_SYMBOLS_in_attribute_xkb717 = frozenset([1]) diff --git a/XKBGrammar/XKBGrammarParser.pyc b/XKBGrammar/XKBGrammarParser.pyc Binary files differ. diff --git a/XKBGrammar/XKBGrammar__.g b/XKBGrammar/XKBGrammar__.g @@ -15,6 +15,7 @@ TOKEN_INCLUDE : 'include' ; TOKEN_KEY_TYPE : 'key.type' ; TOKEN_NAME : 'name' ; TOKEN_KEY : 'key' ; +TOKEN_MODIFIER_MAP : 'modifier_map' ; LBRACKET : '[' ; RBRACKET : ']' ; LCURLY : '{' ; @@ -29,37 +30,37 @@ LOWERTHAN : '<' ; GREATERTHAN : '>' ; DOT : '.' ; -// $ANTLR src "XKBGrammar.g" 123 +// $ANTLR src "XKBGrammar.g" 154 NAME : ('a'..'z'|'A'..'Z'|'_')('a'..'z'|'A'..'Z'|'_'|'0'..'9')* ; -// $ANTLR src "XKBGrammar.g" 127 +// $ANTLR src "XKBGrammar.g" 158 NAME_INCLUDE : ('a'..'z'|'A'..'Z'|'_')('a'..'z'|'A'..'Z'|'_'|'('|')'|'0'..'9')* ; -// $ANTLR src "XKBGrammar.g" 131 +// $ANTLR src "XKBGrammar.g" 162 NAME_KEYSYM : ('0'..'9'|'a'..'z'|'A'..'Z')('a'..'z'|'A'..'Z'|'_'|'0'..'9')* ; -// $ANTLR src "XKBGrammar.g" 135 +// $ANTLR src "XKBGrammar.g" 166 NAME_GROUP : ('0'..'9'|'a'..'z'|'A'..'Z')('a'..'z'|'A'..'Z'|'_'|'-'|'.'|'0'..'9')* ; -// $ANTLR src "XKBGrammar.g" 139 +// $ANTLR src "XKBGrammar.g" 170 COMMENT : '//' (~('\n'|'\r'))* { $channel = HIDDEN; } ; -// $ANTLR src "XKBGrammar.g" 143 +// $ANTLR src "XKBGrammar.g" 174 WS : ('\t'|' '|NEWLINE)+ { $channel=HIDDEN; } ; -// $ANTLR src "XKBGrammar.g" 147 +// $ANTLR src "XKBGrammar.g" 178 fragment NEWLINE : '\r'|'\n' ; diff --git a/XKBGrammar/check_xkb.py b/XKBGrammar/check_xkb.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- import sys import antlr3 @@ -14,7 +15,7 @@ def getChildrenByType(tree, type_value): xkbfilename = "gr" if len(sys.argv) > 1: - formula = sys.argv[1] + xkbfilename = sys.argv[1] try: xkbfile = open(xkbfilename, 'r') @@ -22,25 +23,14 @@ except OSError: print "Could not open file ", xkbfilename, ". Aborting..." sys.exit(-1) -xkbcontents = xkbfile.read() xkbfile.close -print "Creating character stream...", -char_stream = antlr3.ANTLRStringStream(xkbcontents) -print " done." -print "Performing the lexer...", +char_stream = antlr3.ANTLRFileStream(xkbfilename, encoding='utf-8') lexer = XKBGrammarLexer(char_stream) -print " done." -print "Extracting tokens...", tokens = antlr3.CommonTokenStream(lexer) -print " done." -print "Performing the parser...", parser = XKBGrammarParser(tokens) -print " done." -print "Executing the function...", result = parser.layout() -print "done." # Get all of the SPECIES children for attribute in getChildrenByType(result.tree, INCLUDE): diff --git a/XKBGrammar/gr b/XKBGrammar/gr @@ -1,15 +1,12 @@ - +// my comment partial alphanumeric_keys alternate_group xkb_symbols "extended" { - + // my comment include "gr(basic)" - name[Group1] = "Greece - Extended"; - - key.type[Group1] = "THREE_LEVEL"; - - key <AE03> { [ NoSymbol, NoSymbol, sterling ] }; // - key <AE10> { [ NoSymbol, NoSymbol, degree ] }; // + key.type[Group1] = "THREE_LEVEL"; // yeah, comment + key <AE03> { [ NoSymbol, NoSymbol, sterling ] }; // my comment + key <AE10> { [ NoSymbol, NoSymbol, degree ] }; // more comment include "level3(ralt_switch)" include "eurosign(5)"