keyboardlayouteditor

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

commit 170308d488a8788b059df601e67ca7ff7d1884bf
parent 0273e75831bf47b83b8d35230d5a0af8bce4f717
Author: simos.lists <simos.lists@70737e48-4f4a-0410-8df8-290828ad50c4>
Date:   Sun, 18 May 2008 15:28:07 +0000

Names can not have +- in them (for inet)

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

Diffstat:
MXKBGrammar/XKBGrammar.g | 2+-
MXKBGrammar/XKBGrammarLexer.py | 88++++++++++++++++++++++++++++++++++++++++----------------------------------------
MXKBGrammar/XKBGrammarLexer.pyc | 0
MXKBGrammar/XKBGrammarParser.py | 10+++++-----
MXKBGrammar/XKBGrammarParser.pyc | 0
MXKBGrammar/check_xkb.py | 2+-
6 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/XKBGrammar/XKBGrammar.g b/XKBGrammar/XKBGrammar.g @@ -131,7 +131,7 @@ state ; NAME - : ('a'..'z'|'A'..'Z'|'_'|'('|')'|'0'..'9')* + : ( 'a'..'z' | 'A'..'Z' | '_' | '(' | ')' | '0'..'9' | '+' | '-' )* ; WS diff --git a/XKBGrammar/XKBGrammarLexer.py b/XKBGrammar/XKBGrammarLexer.py @@ -1,4 +1,4 @@ -# $ANTLR 3.1b1 XKBGrammar.g 2008-05-17 13:54:29 +# $ANTLR 3.1b1 XKBGrammar.g 2008-05-18 16:27:20 import sys from antlr3 import * @@ -818,20 +818,20 @@ class XKBGrammarLexer(Lexer): _type = NAME _channel = DEFAULT_CHANNEL - # XKBGrammar.g:134:2: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '(' | ')' | '0' .. '9' )* ) - # XKBGrammar.g:134:4: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '(' | ')' | '0' .. '9' )* - # XKBGrammar.g:134:4: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '(' | ')' | '0' .. '9' )* + # XKBGrammar.g:134:2: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '(' | ')' | '0' .. '9' | '+' | '-' )* ) + # XKBGrammar.g:134:4: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '(' | ')' | '0' .. '9' | '+' | '-' )* + # XKBGrammar.g:134:4: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '(' | ')' | '0' .. '9' | '+' | '-' )* while True: #loop1 alt1 = 2 LA1_0 = self.input.LA(1) - if ((40 <= LA1_0 <= 41) or (48 <= LA1_0 <= 57) or (65 <= LA1_0 <= 90) or LA1_0 == 95 or (97 <= LA1_0 <= 122)) : + if ((40 <= LA1_0 <= 41) or LA1_0 == 43 or LA1_0 == 45 or (48 <= LA1_0 <= 57) or (65 <= LA1_0 <= 90) or LA1_0 == 95 or (97 <= LA1_0 <= 122)) : alt1 = 1 if alt1 == 1: # XKBGrammar.g: - if (40 <= self.input.LA(1) <= 41) or (48 <= self.input.LA(1) <= 57) or (65 <= self.input.LA(1) <= 90) or self.input.LA(1) == 95 or (97 <= self.input.LA(1) <= 122): + if (40 <= self.input.LA(1) <= 41) or self.input.LA(1) == 43 or self.input.LA(1) == 45 or (48 <= self.input.LA(1) <= 57) or (65 <= self.input.LA(1) <= 90) or self.input.LA(1) == 95 or (97 <= self.input.LA(1) <= 122): self.input.consume(); else: mse = MismatchedSetException(None, self.input) @@ -1392,8 +1392,8 @@ class XKBGrammarLexer(Lexer): DFA.unpack(u""), DFA.unpack(u"\1\70"), DFA.unpack(u"\1\71"), - DFA.unpack(u"\2\27\4\uffff\1\72\1\uffff\12\27\7\uffff\32\27\4\uffff" - u"\1\27\1\uffff\32\27"), + DFA.unpack(u"\2\27\1\uffff\1\27\1\uffff\1\27\1\72\1\uffff\12\27\7" + u"\uffff\32\27\4\uffff\1\27\1\uffff\32\27"), DFA.unpack(u"\1\74"), DFA.unpack(u"\1\75"), DFA.unpack(u"\1\76"), @@ -1406,8 +1406,8 @@ class XKBGrammarLexer(Lexer): DFA.unpack(u"\1\105"), DFA.unpack(u"\1\106\1\107\1\110\1\111\1\112"), DFA.unpack(u"\1\113"), - DFA.unpack(u"\2\27\6\uffff\12\27\7\uffff\32\27\4\uffff\1\27\1\uffff" - u"\32\27"), + DFA.unpack(u"\2\27\1\uffff\1\27\1\uffff\1\27\2\uffff\12\27\7\uffff" + u"\32\27\4\uffff\1\27\1\uffff\32\27"), DFA.unpack(u""), DFA.unpack(u""), DFA.unpack(u"\1\115"), @@ -1419,18 +1419,18 @@ class XKBGrammarLexer(Lexer): DFA.unpack(u"\1\123"), DFA.unpack(u"\1\124"), DFA.unpack(u"\1\125"), - DFA.unpack(u"\2\27\6\uffff\12\27\7\uffff\32\27\4\uffff\1\27\1\uffff" - u"\32\27"), - DFA.unpack(u"\2\27\6\uffff\12\27\7\uffff\32\27\4\uffff\1\27\1\uffff" - u"\32\27"), - DFA.unpack(u"\2\27\6\uffff\12\27\7\uffff\32\27\4\uffff\1\27\1\uffff" - u"\32\27"), - DFA.unpack(u"\2\27\6\uffff\12\27\7\uffff\32\27\4\uffff\1\27\1\uffff" - u"\32\27"), - DFA.unpack(u"\2\27\6\uffff\12\27\7\uffff\32\27\4\uffff\1\27\1\uffff" - u"\32\27"), - DFA.unpack(u"\2\27\6\uffff\12\27\7\uffff\32\27\4\uffff\1\27\1\uffff" - u"\32\27"), + DFA.unpack(u"\2\27\1\uffff\1\27\1\uffff\1\27\2\uffff\12\27\7\uffff" + u"\32\27\4\uffff\1\27\1\uffff\32\27"), + DFA.unpack(u"\2\27\1\uffff\1\27\1\uffff\1\27\2\uffff\12\27\7\uffff" + u"\32\27\4\uffff\1\27\1\uffff\32\27"), + DFA.unpack(u"\2\27\1\uffff\1\27\1\uffff\1\27\2\uffff\12\27\7\uffff" + u"\32\27\4\uffff\1\27\1\uffff\32\27"), + DFA.unpack(u"\2\27\1\uffff\1\27\1\uffff\1\27\2\uffff\12\27\7\uffff" + u"\32\27\4\uffff\1\27\1\uffff\32\27"), + DFA.unpack(u"\2\27\1\uffff\1\27\1\uffff\1\27\2\uffff\12\27\7\uffff" + u"\32\27\4\uffff\1\27\1\uffff\32\27"), + DFA.unpack(u"\2\27\1\uffff\1\27\1\uffff\1\27\2\uffff\12\27\7\uffff" + u"\32\27\4\uffff\1\27\1\uffff\32\27"), DFA.unpack(u"\1\134"), DFA.unpack(u""), DFA.unpack(u"\1\135"), @@ -1440,8 +1440,8 @@ class XKBGrammarLexer(Lexer): DFA.unpack(u"\1\141"), DFA.unpack(u"\1\142"), DFA.unpack(u"\1\143"), - DFA.unpack(u"\2\27\6\uffff\12\27\7\uffff\32\27\4\uffff\1\27\1\uffff" - u"\32\27"), + DFA.unpack(u"\2\27\1\uffff\1\27\1\uffff\1\27\2\uffff\12\27\7\uffff" + u"\32\27\4\uffff\1\27\1\uffff\32\27"), DFA.unpack(u"\1\145"), DFA.unpack(u""), DFA.unpack(u""), @@ -1452,27 +1452,27 @@ class XKBGrammarLexer(Lexer): DFA.unpack(u"\1\146"), DFA.unpack(u"\1\147"), DFA.unpack(u"\1\150"), - DFA.unpack(u"\2\27\6\uffff\12\27\7\uffff\32\27\4\uffff\1\27\1\uffff" - u"\32\27"), + DFA.unpack(u"\2\27\1\uffff\1\27\1\uffff\1\27\2\uffff\12\27\7\uffff" + u"\32\27\4\uffff\1\27\1\uffff\32\27"), DFA.unpack(u"\1\152"), DFA.unpack(u"\1\153"), DFA.unpack(u"\1\154"), DFA.unpack(u"\1\155"), DFA.unpack(u""), DFA.unpack(u"\1\156"), - DFA.unpack(u"\2\27\6\uffff\12\27\7\uffff\32\27\4\uffff\1\27\1\uffff" - u"\32\27"), + DFA.unpack(u"\2\27\1\uffff\1\27\1\uffff\1\27\2\uffff\12\27\7\uffff" + u"\32\27\4\uffff\1\27\1\uffff\32\27"), DFA.unpack(u"\1\160"), - DFA.unpack(u"\2\27\6\uffff\12\27\7\uffff\32\27\4\uffff\1\27\1\uffff" - u"\32\27"), + DFA.unpack(u"\2\27\1\uffff\1\27\1\uffff\1\27\2\uffff\12\27\7\uffff" + u"\32\27\4\uffff\1\27\1\uffff\32\27"), DFA.unpack(u""), - DFA.unpack(u"\2\27\6\uffff\12\27\7\uffff\32\27\4\uffff\1\27\1\uffff" - u"\32\27"), + DFA.unpack(u"\2\27\1\uffff\1\27\1\uffff\1\27\2\uffff\12\27\7\uffff" + u"\32\27\4\uffff\1\27\1\uffff\32\27"), DFA.unpack(u"\1\163"), DFA.unpack(u"\1\164"), DFA.unpack(u"\1\165"), - DFA.unpack(u"\2\27\6\uffff\12\27\7\uffff\32\27\4\uffff\1\27\1\uffff" - u"\32\27"), + DFA.unpack(u"\2\27\1\uffff\1\27\1\uffff\1\27\2\uffff\12\27\7\uffff" + u"\32\27\4\uffff\1\27\1\uffff\32\27"), DFA.unpack(u""), DFA.unpack(u"\1\167"), DFA.unpack(u""), @@ -1494,29 +1494,29 @@ class XKBGrammarLexer(Lexer): DFA.unpack(u"\1\u0086"), DFA.unpack(u"\1\u0087"), DFA.unpack(u"\1\u0088"), - DFA.unpack(u"\2\27\6\uffff\12\27\7\uffff\32\27\4\uffff\1\27\1\uffff" - u"\32\27"), - DFA.unpack(u"\2\27\6\uffff\12\27\7\uffff\32\27\4\uffff\1\27\1\uffff" - u"\32\27"), + DFA.unpack(u"\2\27\1\uffff\1\27\1\uffff\1\27\2\uffff\12\27\7\uffff" + u"\32\27\4\uffff\1\27\1\uffff\32\27"), + DFA.unpack(u"\2\27\1\uffff\1\27\1\uffff\1\27\2\uffff\12\27\7\uffff" + u"\32\27\4\uffff\1\27\1\uffff\32\27"), DFA.unpack(u"\1\u008b"), DFA.unpack(u"\1\u008c"), DFA.unpack(u"\1\u008d"), DFA.unpack(u""), DFA.unpack(u""), - DFA.unpack(u"\2\27\6\uffff\12\27\7\uffff\32\27\4\uffff\1\27\1\uffff" - u"\32\27"), + DFA.unpack(u"\2\27\1\uffff\1\27\1\uffff\1\27\2\uffff\12\27\7\uffff" + u"\32\27\4\uffff\1\27\1\uffff\32\27"), DFA.unpack(u"\1\u008f"), DFA.unpack(u"\1\u0090"), DFA.unpack(u""), DFA.unpack(u"\1\u0091"), DFA.unpack(u"\1\u0092"), DFA.unpack(u"\1\u0093"), - DFA.unpack(u"\2\27\6\uffff\12\27\7\uffff\32\27\4\uffff\1\27\1\uffff" - u"\32\27"), + DFA.unpack(u"\2\27\1\uffff\1\27\1\uffff\1\27\2\uffff\12\27\7\uffff" + u"\32\27\4\uffff\1\27\1\uffff\32\27"), DFA.unpack(u"\1\u0095"), DFA.unpack(u""), - DFA.unpack(u"\2\27\6\uffff\12\27\7\uffff\32\27\4\uffff\1\27\1\uffff" - u"\32\27"), + DFA.unpack(u"\2\27\1\uffff\1\27\1\uffff\1\27\2\uffff\12\27\7\uffff" + u"\32\27\4\uffff\1\27\1\uffff\32\27"), DFA.unpack(u"") ] diff --git a/XKBGrammar/XKBGrammarLexer.pyc b/XKBGrammar/XKBGrammarLexer.pyc Binary files differ. diff --git a/XKBGrammar/XKBGrammarParser.py b/XKBGrammar/XKBGrammarParser.py @@ -1,4 +1,4 @@ -# $ANTLR 3.1b1 XKBGrammar.g 2008-05-17 13:54:29 +# $ANTLR 3.1b1 XKBGrammar.g 2008-05-18 16:27:19 import sys from antlr3 import * @@ -401,7 +401,7 @@ class XKBGrammarParser(Parser): self.match(self.input, DQSTRING, self.FOLLOW_DQSTRING_in_mapType182) stream_DQSTRING.add(DQSTRING9) # AST Rewrite - # elements: mapOptions, DQSTRING + # elements: DQSTRING, mapOptions # token labels: # rule labels: retval # token list labels: @@ -889,7 +889,7 @@ class XKBGrammarParser(Parser): self.match(self.input, DQSTRING, self.FOLLOW_DQSTRING_in_line_keytype336) stream_DQSTRING.add(n2) # AST Rewrite - # elements: n2, n1 + # elements: n1, n2 # token labels: n1, n2 # rule labels: retval # token list labels: @@ -995,7 +995,7 @@ class XKBGrammarParser(Parser): self._state.following.pop() stream_keysyms.add(keysyms31.tree) # AST Rewrite - # elements: keycode, keysyms + # elements: keysyms, keycode # token labels: # rule labels: retval # token list labels: @@ -1136,7 +1136,7 @@ class XKBGrammarParser(Parser): self.match(self.input, 25, self.FOLLOW_25_in_line_modifier_map406) stream_25.add(char_literal38) # AST Rewrite - # elements: keycode, state + # elements: state, keycode # token labels: # rule labels: retval # token list labels: diff --git a/XKBGrammar/XKBGrammarParser.pyc b/XKBGrammar/XKBGrammarParser.pyc Binary files differ. diff --git a/XKBGrammar/check_xkb.py b/XKBGrammar/check_xkb.py @@ -52,7 +52,7 @@ nodes.setTokenStream(tokens) walker = XKBGrammarWalker(nodes) walker.layout() -print "Layout has", result.tree.getChildCount(), "sections" +print "Layout has", result.tree.getChildCount(), "sections", result.tree.getText() for section in result.tree.getChildren(): print "// Section" for mapobject in section.getChildren():