From: leo Date: Tue, 7 Jul 2009 04:36:09 +0000 (+0000) Subject: removed some warning messages X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e6513357f2b16fcb1abb623dba867c0d6e2e2610;hp=3ac04828560136bc3ccfc800c130f94518b3c100;p=xerial%2Fxerial-core.git removed some warning messages git-svn-id: http://www.xerial.org/svn/project/XerialJ/trunk/xerial-core@3449 ae02f08e-27ec-0310-ae8c-8ba02fe2eafd --- diff --git a/src/main/java/org/xerial/json/JSONObject.java b/src/main/java/org/xerial/json/JSONObject.java index 726b3c3..d7aee4d 100644 --- a/src/main/java/org/xerial/json/JSONObject.java +++ b/src/main/java/org/xerial/json/JSONObject.java @@ -48,12 +48,10 @@ import org.xerial.json.impl.JSONWalker; * @author leo * */ -public class JSONObject extends JSONValueBase -{ +public class JSONObject extends JSONValueBase { @SuppressWarnings("serial") - class JSONObjectContent extends LinkedHashMap - { + class JSONObjectContent extends LinkedHashMap { } JSONObjectContent content = new JSONObjectContent(); @@ -61,26 +59,21 @@ public class JSONObject extends JSONValueBase /** * */ - public JSONObject() - { + public JSONObject() { } - public JSONObject(JSONTokenizer x) throws JSONException - { + public JSONObject(JSONTokenizer x) throws JSONException { this(); char c; String key; - if (x.nextClean() != '{') - { + if (x.nextClean() != '{') { throw x.syntaxError("A JSONObject text must begin with '{'"); } - for (;;) - { + for (;;) { c = x.nextClean(); - switch (c) - { + switch (c) { case 0: throw x.syntaxError("A JSONObject text must end with '}'"); case '}': @@ -95,15 +88,12 @@ public class JSONObject extends JSONValueBase */ c = x.nextClean(); - if (c == '=') - { - if (x.next() != '>') - { + if (c == '=') { + if (x.next() != '>') { x.back(); } } - else if (c != ':') - { + else if (c != ':') { throw x.syntaxError("Expected a ':' after a key"); } put(key, x.nextValue()); @@ -112,12 +102,10 @@ public class JSONObject extends JSONValueBase * Pairs are separated by ','. We will also tolerate ';'. */ - switch (x.nextClean()) - { + switch (x.nextClean()) { case ';': case ',': - if (x.nextClean() == '}') - { + if (x.nextClean() == '}') { return; } x.back(); @@ -130,20 +118,17 @@ public class JSONObject extends JSONValueBase } } - public JSONObject(String jsonStr) throws JSONException - { - try - { + public JSONObject(String jsonStr) throws JSONException { + try { CommonTree t = parse(jsonStr); CommonTreeNodeStream ts = new CommonTreeNodeStream(t); JSONWalker walker = new JSONWalker(ts); JSONObject obj = walker.jsonObject(); this.content = obj.content; } - catch (RecognitionException e) - { - throw new JSONException(JSONErrorCode.InvalidJSONData, jsonStr + ": line=" + e.line + "(" - + e.charPositionInLine + ")"); + catch (RecognitionException e) { + throw new JSONException(JSONErrorCode.InvalidJSONData, jsonStr + ": line=" + e.line + + "(" + e.charPositionInLine + ")"); } } @@ -216,55 +201,47 @@ public class JSONObject extends JSONValueBase } */ - public static CommonTree parse(String jsonStr) throws JSONException - { + public static CommonTree parse(String jsonStr) throws JSONException { JSONLexer lexer = new JSONLexer(new ANTLRStringStream(jsonStr)); CommonTokenStream tokens = new CommonTokenStream(lexer); JSONParser parser = new JSONParser(tokens); - try - { + try { JSONParser.jsonObject_return r = parser.jsonObject(); return (CommonTree) r.getTree(); } - catch (RecognitionException e) - { - throw new JSONException(JSONErrorCode.InvalidJSONData, jsonStr + ": line=" + e.line + "(" - + e.charPositionInLine + ")"); + catch (RecognitionException e) { + throw new JSONException(JSONErrorCode.InvalidJSONData, jsonStr + ": line=" + e.line + + "(" + e.charPositionInLine + ")"); } } - public JSONObject(List elemList) - { + public JSONObject(List elemList) { for (JSONElement e : elemList) put(e.getKey(), e.getValue()); } - public void put(String key, JSONValue obj) - { + public void put(String key, JSONValue obj) { content.put(key, obj); } - public void put(String key, Object value) throws JSONException - { + public void put(String key, Object value) throws JSONException { content.put(key, translateAsJSONValue(value)); } - public String toString() - { + public String toString() { return toJSONString(); } - public String toJSONString() - { + public String toJSONString() { StringBuilder jsonBuilder = new StringBuilder(); jsonBuilder.append("{"); ArrayList elementList = new ArrayList(); - for (Iterator> it = content.entrySet().iterator(); it.hasNext();) - { + for (Iterator> it = content.entrySet().iterator(); it.hasNext();) { Entry entry = it.next(); String jsonKey = "\"" + entry.getKey() + "\""; - String jsonValue = (entry.getValue() == null) ? "null" : entry.getValue().toJSONString(); + String jsonValue = (entry.getValue() == null) ? "null" : entry.getValue() + .toJSONString(); elementList.add(jsonKey + ":" + jsonValue); } jsonBuilder.append(join(elementList, ",")); @@ -272,36 +249,31 @@ public class JSONObject extends JSONValueBase return jsonBuilder.toString(); } - public int elementSize() - { + public int elementSize() { return content.size(); } - public JSONValue get(String key) - { + public JSONValue get(String key) { return content.get(key); } - public Set keys() - { + public Set keys() { return content.keySet(); } - public int getInt(String key) throws JSONException - { + public int getInt(String key) throws JSONException { JSONValue v = get(key); if (v == null) throw new JSONException(JSONErrorCode.KeyIsNotFound, key); JSONNumber n = v.getJSONNumber(); if (n == null) - throw new JSONException(JSONErrorCode.NotAJSONNumber, n.toString()); + throw new JSONException(JSONErrorCode.NotAJSONNumber, v.toString()); return n.getIntValue(); } - public String getString(String key) throws JSONException - { + public String getString(String key) throws JSONException { JSONValue v = get(key); if (v == null) throw new JSONException(JSONErrorCode.KeyIsNotFound, key); @@ -313,13 +285,11 @@ public class JSONObject extends JSONValueBase } @Override - public JSONObject getJSONObject() - { + public JSONObject getJSONObject() { return this; } - public JSONArray getJSONArray(String key) - { + public JSONArray getJSONArray(String key) { JSONValue v = get(key); if (v == null) return null; @@ -330,18 +300,15 @@ public class JSONObject extends JSONValueBase return a; } - public boolean hasKey(String key) - { + public boolean hasKey(String key) { return content.containsKey(key); } - public Map getKeyValueMap() - { + public Map getKeyValueMap() { return content; } - public JSONObject getJSONObject(String key) throws JSONException - { + public JSONObject getJSONObject(String key) throws JSONException { JSONValue v = get(key); if (v == null) throw new JSONException(JSONErrorCode.KeyIsNotFound, key); @@ -351,13 +318,11 @@ public class JSONObject extends JSONValueBase return o; } - public JSONValueType getValueType() - { + public JSONValueType getValueType() { return JSONValueType.Object; } - public void remove(String nodeName) - { + public void remove(String nodeName) { content.remove(nodeName); } } diff --git a/src/main/java/org/xerial/json/JSONValueBase.java b/src/main/java/org/xerial/json/JSONValueBase.java index 63ed999..b12c8fa 100644 --- a/src/main/java/org/xerial/json/JSONValueBase.java +++ b/src/main/java/org/xerial/json/JSONValueBase.java @@ -27,60 +27,66 @@ package org.xerial.json; import java.util.Collection; import java.util.Iterator; +/** + * Base implementation of the JSONValue + * + * @author leo + * + */ public abstract class JSONValueBase implements JSONValue { - public JSONArray getJSONArray() { - return null; - } + public JSONArray getJSONArray() { + return null; + } - public JSONBoolean getJSONBoolean() { - return null; - } + public JSONBoolean getJSONBoolean() { + return null; + } - public JSONNull getJSONNull() { - return null; - } + public JSONNull getJSONNull() { + return null; + } - public JSONNumber getJSONNumber() { - return null; - } + public JSONNumber getJSONNumber() { + return null; + } - public JSONObject getJSONObject() { - return null; - } + public JSONObject getJSONObject() { + return null; + } + + public JSONString getJSONString() { + return null; + } - public JSONString getJSONString() { - return null; - } + public JSONValue translateAsJSONValue(Object value) throws JSONException { + return JSONUtil.toJSONValue(value); + } - - public JSONValue translateAsJSONValue(Object value) throws JSONException - { - return JSONUtil.toJSONValue(value); - } + public String toJSONString() { + return this.toString(); + } - public String toJSONString() { - return this.toString(); - } - /** - * Concatinates all elements in the given collection c into a single string with the separator - * @param c a collection of elements to concatenate - * @param concatinator a concatenator: ex. ", ", "." etc. + * Concatenates all elements in the given collection c into a single string + * with the separator + * + * @param c + * collection of elements to concatenate + * @param concatinator + * string for concatenating elements: e.g., ", ", "." etc. * @return a concatenated string */ - protected static String join(Collection c, String concatinator) - { - if(c == null) + protected static String join(Collection< ? > c, String concatinator) { + if (c == null) return ""; int size = c.size(); - if(size == 0) + if (size == 0) return ""; - - Iterator it = c.iterator(); - StringBuilder buf = new StringBuilder(); - for(int i=0; it.hasNext() && i it = c.iterator(); + StringBuilder buf = new StringBuilder(); + for (int i = 0; it.hasNext() && i < size - 1; i++) { Object data = it.next(); buf.append(data.toString()); buf.append(concatinator); @@ -90,7 +96,3 @@ public abstract class JSONValueBase implements JSONValue { return buf.toString(); } } - - - - diff --git a/src/main/java/org/xerial/silk/schema/impl/SilkSchemaLexer.java b/src/main/java/org/xerial/silk/schema/impl/SilkSchemaLexer.java index 8fb247c..29140c3 100644 --- a/src/main/java/org/xerial/silk/schema/impl/SilkSchemaLexer.java +++ b/src/main/java/org/xerial/silk/schema/impl/SilkSchemaLexer.java @@ -22,90 +22,99 @@ // Since: Jun 28, 2009 1:00:02 PM // //-------------------------------------- - package org.xerial.silk.schema.impl; +import org.antlr.runtime.BaseRecognizer; +import org.antlr.runtime.CharStream; +import org.antlr.runtime.CommonToken; +import org.antlr.runtime.DFA; +import org.antlr.runtime.EarlyExitException; +import org.antlr.runtime.FailedPredicateException; +import org.antlr.runtime.IntStream; +import org.antlr.runtime.Lexer; +import org.antlr.runtime.MismatchedSetException; +import org.antlr.runtime.NoViableAltException; +import org.antlr.runtime.RecognitionException; +import org.antlr.runtime.RecognizerSharedState; +import org.antlr.runtime.Token; - -import org.antlr.runtime.*; -import java.util.Stack; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; public class SilkSchemaLexer extends Lexer { - public static final int Includes=46; - public static final int RBrace=31; - public static final int NonWhiteSpaceChar=42; - public static final int LBracket=32; - public static final int Class=45; - public static final int SymbolChars=43; - public static final int Digit=18; - public static final int Frac=27; - public static final int HexDigit=20; - public static final int Symbol=44; - public static final int Index=49; - public static final int Module=5; - public static final int Letter=19; - public static final int Comma=37; - public static final int Attribute=10; - public static final int Schema=4; - public static final int Dot=36; - public static final int End=47; - public static final int EscapeSequence=22; - public static final int DefaultValue=13; - public static final int Integer=26; - public static final int Relation=48; - public static final int Mixin=9; - public static final int WhiteSpace=56; - public static final int ClassDef=6; - public static final int LineComment=16; - public static final int ModuleName=53; - public static final int BelongsTo=50; - public static final int SafeFirstLetter=51; - public static final int Star=40; - public static final int Eq=35; - public static final int Preamble=15; - public static final int Exp=28; - public static final int QNameChar=57; - public static final int RParen=39; - public static final int UnicodeChar=21; - public static final int StringChar=23; - public static final int LineBreak=17; - public static final int Name=7; - public static final int LParen=38; - public static final int ModuleDef=55; - public static final int String=25; - public static final int SafeLetter=52; - public static final int LineBreakChar=14; - public static final int IsArray=11; - public static final int QName=58; - public static final int EOF=-1; - public static final int StringChar_s=24; - public static final int UnsafeUnicodeChar=41; - public static final int LBrace=30; - public static final int Double=29; - public static final int Lt=34; - public static final int RBracket=33; - public static final int Parent=8; - public static final int TypeName=12; - public static final int WhiteSpaces=54; - - - + public static final int Includes = 46; + public static final int RBrace = 31; + public static final int NonWhiteSpaceChar = 42; + public static final int LBracket = 32; + public static final int Class = 45; + public static final int SymbolChars = 43; + public static final int Digit = 18; + public static final int Frac = 27; + public static final int HexDigit = 20; + public static final int Symbol = 44; + public static final int Index = 49; + public static final int Module = 5; + public static final int Letter = 19; + public static final int Comma = 37; + public static final int Attribute = 10; + public static final int Schema = 4; + public static final int Dot = 36; + public static final int End = 47; + public static final int EscapeSequence = 22; + public static final int DefaultValue = 13; + public static final int Integer = 26; + public static final int Relation = 48; + public static final int Mixin = 9; + public static final int WhiteSpace = 56; + public static final int ClassDef = 6; + public static final int LineComment = 16; + public static final int ModuleName = 53; + public static final int BelongsTo = 50; + public static final int SafeFirstLetter = 51; + public static final int Star = 40; + public static final int Eq = 35; + public static final int Preamble = 15; + public static final int Exp = 28; + public static final int QNameChar = 57; + public static final int RParen = 39; + public static final int UnicodeChar = 21; + public static final int StringChar = 23; + public static final int LineBreak = 17; + public static final int Name = 7; + public static final int LParen = 38; + public static final int ModuleDef = 55; + public static final int String = 25; + public static final int SafeLetter = 52; + public static final int LineBreakChar = 14; + public static final int IsArray = 11; + public static final int QName = 58; + public static final int EOF = -1; + public static final int StringChar_s = 24; + public static final int UnsafeUnicodeChar = 41; + public static final int LBrace = 30; + public static final int Double = 29; + public static final int Lt = 34; + public static final int RBracket = 33; + public static final int Parent = 8; + public static final int TypeName = 12; + public static final int WhiteSpaces = 54; // delegates // delegators - public SilkSchemaLexer() {;} + public SilkSchemaLexer() { + ; + } + public SilkSchemaLexer(CharStream input) { this(input, new RecognizerSharedState()); } + public SilkSchemaLexer(CharStream input, RecognizerSharedState state) { - super(input,state); + super(input, state); + + } + public String getGrammarFileName() { + return "SilkSchema.g"; } - public String getGrammarFileName() { return "SilkSchema.g"; } // $ANTLR start "Preamble" public final void mPreamble() throws RecognitionException { @@ -115,54 +124,64 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:109:9: ({...}? => '%' (~ ( LineBreakChar ) )* ) // SilkSchema.g:109:11: {...}? => '%' (~ ( LineBreakChar ) )* { - if ( !(( getCharPositionInLine() == 0 )) ) { - if (state.backtracking>0) {state.failed=true; return ;} - throw new FailedPredicateException(input, "Preamble", " getCharPositionInLine() == 0 "); - } - match('%'); if (state.failed) return ; - // SilkSchema.g:109:52: (~ ( LineBreakChar ) )* - loop1: - do { - int alt1=2; - int LA1_0 = input.LA(1); - - if ( ((LA1_0>='\u0000' && LA1_0<='\t')||(LA1_0>='\u000B' && LA1_0<='\f')||(LA1_0>='\u000E' && LA1_0<='\uFFFF')) ) { - alt1=1; + if (!((getCharPositionInLine() == 0))) { + if (state.backtracking > 0) { + state.failed = true; + return; + } + throw new FailedPredicateException(input, "Preamble", + " getCharPositionInLine() == 0 "); } + match('%'); + if (state.failed) + return; + // SilkSchema.g:109:52: (~ ( LineBreakChar ) )* + loop1: do { + int alt1 = 2; + int LA1_0 = input.LA(1); + + if (((LA1_0 >= '\u0000' && LA1_0 <= '\t') + || (LA1_0 >= '\u000B' && LA1_0 <= '\f') || (LA1_0 >= '\u000E' && LA1_0 <= '\uFFFF'))) { + alt1 = 1; + } + switch (alt1) { + case 1: + // SilkSchema.g:109:52: ~ ( LineBreakChar ) + { + if ((input.LA(1) >= '\u0000' && input.LA(1) <= '\t') + || (input.LA(1) >= '\u000B' && input.LA(1) <= '\f') + || (input.LA(1) >= '\u000E' && input.LA(1) <= '\uFFFF')) { + input.consume(); + state.failed = false; + } + else { + if (state.backtracking > 0) { + state.failed = true; + return; + } + MismatchedSetException mse = new MismatchedSetException(null, input); + recover(mse); + throw mse; + } - switch (alt1) { - case 1 : - // SilkSchema.g:109:52: ~ ( LineBreakChar ) - { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; + } + break; - default : - break loop1; + default: + break loop1; + } } - } while (true); - + while (true); } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "Preamble" // $ANTLR start "LineBreakChar" @@ -171,23 +190,26 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:112:23: ( '\\n' | '\\r' ) // SilkSchema.g: { - if ( input.LA(1)=='\n'||input.LA(1)=='\r' ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - + if (input.LA(1) == '\n' || input.LA(1) == '\r') { + input.consume(); + state.failed = false; + } + else { + if (state.backtracking > 0) { + state.failed = true; + return; + } + MismatchedSetException mse = new MismatchedSetException(null, input); + recover(mse); + throw mse; + } } } - finally { - } + finally {} } + // $ANTLR end "LineBreakChar" // $ANTLR start "LineComment" @@ -198,53 +220,60 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:113:12: ( '#' (~ ( LineBreakChar ) )* ) // SilkSchema.g:113:14: '#' (~ ( LineBreakChar ) )* { - match('#'); if (state.failed) return ; - // SilkSchema.g:113:18: (~ ( LineBreakChar ) )* - loop2: - do { - int alt2=2; - int LA2_0 = input.LA(1); - - if ( ((LA2_0>='\u0000' && LA2_0<='\t')||(LA2_0>='\u000B' && LA2_0<='\f')||(LA2_0>='\u000E' && LA2_0<='\uFFFF')) ) { - alt2=1; - } - - - switch (alt2) { - case 1 : - // SilkSchema.g:113:18: ~ ( LineBreakChar ) - { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} + match('#'); + if (state.failed) + return; + // SilkSchema.g:113:18: (~ ( LineBreakChar ) )* + loop2: do { + int alt2 = 2; + int LA2_0 = input.LA(1); + + if (((LA2_0 >= '\u0000' && LA2_0 <= '\t') + || (LA2_0 >= '\u000B' && LA2_0 <= '\f') || (LA2_0 >= '\u000E' && LA2_0 <= '\uFFFF'))) { + alt2 = 1; + } + switch (alt2) { + case 1: + // SilkSchema.g:113:18: ~ ( LineBreakChar ) + { + if ((input.LA(1) >= '\u0000' && input.LA(1) <= '\t') + || (input.LA(1) >= '\u000B' && input.LA(1) <= '\f') + || (input.LA(1) >= '\u000E' && input.LA(1) <= '\uFFFF')) { + input.consume(); + state.failed = false; + } + else { + if (state.backtracking > 0) { + state.failed = true; + return; + } + MismatchedSetException mse = new MismatchedSetException(null, input); + recover(mse); + throw mse; + } - } - break; + } + break; - default : - break loop2; + default: + break loop2; + } } - } while (true); + while (true); - if ( state.backtracking==0 ) { - _channel = HIDDEN; - } + if (state.backtracking == 0) { + _channel = HIDDEN; + } } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "LineComment" // $ANTLR start "LineBreak" @@ -255,67 +284,78 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:116:10: ( ( '\\r' '\\n' | '\\r' | '\\n' ) ) // SilkSchema.g:116:12: ( '\\r' '\\n' | '\\r' | '\\n' ) { - // SilkSchema.g:116:12: ( '\\r' '\\n' | '\\r' | '\\n' ) - int alt3=3; - int LA3_0 = input.LA(1); + // SilkSchema.g:116:12: ( '\\r' '\\n' | '\\r' | '\\n' ) + int alt3 = 3; + int LA3_0 = input.LA(1); - if ( (LA3_0=='\r') ) { - int LA3_1 = input.LA(2); + if ((LA3_0 == '\r')) { + int LA3_1 = input.LA(2); - if ( (LA3_1=='\n') ) { - alt3=1; + if ((LA3_1 == '\n')) { + alt3 = 1; + } + else { + alt3 = 2; + } + } + else if ((LA3_0 == '\n')) { + alt3 = 3; } else { - alt3=2;} - } - else if ( (LA3_0=='\n') ) { - alt3=3; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 3, 0, input); + if (state.backtracking > 0) { + state.failed = true; + return; + } + NoViableAltException nvae = new NoViableAltException("", 3, 0, input); - throw nvae; - } - switch (alt3) { - case 1 : + throw nvae; + } + switch (alt3) { + case 1: // SilkSchema.g:116:13: '\\r' '\\n' - { - match('\r'); if (state.failed) return ; - match('\n'); if (state.failed) return ; + { + match('\r'); + if (state.failed) + return; + match('\n'); + if (state.failed) + return; - } + } break; - case 2 : + case 2: // SilkSchema.g:116:25: '\\r' - { - match('\r'); if (state.failed) return ; + { + match('\r'); + if (state.failed) + return; - } + } break; - case 3 : + case 3: // SilkSchema.g:116:32: '\\n' - { - match('\n'); if (state.failed) return ; + { + match('\n'); + if (state.failed) + return; - } + } break; - } + } - if ( state.backtracking==0 ) { - _channel = HIDDEN; - } + if (state.backtracking == 0) { + _channel = HIDDEN; + } } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "LineBreak" // $ANTLR start "Digit" @@ -324,14 +364,16 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:119:15: ( '0' .. '9' ) // SilkSchema.g:119:17: '0' .. '9' { - matchRange('0','9'); if (state.failed) return ; + matchRange('0', '9'); + if (state.failed) + return; } } - finally { - } + finally {} } + // $ANTLR end "Digit" // $ANTLR start "Letter" @@ -340,23 +382,27 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:120:16: ( 'A' .. 'F' | 'a' .. 'f' ) // SilkSchema.g: { - if ( (input.LA(1)>='A' && input.LA(1)<='F')||(input.LA(1)>='a' && input.LA(1)<='f') ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - + if ((input.LA(1) >= 'A' && input.LA(1) <= 'F') + || (input.LA(1) >= 'a' && input.LA(1) <= 'f')) { + input.consume(); + state.failed = false; + } + else { + if (state.backtracking > 0) { + state.failed = true; + return; + } + MismatchedSetException mse = new MismatchedSetException(null, input); + recover(mse); + throw mse; + } } } - finally { - } + finally {} } + // $ANTLR end "Letter" // $ANTLR start "HexDigit" @@ -365,23 +411,28 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:121:18: ( Digit | Letter ) // SilkSchema.g: { - if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='F')||(input.LA(1)>='a' && input.LA(1)<='f') ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - + if ((input.LA(1) >= '0' && input.LA(1) <= '9') + || (input.LA(1) >= 'A' && input.LA(1) <= 'F') + || (input.LA(1) >= 'a' && input.LA(1) <= 'f')) { + input.consume(); + state.failed = false; + } + else { + if (state.backtracking > 0) { + state.failed = true; + return; + } + MismatchedSetException mse = new MismatchedSetException(null, input); + recover(mse); + throw mse; + } } } - finally { - } + finally {} } + // $ANTLR end "HexDigit" // $ANTLR start "UnicodeChar" @@ -390,23 +441,28 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:122:21: (~ ( '\"' | '\\\\' ) ) // SilkSchema.g:122:23: ~ ( '\"' | '\\\\' ) { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - + if ((input.LA(1) >= '\u0000' && input.LA(1) <= '!') + || (input.LA(1) >= '#' && input.LA(1) <= '[') + || (input.LA(1) >= ']' && input.LA(1) <= '\uFFFF')) { + input.consume(); + state.failed = false; + } + else { + if (state.backtracking > 0) { + state.failed = true; + return; + } + MismatchedSetException mse = new MismatchedSetException(null, input); + recover(mse); + throw mse; + } } } - finally { - } + finally {} } + // $ANTLR end "UnicodeChar" // $ANTLR start "EscapeSequence" @@ -415,184 +471,210 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:124:3: ( '\\\\' ( '\\\"' | '\\\\' | '/' | 'b' | 'f' | 'n' | 'r' | 't' | 'u' HexDigit HexDigit HexDigit HexDigit ) ) // SilkSchema.g:124:5: '\\\\' ( '\\\"' | '\\\\' | '/' | 'b' | 'f' | 'n' | 'r' | 't' | 'u' HexDigit HexDigit HexDigit HexDigit ) { - match('\\'); if (state.failed) return ; - // SilkSchema.g:124:10: ( '\\\"' | '\\\\' | '/' | 'b' | 'f' | 'n' | 'r' | 't' | 'u' HexDigit HexDigit HexDigit HexDigit ) - int alt4=9; - switch ( input.LA(1) ) { - case '\"': - { - alt4=1; + match('\\'); + if (state.failed) + return; + // SilkSchema.g:124:10: ( '\\\"' | '\\\\' | '/' | 'b' | 'f' | 'n' | 'r' | 't' | 'u' HexDigit HexDigit HexDigit HexDigit ) + int alt4 = 9; + switch (input.LA(1)) { + case '\"': { + alt4 = 1; } - break; - case '\\': - { - alt4=2; + break; + case '\\': { + alt4 = 2; } - break; - case '/': - { - alt4=3; + break; + case '/': { + alt4 = 3; } - break; - case 'b': - { - alt4=4; + break; + case 'b': { + alt4 = 4; } - break; - case 'f': - { - alt4=5; + break; + case 'f': { + alt4 = 5; } - break; - case 'n': - { - alt4=6; + break; + case 'n': { + alt4 = 6; } - break; - case 'r': - { - alt4=7; + break; + case 'r': { + alt4 = 7; } - break; - case 't': - { - alt4=8; + break; + case 't': { + alt4 = 8; } - break; - case 'u': - { - alt4=9; + break; + case 'u': { + alt4 = 9; } - break; - default: - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 4, 0, input); + break; + default: + if (state.backtracking > 0) { + state.failed = true; + return; + } + NoViableAltException nvae = new NoViableAltException("", 4, 0, input); - throw nvae; - } + throw nvae; + } - switch (alt4) { - case 1 : + switch (alt4) { + case 1: // SilkSchema.g:124:11: '\\\"' - { - match('\"'); if (state.failed) return ; + { + match('\"'); + if (state.failed) + return; - } + } break; - case 2 : + case 2: // SilkSchema.g:124:18: '\\\\' - { - match('\\'); if (state.failed) return ; + { + match('\\'); + if (state.failed) + return; - } + } break; - case 3 : + case 3: // SilkSchema.g:124:25: '/' - { - match('/'); if (state.failed) return ; + { + match('/'); + if (state.failed) + return; - } + } break; - case 4 : + case 4: // SilkSchema.g:124:31: 'b' - { - match('b'); if (state.failed) return ; + { + match('b'); + if (state.failed) + return; - } + } break; - case 5 : + case 5: // SilkSchema.g:124:37: 'f' - { - match('f'); if (state.failed) return ; + { + match('f'); + if (state.failed) + return; - } + } break; - case 6 : + case 6: // SilkSchema.g:124:43: 'n' - { - match('n'); if (state.failed) return ; + { + match('n'); + if (state.failed) + return; - } + } break; - case 7 : + case 7: // SilkSchema.g:124:49: 'r' - { - match('r'); if (state.failed) return ; + { + match('r'); + if (state.failed) + return; - } + } break; - case 8 : + case 8: // SilkSchema.g:124:55: 't' - { - match('t'); if (state.failed) return ; + { + match('t'); + if (state.failed) + return; - } + } break; - case 9 : + case 9: // SilkSchema.g:124:61: 'u' HexDigit HexDigit HexDigit HexDigit - { - match('u'); if (state.failed) return ; - mHexDigit(); if (state.failed) return ; - mHexDigit(); if (state.failed) return ; - mHexDigit(); if (state.failed) return ; - mHexDigit(); if (state.failed) return ; + { + match('u'); + if (state.failed) + return; + mHexDigit(); + if (state.failed) + return; + mHexDigit(); + if (state.failed) + return; + mHexDigit(); + if (state.failed) + return; + mHexDigit(); + if (state.failed) + return; - } + } break; - } - + } } } - finally { - } + finally {} } + // $ANTLR end "EscapeSequence" // $ANTLR start "StringChar" public final void mStringChar() throws RecognitionException { try { // SilkSchema.g:127:21: ( UnicodeChar | EscapeSequence ) - int alt5=2; + int alt5 = 2; int LA5_0 = input.LA(1); - if ( ((LA5_0>='\u0000' && LA5_0<='!')||(LA5_0>='#' && LA5_0<='[')||(LA5_0>=']' && LA5_0<='\uFFFF')) ) { - alt5=1; + if (((LA5_0 >= '\u0000' && LA5_0 <= '!') || (LA5_0 >= '#' && LA5_0 <= '[') || (LA5_0 >= ']' && LA5_0 <= '\uFFFF'))) { + alt5 = 1; } - else if ( (LA5_0=='\\') ) { - alt5=2; + else if ((LA5_0 == '\\')) { + alt5 = 2; } else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 5, 0, input); + if (state.backtracking > 0) { + state.failed = true; + return; + } + NoViableAltException nvae = new NoViableAltException("", 5, 0, input); throw nvae; } switch (alt5) { - case 1 : - // SilkSchema.g:127:24: UnicodeChar - { - mUnicodeChar(); if (state.failed) return ; + case 1: + // SilkSchema.g:127:24: UnicodeChar + { + mUnicodeChar(); + if (state.failed) + return; - } - break; - case 2 : - // SilkSchema.g:127:38: EscapeSequence - { - mEscapeSequence(); if (state.failed) return ; + } + break; + case 2: + // SilkSchema.g:127:38: EscapeSequence + { + mEscapeSequence(); + if (state.failed) + return; - } - break; + } + break; } } - finally { - } + finally {} } + // $ANTLR end "StringChar" // $ANTLR start "StringChar_s" @@ -601,38 +683,38 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:128:22: ( ( StringChar )* ) // SilkSchema.g:128:24: ( StringChar )* { - // SilkSchema.g:128:24: ( StringChar )* - loop6: - do { - int alt6=2; - int LA6_0 = input.LA(1); - - if ( ((LA6_0>='\u0000' && LA6_0<='!')||(LA6_0>='#' && LA6_0<='\uFFFF')) ) { - alt6=1; - } + // SilkSchema.g:128:24: ( StringChar )* + loop6: do { + int alt6 = 2; + int LA6_0 = input.LA(1); + if (((LA6_0 >= '\u0000' && LA6_0 <= '!') || (LA6_0 >= '#' && LA6_0 <= '\uFFFF'))) { + alt6 = 1; + } - switch (alt6) { - case 1 : - // SilkSchema.g:128:24: StringChar - { - mStringChar(); if (state.failed) return ; + switch (alt6) { + case 1: + // SilkSchema.g:128:24: StringChar + { + mStringChar(); + if (state.failed) + return; - } - break; + } + break; - default : - break loop6; + default: + break loop6; + } } - } while (true); - + while (true); } } - finally { - } + finally {} } + // $ANTLR end "StringChar_s" // $ANTLR start "String" @@ -640,28 +722,35 @@ public class SilkSchemaLexer extends Lexer { try { int _type = String; int _channel = DEFAULT_TOKEN_CHANNEL; - Token s=null; + Token s = null; // SilkSchema.g:130:7: ( '\"' s= StringChar_s '\"' ) // SilkSchema.g:130:9: '\"' s= StringChar_s '\"' { - match('\"'); if (state.failed) return ; - int sStart264 = getCharIndex(); - mStringChar_s(); if (state.failed) return ; - s = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, sStart264, getCharIndex()-1); - match('\"'); if (state.failed) return ; - if ( state.backtracking==0 ) { - setText((s!=null?s.getText():null)); - } + match('\"'); + if (state.failed) + return; + int sStart264 = getCharIndex(); + mStringChar_s(); + if (state.failed) + return; + s = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, + sStart264, getCharIndex() - 1); + match('\"'); + if (state.failed) + return; + if (state.backtracking == 0) { + setText((s != null ? s.getText() : null)); + } } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "String" // $ANTLR start "Integer" @@ -672,93 +761,100 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:133:8: ( ( '-' )? ( '0' | '1' .. '9' ( Digit )* ) ) // SilkSchema.g:133:10: ( '-' )? ( '0' | '1' .. '9' ( Digit )* ) { - // SilkSchema.g:133:10: ( '-' )? - int alt7=2; - int LA7_0 = input.LA(1); + // SilkSchema.g:133:10: ( '-' )? + int alt7 = 2; + int LA7_0 = input.LA(1); - if ( (LA7_0=='-') ) { - alt7=1; - } - switch (alt7) { - case 1 : + if ((LA7_0 == '-')) { + alt7 = 1; + } + switch (alt7) { + case 1: // SilkSchema.g:133:10: '-' - { - match('-'); if (state.failed) return ; + { + match('-'); + if (state.failed) + return; - } + } break; - } + } - // SilkSchema.g:133:15: ( '0' | '1' .. '9' ( Digit )* ) - int alt9=2; - int LA9_0 = input.LA(1); + // SilkSchema.g:133:15: ( '0' | '1' .. '9' ( Digit )* ) + int alt9 = 2; + int LA9_0 = input.LA(1); - if ( (LA9_0=='0') ) { - alt9=1; - } - else if ( ((LA9_0>='1' && LA9_0<='9')) ) { - alt9=2; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 9, 0, input); + if ((LA9_0 == '0')) { + alt9 = 1; + } + else if (((LA9_0 >= '1' && LA9_0 <= '9'))) { + alt9 = 2; + } + else { + if (state.backtracking > 0) { + state.failed = true; + return; + } + NoViableAltException nvae = new NoViableAltException("", 9, 0, input); - throw nvae; - } - switch (alt9) { - case 1 : + throw nvae; + } + switch (alt9) { + case 1: // SilkSchema.g:133:16: '0' - { - match('0'); if (state.failed) return ; + { + match('0'); + if (state.failed) + return; - } + } break; - case 2 : + case 2: // SilkSchema.g:133:22: '1' .. '9' ( Digit )* - { - matchRange('1','9'); if (state.failed) return ; + { + matchRange('1', '9'); + if (state.failed) + return; // SilkSchema.g:133:31: ( Digit )* - loop8: - do { - int alt8=2; + loop8: do { + int alt8 = 2; int LA8_0 = input.LA(1); - if ( ((LA8_0>='0' && LA8_0<='9')) ) { - alt8=1; + if (((LA8_0 >= '0' && LA8_0 <= '9'))) { + alt8 = 1; } - switch (alt8) { - case 1 : - // SilkSchema.g:133:31: Digit - { - mDigit(); if (state.failed) return ; - - } - break; + case 1: + // SilkSchema.g:133:31: Digit + { + mDigit(); + if (state.failed) + return; - default : - break loop8; } - } while (true); - + break; + default: + break loop8; + } } - break; + while (true); - } + } + break; + } } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "Integer" // $ANTLR start "Frac" @@ -767,45 +863,50 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:134:14: ( '.' ( Digit )+ ) // SilkSchema.g:134:16: '.' ( Digit )+ { - match('.'); if (state.failed) return ; - // SilkSchema.g:134:20: ( Digit )+ - int cnt10=0; - loop10: - do { - int alt10=2; - int LA10_0 = input.LA(1); - - if ( ((LA10_0>='0' && LA10_0<='9')) ) { - alt10=1; - } - + match('.'); + if (state.failed) + return; + // SilkSchema.g:134:20: ( Digit )+ + int cnt10 = 0; + loop10: do { + int alt10 = 2; + int LA10_0 = input.LA(1); + + if (((LA10_0 >= '0' && LA10_0 <= '9'))) { + alt10 = 1; + } - switch (alt10) { - case 1 : - // SilkSchema.g:134:20: Digit - { - mDigit(); if (state.failed) return ; + switch (alt10) { + case 1: + // SilkSchema.g:134:20: Digit + { + mDigit(); + if (state.failed) + return; - } - break; + } + break; - default : - if ( cnt10 >= 1 ) break loop10; - if (state.backtracking>0) {state.failed=true; return ;} - EarlyExitException eee = - new EarlyExitException(10, input); + default: + if (cnt10 >= 1) + break loop10; + if (state.backtracking > 0) { + state.failed = true; + return; + } + EarlyExitException eee = new EarlyExitException(10, input); throw eee; + } + cnt10++; } - cnt10++; - } while (true); - + while (true); } } - finally { - } + finally {} } + // $ANTLR end "Frac" // $ANTLR start "Exp" @@ -814,81 +915,91 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:135:13: ( ( 'e' | 'E' ) ( '+' | '-' )? ( Digit )+ ) // SilkSchema.g:135:15: ( 'e' | 'E' ) ( '+' | '-' )? ( Digit )+ { - if ( input.LA(1)=='E'||input.LA(1)=='e' ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} + if (input.LA(1) == 'E' || input.LA(1) == 'e') { + input.consume(); + state.failed = false; + } + else { + if (state.backtracking > 0) { + state.failed = true; + return; + } + MismatchedSetException mse = new MismatchedSetException(null, input); + recover(mse); + throw mse; + } - // SilkSchema.g:135:27: ( '+' | '-' )? - int alt11=2; - int LA11_0 = input.LA(1); + // SilkSchema.g:135:27: ( '+' | '-' )? + int alt11 = 2; + int LA11_0 = input.LA(1); - if ( (LA11_0=='+'||LA11_0=='-') ) { - alt11=1; - } - switch (alt11) { - case 1 : + if ((LA11_0 == '+' || LA11_0 == '-')) { + alt11 = 1; + } + switch (alt11) { + case 1: // SilkSchema.g: - { - if ( input.LA(1)=='+'||input.LA(1)=='-' ) { + { + if (input.LA(1) == '+' || input.LA(1) == '-') { input.consume(); - state.failed=false; + state.failed = false; } else { - if (state.backtracking>0) {state.failed=true; return ;} - MismatchedSetException mse = new MismatchedSetException(null,input); + if (state.backtracking > 0) { + state.failed = true; + return; + } + MismatchedSetException mse = new MismatchedSetException(null, input); recover(mse); - throw mse;} - - + throw mse; } - break; - - } - // SilkSchema.g:135:40: ( Digit )+ - int cnt12=0; - loop12: - do { - int alt12=2; - int LA12_0 = input.LA(1); + } + break; - if ( ((LA12_0>='0' && LA12_0<='9')) ) { - alt12=1; } + // SilkSchema.g:135:40: ( Digit )+ + int cnt12 = 0; + loop12: do { + int alt12 = 2; + int LA12_0 = input.LA(1); + + if (((LA12_0 >= '0' && LA12_0 <= '9'))) { + alt12 = 1; + } - switch (alt12) { - case 1 : - // SilkSchema.g:135:40: Digit - { - mDigit(); if (state.failed) return ; + switch (alt12) { + case 1: + // SilkSchema.g:135:40: Digit + { + mDigit(); + if (state.failed) + return; - } - break; + } + break; - default : - if ( cnt12 >= 1 ) break loop12; - if (state.backtracking>0) {state.failed=true; return ;} - EarlyExitException eee = - new EarlyExitException(12, input); + default: + if (cnt12 >= 1) + break loop12; + if (state.backtracking > 0) { + state.failed = true; + return; + } + EarlyExitException eee = new EarlyExitException(12, input); throw eee; + } + cnt12++; } - cnt12++; - } while (true); - + while (true); } } - finally { - } + finally {} } + // $ANTLR end "Exp" // $ANTLR start "Double" @@ -899,69 +1010,77 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:136:7: ( Integer ( Frac ( Exp )? | Exp ) ) // SilkSchema.g:136:9: Integer ( Frac ( Exp )? | Exp ) { - mInteger(); if (state.failed) return ; - // SilkSchema.g:136:17: ( Frac ( Exp )? | Exp ) - int alt14=2; - int LA14_0 = input.LA(1); - - if ( (LA14_0=='.') ) { - alt14=1; - } - else if ( (LA14_0=='E'||LA14_0=='e') ) { - alt14=2; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - NoViableAltException nvae = - new NoViableAltException("", 14, 0, input); + mInteger(); + if (state.failed) + return; + // SilkSchema.g:136:17: ( Frac ( Exp )? | Exp ) + int alt14 = 2; + int LA14_0 = input.LA(1); + + if ((LA14_0 == '.')) { + alt14 = 1; + } + else if ((LA14_0 == 'E' || LA14_0 == 'e')) { + alt14 = 2; + } + else { + if (state.backtracking > 0) { + state.failed = true; + return; + } + NoViableAltException nvae = new NoViableAltException("", 14, 0, input); - throw nvae; - } - switch (alt14) { - case 1 : + throw nvae; + } + switch (alt14) { + case 1: // SilkSchema.g:136:18: Frac ( Exp )? - { - mFrac(); if (state.failed) return ; + { + mFrac(); + if (state.failed) + return; // SilkSchema.g:136:23: ( Exp )? - int alt13=2; + int alt13 = 2; int LA13_0 = input.LA(1); - if ( (LA13_0=='E'||LA13_0=='e') ) { - alt13=1; + if ((LA13_0 == 'E' || LA13_0 == 'e')) { + alt13 = 1; } switch (alt13) { - case 1 : - // SilkSchema.g:136:23: Exp - { - mExp(); if (state.failed) return ; - - } - break; + case 1: + // SilkSchema.g:136:23: Exp + { + mExp(); + if (state.failed) + return; } - + break; } + + } break; - case 2 : + case 2: // SilkSchema.g:136:30: Exp - { - mExp(); if (state.failed) return ; + { + mExp(); + if (state.failed) + return; - } + } break; - } - + } } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "Double" // $ANTLR start "LBrace" @@ -972,16 +1091,18 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:138:7: ( '{' ) // SilkSchema.g:138:9: '{' { - match('{'); if (state.failed) return ; + match('{'); + if (state.failed) + return; } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "LBrace" // $ANTLR start "RBrace" @@ -992,16 +1113,18 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:139:7: ( '}' ) // SilkSchema.g:139:9: '}' { - match('}'); if (state.failed) return ; + match('}'); + if (state.failed) + return; } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "RBrace" // $ANTLR start "LBracket" @@ -1012,16 +1135,18 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:140:9: ( '[' ) // SilkSchema.g:140:11: '[' { - match('['); if (state.failed) return ; + match('['); + if (state.failed) + return; } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "LBracket" // $ANTLR start "RBracket" @@ -1032,16 +1157,18 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:141:9: ( ']' ) // SilkSchema.g:141:11: ']' { - match(']'); if (state.failed) return ; + match(']'); + if (state.failed) + return; } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "RBracket" // $ANTLR start "Lt" @@ -1052,16 +1179,18 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:143:3: ( '<' ) // SilkSchema.g:143:5: '<' { - match('<'); if (state.failed) return ; + match('<'); + if (state.failed) + return; } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "Lt" // $ANTLR start "Eq" @@ -1072,16 +1201,18 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:144:3: ( '=' ) // SilkSchema.g:144:5: '=' { - match('='); if (state.failed) return ; + match('='); + if (state.failed) + return; } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "Eq" // $ANTLR start "Dot" @@ -1092,16 +1223,18 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:145:4: ( '.' ) // SilkSchema.g:145:6: '.' { - match('.'); if (state.failed) return ; + match('.'); + if (state.failed) + return; } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "Dot" // $ANTLR start "Comma" @@ -1112,16 +1245,18 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:146:6: ( ',' ) // SilkSchema.g:146:8: ',' { - match(','); if (state.failed) return ; + match(','); + if (state.failed) + return; } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "Comma" // $ANTLR start "LParen" @@ -1132,16 +1267,18 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:148:7: ( '(' ) // SilkSchema.g:148:9: '(' { - match('('); if (state.failed) return ; + match('('); + if (state.failed) + return; } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "LParen" // $ANTLR start "RParen" @@ -1152,16 +1289,18 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:149:7: ( ')' ) // SilkSchema.g:149:9: ')' { - match(')'); if (state.failed) return ; + match(')'); + if (state.failed) + return; } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "RParen" // $ANTLR start "Star" @@ -1172,16 +1311,18 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:151:5: ( '*' ) // SilkSchema.g:151:7: '*' { - match('*'); if (state.failed) return ; + match('*'); + if (state.failed) + return; } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "Star" // $ANTLR start "UnsafeUnicodeChar" @@ -1190,23 +1331,31 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:154:18: ( '(' | ')' | '[' | ']' | '{' | '}' | ',' | ':' | '#' | '<' | '>' | '|' | '*' | '\\'' | '\"' | '@' | '%' | '\\\\' | '.' | '-' ) // SilkSchema.g: { - if ( (input.LA(1)>='\"' && input.LA(1)<='#')||input.LA(1)=='%'||(input.LA(1)>='\'' && input.LA(1)<='*')||(input.LA(1)>=',' && input.LA(1)<='.')||input.LA(1)==':'||input.LA(1)=='<'||input.LA(1)=='>'||input.LA(1)=='@'||(input.LA(1)>='[' && input.LA(1)<=']')||(input.LA(1)>='{' && input.LA(1)<='}') ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - + if ((input.LA(1) >= '\"' && input.LA(1) <= '#') || input.LA(1) == '%' + || (input.LA(1) >= '\'' && input.LA(1) <= '*') + || (input.LA(1) >= ',' && input.LA(1) <= '.') || input.LA(1) == ':' + || input.LA(1) == '<' || input.LA(1) == '>' || input.LA(1) == '@' + || (input.LA(1) >= '[' && input.LA(1) <= ']') + || (input.LA(1) >= '{' && input.LA(1) <= '}')) { + input.consume(); + state.failed = false; + } + else { + if (state.backtracking > 0) { + state.failed = true; + return; + } + MismatchedSetException mse = new MismatchedSetException(null, input); + recover(mse); + throw mse; + } } } - finally { - } + finally {} } + // $ANTLR end "UnsafeUnicodeChar" // $ANTLR start "NonWhiteSpaceChar" @@ -1215,23 +1364,33 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:157:18: (~ ( UnsafeUnicodeChar | '\\r' | '\\n' | ' ' | '\\t' | '\\u000C' ) ) // SilkSchema.g:157:20: ~ ( UnsafeUnicodeChar | '\\r' | '\\n' | ' ' | '\\t' | '\\u000C' ) { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='\b')||input.LA(1)=='\u000B'||(input.LA(1)>='\u000E' && input.LA(1)<='\u001F')||input.LA(1)=='!'||input.LA(1)=='$'||input.LA(1)=='&'||input.LA(1)=='+'||(input.LA(1)>='/' && input.LA(1)<='9')||input.LA(1)==';'||input.LA(1)=='='||input.LA(1)=='?'||(input.LA(1)>='A' && input.LA(1)<='Z')||(input.LA(1)>='^' && input.LA(1)<='z')||(input.LA(1)>='~' && input.LA(1)<='\uFFFF') ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - + if ((input.LA(1) >= '\u0000' && input.LA(1) <= '\b') || input.LA(1) == '\u000B' + || (input.LA(1) >= '\u000E' && input.LA(1) <= '\u001F') + || input.LA(1) == '!' || input.LA(1) == '$' || input.LA(1) == '&' + || input.LA(1) == '+' || (input.LA(1) >= '/' && input.LA(1) <= '9') + || input.LA(1) == ';' || input.LA(1) == '=' || input.LA(1) == '?' + || (input.LA(1) >= 'A' && input.LA(1) <= 'Z') + || (input.LA(1) >= '^' && input.LA(1) <= 'z') + || (input.LA(1) >= '~' && input.LA(1) <= '\uFFFF')) { + input.consume(); + state.failed = false; + } + else { + if (state.backtracking > 0) { + state.failed = true; + return; + } + MismatchedSetException mse = new MismatchedSetException(null, input); + recover(mse); + throw mse; + } } } - finally { - } + finally {} } + // $ANTLR end "NonWhiteSpaceChar" // $ANTLR start "SymbolChars" @@ -1240,44 +1399,52 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:159:21: ( ( NonWhiteSpaceChar )+ ) // SilkSchema.g:159:23: ( NonWhiteSpaceChar )+ { - // SilkSchema.g:159:23: ( NonWhiteSpaceChar )+ - int cnt15=0; - loop15: - do { - int alt15=2; - int LA15_0 = input.LA(1); - - if ( ((LA15_0>='\u0000' && LA15_0<='\b')||LA15_0=='\u000B'||(LA15_0>='\u000E' && LA15_0<='\u001F')||LA15_0=='!'||LA15_0=='$'||LA15_0=='&'||LA15_0=='+'||(LA15_0>='/' && LA15_0<='9')||LA15_0==';'||LA15_0=='='||LA15_0=='?'||(LA15_0>='A' && LA15_0<='Z')||(LA15_0>='^' && LA15_0<='z')||(LA15_0>='~' && LA15_0<='\uFFFF')) ) { - alt15=1; - } - + // SilkSchema.g:159:23: ( NonWhiteSpaceChar )+ + int cnt15 = 0; + loop15: do { + int alt15 = 2; + int LA15_0 = input.LA(1); + + if (((LA15_0 >= '\u0000' && LA15_0 <= '\b') || LA15_0 == '\u000B' + || (LA15_0 >= '\u000E' && LA15_0 <= '\u001F') || LA15_0 == '!' + || LA15_0 == '$' || LA15_0 == '&' || LA15_0 == '+' + || (LA15_0 >= '/' && LA15_0 <= '9') || LA15_0 == ';' || LA15_0 == '=' + || LA15_0 == '?' || (LA15_0 >= 'A' && LA15_0 <= 'Z') + || (LA15_0 >= '^' && LA15_0 <= 'z') || (LA15_0 >= '~' && LA15_0 <= '\uFFFF'))) { + alt15 = 1; + } - switch (alt15) { - case 1 : - // SilkSchema.g:159:23: NonWhiteSpaceChar - { - mNonWhiteSpaceChar(); if (state.failed) return ; + switch (alt15) { + case 1: + // SilkSchema.g:159:23: NonWhiteSpaceChar + { + mNonWhiteSpaceChar(); + if (state.failed) + return; - } - break; + } + break; - default : - if ( cnt15 >= 1 ) break loop15; - if (state.backtracking>0) {state.failed=true; return ;} - EarlyExitException eee = - new EarlyExitException(15, input); + default: + if (cnt15 >= 1) + break loop15; + if (state.backtracking > 0) { + state.failed = true; + return; + } + EarlyExitException eee = new EarlyExitException(15, input); throw eee; + } + cnt15++; } - cnt15++; - } while (true); - + while (true); } } - finally { - } + finally {} } + // $ANTLR end "SymbolChars" // $ANTLR start "Symbol" @@ -1285,27 +1452,32 @@ public class SilkSchemaLexer extends Lexer { try { int _type = Symbol; int _channel = DEFAULT_TOKEN_CHANNEL; - Token s=null; + Token s = null; // SilkSchema.g:160:7: ( ( ':' NonWhiteSpaceChar )=> ':' s= SymbolChars ) // SilkSchema.g:160:9: ( ':' NonWhiteSpaceChar )=> ':' s= SymbolChars { - match(':'); if (state.failed) return ; - int sStart586 = getCharIndex(); - mSymbolChars(); if (state.failed) return ; - s = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, sStart586, getCharIndex()-1); - if ( state.backtracking==0 ) { - setText((s!=null?s.getText():null)); - } + match(':'); + if (state.failed) + return; + int sStart586 = getCharIndex(); + mSymbolChars(); + if (state.failed) + return; + s = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, + sStart586, getCharIndex() - 1); + if (state.backtracking == 0) { + setText((s != null ? s.getText() : null)); + } } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "Symbol" // $ANTLR start "Class" @@ -1316,17 +1488,18 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:162:6: ( 'class' ) // SilkSchema.g:162:8: 'class' { - match("class"); if (state.failed) return ; - + match("class"); + if (state.failed) + return; } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "Class" // $ANTLR start "Includes" @@ -1337,17 +1510,18 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:163:9: ( 'includes' ) // SilkSchema.g:163:11: 'includes' { - match("includes"); if (state.failed) return ; - + match("includes"); + if (state.failed) + return; } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "Includes" // $ANTLR start "End" @@ -1358,17 +1532,18 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:164:4: ( 'end' ) // SilkSchema.g:164:6: 'end' { - match("end"); if (state.failed) return ; - + match("end"); + if (state.failed) + return; } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "End" // $ANTLR start "Relation" @@ -1379,17 +1554,18 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:165:9: ( 'relation' ) // SilkSchema.g:165:11: 'relation' { - match("relation"); if (state.failed) return ; - + match("relation"); + if (state.failed) + return; } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "Relation" // $ANTLR start "Index" @@ -1400,17 +1576,18 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:166:6: ( 'index' ) // SilkSchema.g:166:8: 'index' { - match("index"); if (state.failed) return ; - + match("index"); + if (state.failed) + return; } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "Index" // $ANTLR start "BelongsTo" @@ -1421,17 +1598,18 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:167:10: ( 'belongs_to' ) // SilkSchema.g:167:12: 'belongs_to' { - match("belongs_to"); if (state.failed) return ; - + match("belongs_to"); + if (state.failed) + return; } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "BelongsTo" // $ANTLR start "SafeFirstLetter" @@ -1440,23 +1618,27 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:169:25: ( 'A' .. 'Z' | 'a' .. 'z' ) // SilkSchema.g: { - if ( (input.LA(1)>='A' && input.LA(1)<='Z')||(input.LA(1)>='a' && input.LA(1)<='z') ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - + if ((input.LA(1) >= 'A' && input.LA(1) <= 'Z') + || (input.LA(1) >= 'a' && input.LA(1) <= 'z')) { + input.consume(); + state.failed = false; + } + else { + if (state.backtracking > 0) { + state.failed = true; + return; + } + MismatchedSetException mse = new MismatchedSetException(null, input); + recover(mse); + throw mse; + } } } - finally { - } + finally {} } + // $ANTLR end "SafeFirstLetter" // $ANTLR start "SafeLetter" @@ -1465,23 +1647,28 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:170:20: ( SafeFirstLetter | '0' .. '9' | '-' | '_' ) // SilkSchema.g: { - if ( input.LA(1)=='-'||(input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - + if (input.LA(1) == '-' || (input.LA(1) >= '0' && input.LA(1) <= '9') + || (input.LA(1) >= 'A' && input.LA(1) <= 'Z') || input.LA(1) == '_' + || (input.LA(1) >= 'a' && input.LA(1) <= 'z')) { + input.consume(); + state.failed = false; + } + else { + if (state.backtracking > 0) { + state.failed = true; + return; + } + MismatchedSetException mse = new MismatchedSetException(null, input); + recover(mse); + throw mse; + } } } - finally { - } + finally {} } + // $ANTLR end "SafeLetter" // $ANTLR start "ModuleName" @@ -1490,90 +1677,97 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:172:20: ( SafeFirstLetter ( SafeLetter )* ( '.' SafeFirstLetter ( SafeLetter )* )* ) // SilkSchema.g:172:22: SafeFirstLetter ( SafeLetter )* ( '.' SafeFirstLetter ( SafeLetter )* )* { - mSafeFirstLetter(); if (state.failed) return ; - // SilkSchema.g:172:38: ( SafeLetter )* - loop16: - do { - int alt16=2; - int LA16_0 = input.LA(1); - - if ( (LA16_0=='-'||(LA16_0>='0' && LA16_0<='9')||(LA16_0>='A' && LA16_0<='Z')||LA16_0=='_'||(LA16_0>='a' && LA16_0<='z')) ) { - alt16=1; - } - - - switch (alt16) { - case 1 : - // SilkSchema.g:172:38: SafeLetter - { - mSafeLetter(); if (state.failed) return ; - - } - break; + mSafeFirstLetter(); + if (state.failed) + return; + // SilkSchema.g:172:38: ( SafeLetter )* + loop16: do { + int alt16 = 2; + int LA16_0 = input.LA(1); + + if ((LA16_0 == '-' || (LA16_0 >= '0' && LA16_0 <= '9') + || (LA16_0 >= 'A' && LA16_0 <= 'Z') || LA16_0 == '_' || (LA16_0 >= 'a' && LA16_0 <= 'z'))) { + alt16 = 1; + } - default : - break loop16; - } - } while (true); + switch (alt16) { + case 1: + // SilkSchema.g:172:38: SafeLetter + { + mSafeLetter(); + if (state.failed) + return; - // SilkSchema.g:172:50: ( '.' SafeFirstLetter ( SafeLetter )* )* - loop18: - do { - int alt18=2; - int LA18_0 = input.LA(1); + } + break; - if ( (LA18_0=='.') ) { - alt18=1; + default: + break loop16; + } } + while (true); + // SilkSchema.g:172:50: ( '.' SafeFirstLetter ( SafeLetter )* )* + loop18: do { + int alt18 = 2; + int LA18_0 = input.LA(1); - switch (alt18) { - case 1 : - // SilkSchema.g:172:51: '.' SafeFirstLetter ( SafeLetter )* - { - match('.'); if (state.failed) return ; - mSafeFirstLetter(); if (state.failed) return ; - // SilkSchema.g:172:71: ( SafeLetter )* - loop17: - do { - int alt17=2; - int LA17_0 = input.LA(1); - - if ( (LA17_0=='-'||(LA17_0>='0' && LA17_0<='9')||(LA17_0>='A' && LA17_0<='Z')||LA17_0=='_'||(LA17_0>='a' && LA17_0<='z')) ) { - alt17=1; - } - + if ((LA18_0 == '.')) { + alt18 = 1; + } - switch (alt17) { - case 1 : - // SilkSchema.g:172:71: SafeLetter - { - mSafeLetter(); if (state.failed) return ; + switch (alt18) { + case 1: + // SilkSchema.g:172:51: '.' SafeFirstLetter ( SafeLetter )* + { + match('.'); + if (state.failed) + return; + mSafeFirstLetter(); + if (state.failed) + return; + // SilkSchema.g:172:71: ( SafeLetter )* + loop17: do { + int alt17 = 2; + int LA17_0 = input.LA(1); + + if ((LA17_0 == '-' || (LA17_0 >= '0' && LA17_0 <= '9') + || (LA17_0 >= 'A' && LA17_0 <= 'Z') || LA17_0 == '_' || (LA17_0 >= 'a' && LA17_0 <= 'z'))) { + alt17 = 1; + } - } - break; + switch (alt17) { + case 1: + // SilkSchema.g:172:71: SafeLetter + { + mSafeLetter(); + if (state.failed) + return; - default : - break loop17; - } - } while (true); + } + break; + default: + break loop17; + } + } + while (true); - } - break; + } + break; - default : - break loop18; + default: + break loop18; + } } - } while (true); - + while (true); } } - finally { - } + finally {} } + // $ANTLR end "ModuleName" // $ANTLR start "ModuleDef" @@ -1581,29 +1775,36 @@ public class SilkSchemaLexer extends Lexer { try { int _type = ModuleDef; int _channel = DEFAULT_TOKEN_CHANNEL; - Token s=null; + Token s = null; // SilkSchema.g:173:10: ( 'module' WhiteSpaces s= ModuleName ) // SilkSchema.g:173:12: 'module' WhiteSpaces s= ModuleName { - match("module"); if (state.failed) return ; - - mWhiteSpaces(); if (state.failed) return ; - int sStart715 = getCharIndex(); - mModuleName(); if (state.failed) return ; - s = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, sStart715, getCharIndex()-1); - if ( state.backtracking==0 ) { - setText((s!=null?s.getText():null)); - } + match("module"); + if (state.failed) + return; + + mWhiteSpaces(); + if (state.failed) + return; + int sStart715 = getCharIndex(); + mModuleName(); + if (state.failed) + return; + s = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, + sStart715, getCharIndex() - 1); + if (state.backtracking == 0) { + setText((s != null ? s.getText() : null)); + } } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "ModuleDef" // $ANTLR start "QNameChar" @@ -1612,23 +1813,34 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:175:19: (~ ( LineBreakChar | UnsafeUnicodeChar | WhiteSpace ) ) // SilkSchema.g:175:21: ~ ( LineBreakChar | UnsafeUnicodeChar | WhiteSpace ) { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='\b')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\u001F')||input.LA(1)=='!'||input.LA(1)=='$'||input.LA(1)=='&'||input.LA(1)=='+'||(input.LA(1)>='/' && input.LA(1)<='9')||input.LA(1)==';'||input.LA(1)=='='||input.LA(1)=='?'||(input.LA(1)>='A' && input.LA(1)<='Z')||(input.LA(1)>='^' && input.LA(1)<='z')||(input.LA(1)>='~' && input.LA(1)<='\uFFFF') ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - + if ((input.LA(1) >= '\u0000' && input.LA(1) <= '\b') + || (input.LA(1) >= '\u000B' && input.LA(1) <= '\f') + || (input.LA(1) >= '\u000E' && input.LA(1) <= '\u001F') + || input.LA(1) == '!' || input.LA(1) == '$' || input.LA(1) == '&' + || input.LA(1) == '+' || (input.LA(1) >= '/' && input.LA(1) <= '9') + || input.LA(1) == ';' || input.LA(1) == '=' || input.LA(1) == '?' + || (input.LA(1) >= 'A' && input.LA(1) <= 'Z') + || (input.LA(1) >= '^' && input.LA(1) <= 'z') + || (input.LA(1) >= '~' && input.LA(1) <= '\uFFFF')) { + input.consume(); + state.failed = false; + } + else { + if (state.backtracking > 0) { + state.failed = true; + return; + } + MismatchedSetException mse = new MismatchedSetException(null, input); + recover(mse); + throw mse; + } } } - finally { - } + finally {} } + // $ANTLR end "QNameChar" // $ANTLR start "QName" @@ -1639,102 +1851,122 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:176:6: ( ( QNameChar )+ ( Dot ( QNameChar )+ )* ) // SilkSchema.g:176:8: ( QNameChar )+ ( Dot ( QNameChar )+ )* { - // SilkSchema.g:176:8: ( QNameChar )+ - int cnt19=0; - loop19: - do { - int alt19=2; - int LA19_0 = input.LA(1); - - if ( ((LA19_0>='\u0000' && LA19_0<='\b')||(LA19_0>='\u000B' && LA19_0<='\f')||(LA19_0>='\u000E' && LA19_0<='\u001F')||LA19_0=='!'||LA19_0=='$'||LA19_0=='&'||LA19_0=='+'||(LA19_0>='/' && LA19_0<='9')||LA19_0==';'||LA19_0=='='||LA19_0=='?'||(LA19_0>='A' && LA19_0<='Z')||(LA19_0>='^' && LA19_0<='z')||(LA19_0>='~' && LA19_0<='\uFFFF')) ) { - alt19=1; - } - + // SilkSchema.g:176:8: ( QNameChar )+ + int cnt19 = 0; + loop19: do { + int alt19 = 2; + int LA19_0 = input.LA(1); + + if (((LA19_0 >= '\u0000' && LA19_0 <= '\b') + || (LA19_0 >= '\u000B' && LA19_0 <= '\f') + || (LA19_0 >= '\u000E' && LA19_0 <= '\u001F') || LA19_0 == '!' + || LA19_0 == '$' || LA19_0 == '&' || LA19_0 == '+' + || (LA19_0 >= '/' && LA19_0 <= '9') || LA19_0 == ';' || LA19_0 == '=' + || LA19_0 == '?' || (LA19_0 >= 'A' && LA19_0 <= 'Z') + || (LA19_0 >= '^' && LA19_0 <= 'z') || (LA19_0 >= '~' && LA19_0 <= '\uFFFF'))) { + alt19 = 1; + } - switch (alt19) { - case 1 : - // SilkSchema.g:176:8: QNameChar - { - mQNameChar(); if (state.failed) return ; + switch (alt19) { + case 1: + // SilkSchema.g:176:8: QNameChar + { + mQNameChar(); + if (state.failed) + return; - } - break; + } + break; - default : - if ( cnt19 >= 1 ) break loop19; - if (state.backtracking>0) {state.failed=true; return ;} - EarlyExitException eee = - new EarlyExitException(19, input); + default: + if (cnt19 >= 1) + break loop19; + if (state.backtracking > 0) { + state.failed = true; + return; + } + EarlyExitException eee = new EarlyExitException(19, input); throw eee; + } + cnt19++; } - cnt19++; - } while (true); - - // SilkSchema.g:176:19: ( Dot ( QNameChar )+ )* - loop21: - do { - int alt21=2; - int LA21_0 = input.LA(1); - - if ( (LA21_0=='.') ) { - alt21=1; - } + while (true); + // SilkSchema.g:176:19: ( Dot ( QNameChar )+ )* + loop21: do { + int alt21 = 2; + int LA21_0 = input.LA(1); - switch (alt21) { - case 1 : - // SilkSchema.g:176:20: Dot ( QNameChar )+ - { - mDot(); if (state.failed) return ; - // SilkSchema.g:176:24: ( QNameChar )+ - int cnt20=0; - loop20: - do { - int alt20=2; - int LA20_0 = input.LA(1); - - if ( ((LA20_0>='\u0000' && LA20_0<='\b')||(LA20_0>='\u000B' && LA20_0<='\f')||(LA20_0>='\u000E' && LA20_0<='\u001F')||LA20_0=='!'||LA20_0=='$'||LA20_0=='&'||LA20_0=='+'||(LA20_0>='/' && LA20_0<='9')||LA20_0==';'||LA20_0=='='||LA20_0=='?'||(LA20_0>='A' && LA20_0<='Z')||(LA20_0>='^' && LA20_0<='z')||(LA20_0>='~' && LA20_0<='\uFFFF')) ) { - alt20=1; - } - - - switch (alt20) { - case 1 : - // SilkSchema.g:176:24: QNameChar - { - mQNameChar(); if (state.failed) return ; + if ((LA21_0 == '.')) { + alt21 = 1; + } - } - break; + switch (alt21) { + case 1: + // SilkSchema.g:176:20: Dot ( QNameChar )+ + { + mDot(); + if (state.failed) + return; + // SilkSchema.g:176:24: ( QNameChar )+ + int cnt20 = 0; + loop20: do { + int alt20 = 2; + int LA20_0 = input.LA(1); + + if (((LA20_0 >= '\u0000' && LA20_0 <= '\b') + || (LA20_0 >= '\u000B' && LA20_0 <= '\f') + || (LA20_0 >= '\u000E' && LA20_0 <= '\u001F') || LA20_0 == '!' + || LA20_0 == '$' || LA20_0 == '&' || LA20_0 == '+' + || (LA20_0 >= '/' && LA20_0 <= '9') || LA20_0 == ';' + || LA20_0 == '=' || LA20_0 == '?' + || (LA20_0 >= 'A' && LA20_0 <= 'Z') + || (LA20_0 >= '^' && LA20_0 <= 'z') || (LA20_0 >= '~' && LA20_0 <= '\uFFFF'))) { + alt20 = 1; + } - default : - if ( cnt20 >= 1 ) break loop20; - if (state.backtracking>0) {state.failed=true; return ;} - EarlyExitException eee = - new EarlyExitException(20, input); - throw eee; - } - cnt20++; - } while (true); + switch (alt20) { + case 1: + // SilkSchema.g:176:24: QNameChar + { + mQNameChar(); + if (state.failed) + return; + } + break; + + default: + if (cnt20 >= 1) + break loop20; + if (state.backtracking > 0) { + state.failed = true; + return; + } + EarlyExitException eee = new EarlyExitException(20, input); + throw eee; + } + cnt20++; + } + while (true); - } - break; + } + break; - default : - break loop21; + default: + break loop21; + } } - } while (true); - + while (true); } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "QName" // $ANTLR start "WhiteSpace" @@ -1743,23 +1975,26 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:179:11: ( ' ' | '\\t' ) // SilkSchema.g: { - if ( input.LA(1)=='\t'||input.LA(1)==' ' ) { - input.consume(); - state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return ;} - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - + if (input.LA(1) == '\t' || input.LA(1) == ' ') { + input.consume(); + state.failed = false; + } + else { + if (state.backtracking > 0) { + state.failed = true; + return; + } + MismatchedSetException mse = new MismatchedSetException(null, input); + recover(mse); + throw mse; + } } } - finally { - } + finally {} } + // $ANTLR end "WhiteSpace" // $ANTLR start "WhiteSpaces" @@ -1770,311 +2005,361 @@ public class SilkSchemaLexer extends Lexer { // SilkSchema.g:181:12: ( ( WhiteSpace )+ ) // SilkSchema.g:181:14: ( WhiteSpace )+ { - // SilkSchema.g:181:14: ( WhiteSpace )+ - int cnt22=0; - loop22: - do { - int alt22=2; - int LA22_0 = input.LA(1); - - if ( (LA22_0=='\t'||LA22_0==' ') ) { - alt22=1; - } - + // SilkSchema.g:181:14: ( WhiteSpace )+ + int cnt22 = 0; + loop22: do { + int alt22 = 2; + int LA22_0 = input.LA(1); + + if ((LA22_0 == '\t' || LA22_0 == ' ')) { + alt22 = 1; + } - switch (alt22) { - case 1 : - // SilkSchema.g:181:14: WhiteSpace - { - mWhiteSpace(); if (state.failed) return ; + switch (alt22) { + case 1: + // SilkSchema.g:181:14: WhiteSpace + { + mWhiteSpace(); + if (state.failed) + return; - } - break; + } + break; - default : - if ( cnt22 >= 1 ) break loop22; - if (state.backtracking>0) {state.failed=true; return ;} - EarlyExitException eee = - new EarlyExitException(22, input); + default: + if (cnt22 >= 1) + break loop22; + if (state.backtracking > 0) { + state.failed = true; + return; + } + EarlyExitException eee = new EarlyExitException(22, input); throw eee; + } + cnt22++; } - cnt22++; - } while (true); + while (true); - if ( state.backtracking==0 ) { - _channel = HIDDEN; - } + if (state.backtracking == 0) { + _channel = HIDDEN; + } } state.type = _type; state.channel = _channel; } - finally { - } + finally {} } + // $ANTLR end "WhiteSpaces" public void mTokens() throws RecognitionException { // SilkSchema.g:1:8: ( Preamble | LineComment | LineBreak | String | Integer | Double | LBrace | RBrace | LBracket | RBracket | Lt | Eq | Dot | Comma | LParen | RParen | Star | Symbol | Class | Includes | End | Relation | Index | BelongsTo | ModuleDef | QName | WhiteSpaces ) - int alt23=27; + int alt23 = 27; alt23 = dfa23.predict(input); switch (alt23) { - case 1 : - // SilkSchema.g:1:10: Preamble - { - mPreamble(); if (state.failed) return ; - - } - break; - case 2 : - // SilkSchema.g:1:19: LineComment - { - mLineComment(); if (state.failed) return ; - - } - break; - case 3 : - // SilkSchema.g:1:31: LineBreak - { - mLineBreak(); if (state.failed) return ; - - } - break; - case 4 : - // SilkSchema.g:1:41: String - { - mString(); if (state.failed) return ; - - } - break; - case 5 : - // SilkSchema.g:1:48: Integer - { - mInteger(); if (state.failed) return ; - - } - break; - case 6 : - // SilkSchema.g:1:56: Double - { - mDouble(); if (state.failed) return ; - - } - break; - case 7 : - // SilkSchema.g:1:63: LBrace - { - mLBrace(); if (state.failed) return ; - - } - break; - case 8 : - // SilkSchema.g:1:70: RBrace - { - mRBrace(); if (state.failed) return ; - - } - break; - case 9 : - // SilkSchema.g:1:77: LBracket - { - mLBracket(); if (state.failed) return ; - - } - break; - case 10 : - // SilkSchema.g:1:86: RBracket - { - mRBracket(); if (state.failed) return ; - - } - break; - case 11 : - // SilkSchema.g:1:95: Lt - { - mLt(); if (state.failed) return ; - - } - break; - case 12 : - // SilkSchema.g:1:98: Eq - { - mEq(); if (state.failed) return ; - - } - break; - case 13 : - // SilkSchema.g:1:101: Dot - { - mDot(); if (state.failed) return ; - - } - break; - case 14 : - // SilkSchema.g:1:105: Comma - { - mComma(); if (state.failed) return ; - - } - break; - case 15 : - // SilkSchema.g:1:111: LParen - { - mLParen(); if (state.failed) return ; - - } - break; - case 16 : - // SilkSchema.g:1:118: RParen - { - mRParen(); if (state.failed) return ; - - } - break; - case 17 : - // SilkSchema.g:1:125: Star - { - mStar(); if (state.failed) return ; - - } - break; - case 18 : - // SilkSchema.g:1:130: Symbol - { - mSymbol(); if (state.failed) return ; - - } - break; - case 19 : - // SilkSchema.g:1:137: Class - { - mClass(); if (state.failed) return ; - - } - break; - case 20 : - // SilkSchema.g:1:143: Includes - { - mIncludes(); if (state.failed) return ; - - } - break; - case 21 : - // SilkSchema.g:1:152: End - { - mEnd(); if (state.failed) return ; - - } - break; - case 22 : - // SilkSchema.g:1:156: Relation - { - mRelation(); if (state.failed) return ; + case 1: + // SilkSchema.g:1:10: Preamble + { + mPreamble(); + if (state.failed) + return; + + } + break; + case 2: + // SilkSchema.g:1:19: LineComment + { + mLineComment(); + if (state.failed) + return; + + } + break; + case 3: + // SilkSchema.g:1:31: LineBreak + { + mLineBreak(); + if (state.failed) + return; + + } + break; + case 4: + // SilkSchema.g:1:41: String + { + mString(); + if (state.failed) + return; + + } + break; + case 5: + // SilkSchema.g:1:48: Integer + { + mInteger(); + if (state.failed) + return; + + } + break; + case 6: + // SilkSchema.g:1:56: Double + { + mDouble(); + if (state.failed) + return; + + } + break; + case 7: + // SilkSchema.g:1:63: LBrace + { + mLBrace(); + if (state.failed) + return; + + } + break; + case 8: + // SilkSchema.g:1:70: RBrace + { + mRBrace(); + if (state.failed) + return; + + } + break; + case 9: + // SilkSchema.g:1:77: LBracket + { + mLBracket(); + if (state.failed) + return; + + } + break; + case 10: + // SilkSchema.g:1:86: RBracket + { + mRBracket(); + if (state.failed) + return; + + } + break; + case 11: + // SilkSchema.g:1:95: Lt + { + mLt(); + if (state.failed) + return; + + } + break; + case 12: + // SilkSchema.g:1:98: Eq + { + mEq(); + if (state.failed) + return; + + } + break; + case 13: + // SilkSchema.g:1:101: Dot + { + mDot(); + if (state.failed) + return; + + } + break; + case 14: + // SilkSchema.g:1:105: Comma + { + mComma(); + if (state.failed) + return; + + } + break; + case 15: + // SilkSchema.g:1:111: LParen + { + mLParen(); + if (state.failed) + return; + + } + break; + case 16: + // SilkSchema.g:1:118: RParen + { + mRParen(); + if (state.failed) + return; + + } + break; + case 17: + // SilkSchema.g:1:125: Star + { + mStar(); + if (state.failed) + return; + + } + break; + case 18: + // SilkSchema.g:1:130: Symbol + { + mSymbol(); + if (state.failed) + return; + + } + break; + case 19: + // SilkSchema.g:1:137: Class + { + mClass(); + if (state.failed) + return; + + } + break; + case 20: + // SilkSchema.g:1:143: Includes + { + mIncludes(); + if (state.failed) + return; + + } + break; + case 21: + // SilkSchema.g:1:152: End + { + mEnd(); + if (state.failed) + return; + + } + break; + case 22: + // SilkSchema.g:1:156: Relation + { + mRelation(); + if (state.failed) + return; - } - break; - case 23 : - // SilkSchema.g:1:165: Index - { - mIndex(); if (state.failed) return ; + } + break; + case 23: + // SilkSchema.g:1:165: Index + { + mIndex(); + if (state.failed) + return; - } - break; - case 24 : - // SilkSchema.g:1:171: BelongsTo - { - mBelongsTo(); if (state.failed) return ; + } + break; + case 24: + // SilkSchema.g:1:171: BelongsTo + { + mBelongsTo(); + if (state.failed) + return; - } - break; - case 25 : - // SilkSchema.g:1:181: ModuleDef - { - mModuleDef(); if (state.failed) return ; + } + break; + case 25: + // SilkSchema.g:1:181: ModuleDef + { + mModuleDef(); + if (state.failed) + return; - } - break; - case 26 : - // SilkSchema.g:1:191: QName - { - mQName(); if (state.failed) return ; + } + break; + case 26: + // SilkSchema.g:1:191: QName + { + mQName(); + if (state.failed) + return; - } - break; - case 27 : - // SilkSchema.g:1:197: WhiteSpaces - { - mWhiteSpaces(); if (state.failed) return ; + } + break; + case 27: + // SilkSchema.g:1:197: WhiteSpaces + { + mWhiteSpaces(); + if (state.failed) + return; - } - break; + } + break; } } - protected DFA23 dfa23 = new DFA23(this); - static final String DFA23_eotS = - "\6\uffff\2\36\5\uffff\1\42\6\uffff\6\32\2\uffff\2\36\2\uffff\1"+ - "\32\1\36\1\uffff\6\32\1\uffff\1\36\1\51\1\32\1\51\3\32\1\71\7\32"+ - "\1\uffff\4\32\1\51\1\105\1\32\1\107\3\32\1\uffff\1\32\1\uffff\6"+ - "\32\1\uffff\1\122\1\123\1\32\2\uffff\1\32\1\126\1\uffff"; - static final String DFA23_eofS = - "\127\uffff"; - static final String DFA23_minS = - "\1\0\4\uffff\1\60\2\0\5\uffff\1\0\6\uffff\1\154\2\156\2\145\1\157"+ - "\2\uffff\2\56\1\uffff\1\0\1\53\1\0\1\uffff\1\141\1\143\1\144\2\154"+ - "\1\144\1\uffff\1\56\1\0\1\60\1\0\1\163\1\154\1\145\1\0\1\141\1\157"+ - "\1\165\1\53\1\163\1\165\1\170\1\uffff\1\164\1\156\1\154\1\60\2\0"+ - "\1\144\1\0\1\151\1\147\1\145\1\uffff\1\145\1\uffff\1\157\1\163\1"+ - "\11\1\163\1\156\1\137\1\uffff\2\0\1\164\2\uffff\1\157\1\0\1\uffff"; - static final String DFA23_maxS = - "\1\uffff\4\uffff\1\71\2\uffff\5\uffff\1\uffff\6\uffff\1\154\2\156"+ - "\2\145\1\157\2\uffff\2\145\1\uffff\1\uffff\1\71\1\uffff\1\uffff"+ - "\1\141\2\144\2\154\1\144\1\uffff\1\145\1\uffff\1\71\1\uffff\1\163"+ - "\1\154\1\145\1\uffff\1\141\1\157\1\165\1\71\1\163\1\165\1\170\1"+ - "\uffff\1\164\1\156\1\154\1\71\2\uffff\1\144\1\uffff\1\151\1\147"+ - "\1\145\1\uffff\1\145\1\uffff\1\157\1\163\1\40\1\163\1\156\1\137"+ - "\1\uffff\2\uffff\1\164\2\uffff\1\157\1\uffff\1\uffff"; - static final String DFA23_acceptS = - "\1\uffff\1\1\1\2\1\3\1\4\3\uffff\1\7\1\10\1\11\1\12\1\13\1\uffff"+ - "\1\15\1\16\1\17\1\20\1\21\1\22\6\uffff\1\32\1\33\2\uffff\1\5\3\uffff"+ - "\1\14\6\uffff\1\6\17\uffff\1\25\13\uffff\1\23\1\uffff\1\27\6\uffff"+ - "\1\31\3\uffff\1\24\1\26\2\uffff\1\30"; - static final String DFA23_specialS = - "\1\7\5\uffff\1\4\1\14\5\uffff\1\12\21\uffff\1\3\1\uffff\1\10\11"+ - "\uffff\1\1\1\uffff\1\11\3\uffff\1\15\14\uffff\1\5\1\13\1\uffff\1"+ - "\6\15\uffff\1\2\1\0\4\uffff\1\16\1\uffff}>"; + static final String DFA23_eotS = "\6\uffff\2\36\5\uffff\1\42\6\uffff\6\32\2\uffff\2\36\2\uffff\1" + + "\32\1\36\1\uffff\6\32\1\uffff\1\36\1\51\1\32\1\51\3\32\1\71\7\32" + + "\1\uffff\4\32\1\51\1\105\1\32\1\107\3\32\1\uffff\1\32\1\uffff\6" + + "\32\1\uffff\1\122\1\123\1\32\2\uffff\1\32\1\126\1\uffff"; + static final String DFA23_eofS = "\127\uffff"; + static final String DFA23_minS = "\1\0\4\uffff\1\60\2\0\5\uffff\1\0\6\uffff\1\154\2\156\2\145\1\157" + + "\2\uffff\2\56\1\uffff\1\0\1\53\1\0\1\uffff\1\141\1\143\1\144\2\154" + + "\1\144\1\uffff\1\56\1\0\1\60\1\0\1\163\1\154\1\145\1\0\1\141\1\157" + + "\1\165\1\53\1\163\1\165\1\170\1\uffff\1\164\1\156\1\154\1\60\2\0" + + "\1\144\1\0\1\151\1\147\1\145\1\uffff\1\145\1\uffff\1\157\1\163\1" + + "\11\1\163\1\156\1\137\1\uffff\2\0\1\164\2\uffff\1\157\1\0\1\uffff"; + static final String DFA23_maxS = "\1\uffff\4\uffff\1\71\2\uffff\5\uffff\1\uffff\6\uffff\1\154\2\156" + + "\2\145\1\157\2\uffff\2\145\1\uffff\1\uffff\1\71\1\uffff\1\uffff" + + "\1\141\2\144\2\154\1\144\1\uffff\1\145\1\uffff\1\71\1\uffff\1\163" + + "\1\154\1\145\1\uffff\1\141\1\157\1\165\1\71\1\163\1\165\1\170\1" + + "\uffff\1\164\1\156\1\154\1\71\2\uffff\1\144\1\uffff\1\151\1\147" + + "\1\145\1\uffff\1\145\1\uffff\1\157\1\163\1\40\1\163\1\156\1\137" + + "\1\uffff\2\uffff\1\164\2\uffff\1\157\1\uffff\1\uffff"; + static final String DFA23_acceptS = "\1\uffff\1\1\1\2\1\3\1\4\3\uffff\1\7\1\10\1\11\1\12\1\13\1\uffff" + + "\1\15\1\16\1\17\1\20\1\21\1\22\6\uffff\1\32\1\33\2\uffff\1\5\3\uffff" + + "\1\14\6\uffff\1\6\17\uffff\1\25\13\uffff\1\23\1\uffff\1\27\6\uffff" + + "\1\31\3\uffff\1\24\1\26\2\uffff\1\30"; + static final String DFA23_specialS = "\1\7\5\uffff\1\4\1\14\5\uffff\1\12\21\uffff\1\3\1\uffff\1\10\11" + + "\uffff\1\1\1\uffff\1\11\3\uffff\1\15\14\uffff\1\5\1\13\1\uffff\1" + + "\6\15\uffff\1\2\1\0\4\uffff\1\16\1\uffff}>"; static final String[] DFA23_transitionS = { - "\11\32\1\33\1\3\2\32\1\3\22\32\1\33\1\32\1\4\1\2\1\32\1\1\1"+ - "\32\1\uffff\1\20\1\21\1\22\1\32\1\17\1\5\1\16\1\32\1\6\11\7"+ - "\1\23\1\32\1\14\1\15\1\uffff\1\32\1\uffff\32\32\1\12\1\uffff"+ - "\1\13\4\32\1\30\1\24\1\32\1\26\3\32\1\25\3\32\1\31\4\32\1\27"+ - "\10\32\1\10\1\uffff\1\11\uff82\32", + "\11\32\1\33\1\3\2\32\1\3\22\32\1\33\1\32\1\4\1\2\1\32\1\1\1" + + "\32\1\uffff\1\20\1\21\1\22\1\32\1\17\1\5\1\16\1\32\1\6\11\7" + + "\1\23\1\32\1\14\1\15\1\uffff\1\32\1\uffff\32\32\1\12\1\uffff" + + "\1\13\4\32\1\30\1\24\1\32\1\26\3\32\1\25\3\32\1\31\4\32\1\27" + + "\10\32\1\10\1\uffff\1\11\uff82\32", "", "", "", "", "\1\34\11\35", - "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32"+ - "\1\uffff\1\32\4\uffff\1\32\2\uffff\1\37\13\32\1\uffff\1\32\1"+ - "\uffff\1\32\1\uffff\1\32\1\uffff\4\32\1\40\25\32\3\uffff\7\32"+ - "\1\40\25\32\3\uffff\uff82\32", - "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32"+ - "\1\uffff\1\32\4\uffff\1\32\2\uffff\1\37\1\32\12\41\1\uffff\1"+ - "\32\1\uffff\1\32\1\uffff\1\32\1\uffff\4\32\1\40\25\32\3\uffff"+ - "\7\32\1\40\25\32\3\uffff\uff82\32", + "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32" + + "\1\uffff\1\32\4\uffff\1\32\2\uffff\1\37\13\32\1\uffff\1\32\1" + + "\uffff\1\32\1\uffff\1\32\1\uffff\4\32\1\40\25\32\3\uffff\7\32" + + "\1\40\25\32\3\uffff\uff82\32", + "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32" + + "\1\uffff\1\32\4\uffff\1\32\2\uffff\1\37\1\32\12\41\1\uffff\1" + + "\32\1\uffff\1\32\1\uffff\1\32\1\uffff\4\32\1\40\25\32\3\uffff" + + "\7\32\1\40\25\32\3\uffff\uff82\32", "", "", "", "", "", - "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32"+ - "\1\uffff\1\32\4\uffff\1\32\2\uffff\14\32\1\uffff\1\32\1\uffff"+ - "\1\32\1\uffff\1\32\1\uffff\32\32\3\uffff\35\32\3\uffff\uff82"+ - "\32", + "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32" + + "\1\uffff\1\32\4\uffff\1\32\2\uffff\14\32\1\uffff\1\32\1\uffff" + + "\1\32\1\uffff\1\32\1\uffff\32\32\3\uffff\35\32\3\uffff\uff82" + "\32", "", "", "", @@ -2092,15 +2377,14 @@ public class SilkSchemaLexer extends Lexer { "\1\51\26\uffff\1\51\37\uffff\1\51", "\1\51\1\uffff\12\52\13\uffff\1\51\37\uffff\1\51", "", - "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32"+ - "\1\uffff\1\32\4\uffff\1\32\3\uffff\1\32\12\53\1\uffff\1\32\1"+ - "\uffff\1\32\1\uffff\1\32\1\uffff\32\32\3\uffff\35\32\3\uffff"+ - "\uff82\32", + "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32" + + "\1\uffff\1\32\4\uffff\1\32\3\uffff\1\32\12\53\1\uffff\1\32\1" + + "\uffff\1\32\1\uffff\1\32\1\uffff\32\32\3\uffff\35\32\3\uffff" + "\uff82\32", "\1\54\1\uffff\1\51\2\uffff\12\55", - "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32"+ - "\1\uffff\1\32\4\uffff\1\32\2\uffff\1\37\1\32\12\41\1\uffff\1"+ - "\32\1\uffff\1\32\1\uffff\1\32\1\uffff\4\32\1\40\25\32\3\uffff"+ - "\7\32\1\40\25\32\3\uffff\uff82\32", + "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32" + + "\1\uffff\1\32\4\uffff\1\32\2\uffff\1\37\1\32\12\41\1\uffff\1" + + "\32\1\uffff\1\32\1\uffff\1\32\1\uffff\4\32\1\40\25\32\3\uffff" + + "\7\32\1\40\25\32\3\uffff\uff82\32", "", "\1\56", "\1\57\1\60", @@ -2110,22 +2394,20 @@ public class SilkSchemaLexer extends Lexer { "\1\64", "", "\1\51\1\uffff\12\52\13\uffff\1\51\37\uffff\1\51", - "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32"+ - "\1\uffff\1\32\4\uffff\1\32\2\uffff\2\32\12\53\1\uffff\1\32\1"+ - "\uffff\1\32\1\uffff\1\32\1\uffff\4\32\1\65\25\32\3\uffff\7\32"+ - "\1\65\25\32\3\uffff\uff82\32", + "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32" + + "\1\uffff\1\32\4\uffff\1\32\2\uffff\2\32\12\53\1\uffff\1\32\1" + + "\uffff\1\32\1\uffff\1\32\1\uffff\4\32\1\65\25\32\3\uffff\7\32" + + "\1\65\25\32\3\uffff\uff82\32", "\12\55", - "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32"+ - "\1\uffff\1\32\4\uffff\1\32\2\uffff\2\32\12\55\1\uffff\1\32\1"+ - "\uffff\1\32\1\uffff\1\32\1\uffff\32\32\3\uffff\35\32\3\uffff"+ - "\uff82\32", + "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32" + + "\1\uffff\1\32\4\uffff\1\32\2\uffff\2\32\12\55\1\uffff\1\32\1" + + "\uffff\1\32\1\uffff\1\32\1\uffff\32\32\3\uffff\35\32\3\uffff" + "\uff82\32", "\1\66", "\1\67", "\1\70", - "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32"+ - "\1\uffff\1\32\4\uffff\1\32\2\uffff\14\32\1\uffff\1\32\1\uffff"+ - "\1\32\1\uffff\1\32\1\uffff\32\32\3\uffff\35\32\3\uffff\uff82"+ - "\32", + "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32" + + "\1\uffff\1\32\4\uffff\1\32\2\uffff\14\32\1\uffff\1\32\1\uffff" + + "\1\32\1\uffff\1\32\1\uffff\32\32\3\uffff\35\32\3\uffff\uff82" + "\32", "\1\72", "\1\73", "\1\74", @@ -2138,19 +2420,16 @@ public class SilkSchemaLexer extends Lexer { "\1\103", "\1\104", "\12\76", - "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32"+ - "\1\uffff\1\32\4\uffff\1\32\2\uffff\2\32\12\76\1\uffff\1\32\1"+ - "\uffff\1\32\1\uffff\1\32\1\uffff\32\32\3\uffff\35\32\3\uffff"+ - "\uff82\32", - "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32"+ - "\1\uffff\1\32\4\uffff\1\32\2\uffff\14\32\1\uffff\1\32\1\uffff"+ - "\1\32\1\uffff\1\32\1\uffff\32\32\3\uffff\35\32\3\uffff\uff82"+ - "\32", + "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32" + + "\1\uffff\1\32\4\uffff\1\32\2\uffff\2\32\12\76\1\uffff\1\32\1" + + "\uffff\1\32\1\uffff\1\32\1\uffff\32\32\3\uffff\35\32\3\uffff" + "\uff82\32", + "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32" + + "\1\uffff\1\32\4\uffff\1\32\2\uffff\14\32\1\uffff\1\32\1\uffff" + + "\1\32\1\uffff\1\32\1\uffff\32\32\3\uffff\35\32\3\uffff\uff82" + "\32", "\1\106", - "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32"+ - "\1\uffff\1\32\4\uffff\1\32\2\uffff\14\32\1\uffff\1\32\1\uffff"+ - "\1\32\1\uffff\1\32\1\uffff\32\32\3\uffff\35\32\3\uffff\uff82"+ - "\32", + "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32" + + "\1\uffff\1\32\4\uffff\1\32\2\uffff\14\32\1\uffff\1\32\1\uffff" + + "\1\32\1\uffff\1\32\1\uffff\32\32\3\uffff\35\32\3\uffff\uff82" + "\32", "\1\110", "\1\111", "\1\112", @@ -2164,24 +2443,19 @@ public class SilkSchemaLexer extends Lexer { "\1\120", "\1\121", "", - "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32"+ - "\1\uffff\1\32\4\uffff\1\32\2\uffff\14\32\1\uffff\1\32\1\uffff"+ - "\1\32\1\uffff\1\32\1\uffff\32\32\3\uffff\35\32\3\uffff\uff82"+ - "\32", - "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32"+ - "\1\uffff\1\32\4\uffff\1\32\2\uffff\14\32\1\uffff\1\32\1\uffff"+ - "\1\32\1\uffff\1\32\1\uffff\32\32\3\uffff\35\32\3\uffff\uff82"+ - "\32", + "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32" + + "\1\uffff\1\32\4\uffff\1\32\2\uffff\14\32\1\uffff\1\32\1\uffff" + + "\1\32\1\uffff\1\32\1\uffff\32\32\3\uffff\35\32\3\uffff\uff82" + "\32", + "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32" + + "\1\uffff\1\32\4\uffff\1\32\2\uffff\14\32\1\uffff\1\32\1\uffff" + + "\1\32\1\uffff\1\32\1\uffff\32\32\3\uffff\35\32\3\uffff\uff82" + "\32", "\1\124", "", "", "\1\125", - "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32"+ - "\1\uffff\1\32\4\uffff\1\32\2\uffff\14\32\1\uffff\1\32\1\uffff"+ - "\1\32\1\uffff\1\32\1\uffff\32\32\3\uffff\35\32\3\uffff\uff82"+ - "\32", - "" - }; + "\11\32\2\uffff\2\32\1\uffff\22\32\1\uffff\1\32\2\uffff\1\32" + + "\1\uffff\1\32\4\uffff\1\32\2\uffff\14\32\1\uffff\1\32\1\uffff" + + "\1\32\1\uffff\1\32\1\uffff\32\32\3\uffff\35\32\3\uffff\uff82" + "\32", "" }; static final short[] DFA23_eot = DFA.unpackEncodedString(DFA23_eotS); static final short[] DFA23_eof = DFA.unpackEncodedString(DFA23_eofS); @@ -2194,7 +2468,7 @@ public class SilkSchemaLexer extends Lexer { static { int numStates = DFA23_transitionS.length; DFA23_transition = new short[numStates][]; - for (int i=0; i='\u0000' && LA23_80<='\b')||(LA23_80>='\u000B' && LA23_80<='\f')||(LA23_80>='\u000E' && LA23_80<='\u001F')||LA23_80=='!'||LA23_80=='$'||LA23_80=='&'||LA23_80=='+'||(LA23_80>='.' && LA23_80<='9')||LA23_80==';'||LA23_80=='='||LA23_80=='?'||(LA23_80>='A' && LA23_80<='Z')||(LA23_80>='^' && LA23_80<='z')||(LA23_80>='~' && LA23_80<='\uFFFF')) ) {s = 26;} - - else s = 83; - - if ( s>=0 ) return s; - break; - case 1 : - int LA23_43 = input.LA(1); - - s = -1; - if ( ((LA23_43>='\u0000' && LA23_43<='\b')||(LA23_43>='\u000B' && LA23_43<='\f')||(LA23_43>='\u000E' && LA23_43<='\u001F')||LA23_43=='!'||LA23_43=='$'||LA23_43=='&'||LA23_43=='+'||(LA23_43>='.' && LA23_43<='/')||LA23_43==';'||LA23_43=='='||LA23_43=='?'||(LA23_43>='A' && LA23_43<='D')||(LA23_43>='F' && LA23_43<='Z')||(LA23_43>='^' && LA23_43<='d')||(LA23_43>='f' && LA23_43<='z')||(LA23_43>='~' && LA23_43<='\uFFFF')) ) {s = 26;} - - else if ( (LA23_43=='E'||LA23_43=='e') ) {s = 53;} - - else if ( ((LA23_43>='0' && LA23_43<='9')) ) {s = 43;} - - else s = 41; - - if ( s>=0 ) return s; - break; - case 2 : - int LA23_79 = input.LA(1); - - s = -1; - if ( ((LA23_79>='\u0000' && LA23_79<='\b')||(LA23_79>='\u000B' && LA23_79<='\f')||(LA23_79>='\u000E' && LA23_79<='\u001F')||LA23_79=='!'||LA23_79=='$'||LA23_79=='&'||LA23_79=='+'||(LA23_79>='.' && LA23_79<='9')||LA23_79==';'||LA23_79=='='||LA23_79=='?'||(LA23_79>='A' && LA23_79<='Z')||(LA23_79>='^' && LA23_79<='z')||(LA23_79>='~' && LA23_79<='\uFFFF')) ) {s = 26;} - - else s = 82; + int _s = s; + switch (s) { + case 0: + int LA23_80 = input.LA(1); + + s = -1; + if (((LA23_80 >= '\u0000' && LA23_80 <= '\b') + || (LA23_80 >= '\u000B' && LA23_80 <= '\f') + || (LA23_80 >= '\u000E' && LA23_80 <= '\u001F') || LA23_80 == '!' + || LA23_80 == '$' || LA23_80 == '&' || LA23_80 == '+' + || (LA23_80 >= '.' && LA23_80 <= '9') || LA23_80 == ';' || LA23_80 == '=' + || LA23_80 == '?' || (LA23_80 >= 'A' && LA23_80 <= 'Z') + || (LA23_80 >= '^' && LA23_80 <= 'z') || (LA23_80 >= '~' && LA23_80 <= '\uFFFF'))) { + s = 26; + } - if ( s>=0 ) return s; - break; - case 3 : - int LA23_31 = input.LA(1); + else + s = 83; - s = -1; - if ( ((LA23_31>='0' && LA23_31<='9')) ) {s = 43;} + if (s >= 0) + return s; + break; + case 1: + int LA23_43 = input.LA(1); + + s = -1; + if (((LA23_43 >= '\u0000' && LA23_43 <= '\b') + || (LA23_43 >= '\u000B' && LA23_43 <= '\f') + || (LA23_43 >= '\u000E' && LA23_43 <= '\u001F') || LA23_43 == '!' + || LA23_43 == '$' || LA23_43 == '&' || LA23_43 == '+' + || (LA23_43 >= '.' && LA23_43 <= '/') || LA23_43 == ';' || LA23_43 == '=' + || LA23_43 == '?' || (LA23_43 >= 'A' && LA23_43 <= 'D') + || (LA23_43 >= 'F' && LA23_43 <= 'Z') || (LA23_43 >= '^' && LA23_43 <= 'd') + || (LA23_43 >= 'f' && LA23_43 <= 'z') || (LA23_43 >= '~' && LA23_43 <= '\uFFFF'))) { + s = 26; + } - else if ( ((LA23_31>='\u0000' && LA23_31<='\b')||(LA23_31>='\u000B' && LA23_31<='\f')||(LA23_31>='\u000E' && LA23_31<='\u001F')||LA23_31=='!'||LA23_31=='$'||LA23_31=='&'||LA23_31=='+'||LA23_31=='/'||LA23_31==';'||LA23_31=='='||LA23_31=='?'||(LA23_31>='A' && LA23_31<='Z')||(LA23_31>='^' && LA23_31<='z')||(LA23_31>='~' && LA23_31<='\uFFFF')) ) {s = 26;} + else if ((LA23_43 == 'E' || LA23_43 == 'e')) { + s = 53; + } - if ( s>=0 ) return s; - break; - case 4 : - int LA23_6 = input.LA(1); + else if (((LA23_43 >= '0' && LA23_43 <= '9'))) { + s = 43; + } - s = -1; - if ( (LA23_6=='.') ) {s = 31;} + else + s = 41; - else if ( (LA23_6=='E'||LA23_6=='e') ) {s = 32;} + if (s >= 0) + return s; + break; + case 2: + int LA23_79 = input.LA(1); + + s = -1; + if (((LA23_79 >= '\u0000' && LA23_79 <= '\b') + || (LA23_79 >= '\u000B' && LA23_79 <= '\f') + || (LA23_79 >= '\u000E' && LA23_79 <= '\u001F') || LA23_79 == '!' + || LA23_79 == '$' || LA23_79 == '&' || LA23_79 == '+' + || (LA23_79 >= '.' && LA23_79 <= '9') || LA23_79 == ';' || LA23_79 == '=' + || LA23_79 == '?' || (LA23_79 >= 'A' && LA23_79 <= 'Z') + || (LA23_79 >= '^' && LA23_79 <= 'z') || (LA23_79 >= '~' && LA23_79 <= '\uFFFF'))) { + s = 26; + } - else if ( ((LA23_6>='\u0000' && LA23_6<='\b')||(LA23_6>='\u000B' && LA23_6<='\f')||(LA23_6>='\u000E' && LA23_6<='\u001F')||LA23_6=='!'||LA23_6=='$'||LA23_6=='&'||LA23_6=='+'||(LA23_6>='/' && LA23_6<='9')||LA23_6==';'||LA23_6=='='||LA23_6=='?'||(LA23_6>='A' && LA23_6<='D')||(LA23_6>='F' && LA23_6<='Z')||(LA23_6>='^' && LA23_6<='d')||(LA23_6>='f' && LA23_6<='z')||(LA23_6>='~' && LA23_6<='\uFFFF')) ) {s = 26;} + else + s = 82; - else s = 30; + if (s >= 0) + return s; + break; + case 3: + int LA23_31 = input.LA(1); - if ( s>=0 ) return s; - break; - case 5 : - int LA23_62 = input.LA(1); + s = -1; + if (((LA23_31 >= '0' && LA23_31 <= '9'))) { + s = 43; + } - s = -1; - if ( ((LA23_62>='\u0000' && LA23_62<='\b')||(LA23_62>='\u000B' && LA23_62<='\f')||(LA23_62>='\u000E' && LA23_62<='\u001F')||LA23_62=='!'||LA23_62=='$'||LA23_62=='&'||LA23_62=='+'||(LA23_62>='.' && LA23_62<='/')||LA23_62==';'||LA23_62=='='||LA23_62=='?'||(LA23_62>='A' && LA23_62<='Z')||(LA23_62>='^' && LA23_62<='z')||(LA23_62>='~' && LA23_62<='\uFFFF')) ) {s = 26;} + else if (((LA23_31 >= '\u0000' && LA23_31 <= '\b') + || (LA23_31 >= '\u000B' && LA23_31 <= '\f') + || (LA23_31 >= '\u000E' && LA23_31 <= '\u001F') || LA23_31 == '!' + || LA23_31 == '$' || LA23_31 == '&' || LA23_31 == '+' || LA23_31 == '/' + || LA23_31 == ';' || LA23_31 == '=' || LA23_31 == '?' + || (LA23_31 >= 'A' && LA23_31 <= 'Z') || (LA23_31 >= '^' && LA23_31 <= 'z') || (LA23_31 >= '~' && LA23_31 <= '\uFFFF'))) { + s = 26; + } - else if ( ((LA23_62>='0' && LA23_62<='9')) ) {s = 62;} + if (s >= 0) + return s; + break; + case 4: + int LA23_6 = input.LA(1); - else s = 41; + s = -1; + if ((LA23_6 == '.')) { + s = 31; + } - if ( s>=0 ) return s; - break; - case 6 : - int LA23_65 = input.LA(1); + else if ((LA23_6 == 'E' || LA23_6 == 'e')) { + s = 32; + } - s = -1; - if ( ((LA23_65>='\u0000' && LA23_65<='\b')||(LA23_65>='\u000B' && LA23_65<='\f')||(LA23_65>='\u000E' && LA23_65<='\u001F')||LA23_65=='!'||LA23_65=='$'||LA23_65=='&'||LA23_65=='+'||(LA23_65>='.' && LA23_65<='9')||LA23_65==';'||LA23_65=='='||LA23_65=='?'||(LA23_65>='A' && LA23_65<='Z')||(LA23_65>='^' && LA23_65<='z')||(LA23_65>='~' && LA23_65<='\uFFFF')) ) {s = 26;} + else if (((LA23_6 >= '\u0000' && LA23_6 <= '\b') + || (LA23_6 >= '\u000B' && LA23_6 <= '\f') + || (LA23_6 >= '\u000E' && LA23_6 <= '\u001F') || LA23_6 == '!' + || LA23_6 == '$' || LA23_6 == '&' || LA23_6 == '+' + || (LA23_6 >= '/' && LA23_6 <= '9') || LA23_6 == ';' || LA23_6 == '=' + || LA23_6 == '?' || (LA23_6 >= 'A' && LA23_6 <= 'D') + || (LA23_6 >= 'F' && LA23_6 <= 'Z') || (LA23_6 >= '^' && LA23_6 <= 'd') + || (LA23_6 >= 'f' && LA23_6 <= 'z') || (LA23_6 >= '~' && LA23_6 <= '\uFFFF'))) { + s = 26; + } - else s = 71; + else + s = 30; - if ( s>=0 ) return s; - break; - case 7 : - int LA23_0 = input.LA(1); + if (s >= 0) + return s; + break; + case 5: + int LA23_62 = input.LA(1); + + s = -1; + if (((LA23_62 >= '\u0000' && LA23_62 <= '\b') + || (LA23_62 >= '\u000B' && LA23_62 <= '\f') + || (LA23_62 >= '\u000E' && LA23_62 <= '\u001F') || LA23_62 == '!' + || LA23_62 == '$' || LA23_62 == '&' || LA23_62 == '+' + || (LA23_62 >= '.' && LA23_62 <= '/') || LA23_62 == ';' || LA23_62 == '=' + || LA23_62 == '?' || (LA23_62 >= 'A' && LA23_62 <= 'Z') + || (LA23_62 >= '^' && LA23_62 <= 'z') || (LA23_62 >= '~' && LA23_62 <= '\uFFFF'))) { + s = 26; + } - - int index23_0 = input.index(); - input.rewind(); - s = -1; - if ( (LA23_0=='%') && (( getCharPositionInLine() == 0 ))) {s = 1;} + else if (((LA23_62 >= '0' && LA23_62 <= '9'))) { + s = 62; + } - else if ( (LA23_0=='#') ) {s = 2;} + else + s = 41; - else if ( (LA23_0=='\n'||LA23_0=='\r') ) {s = 3;} + if (s >= 0) + return s; + break; + case 6: + int LA23_65 = input.LA(1); + + s = -1; + if (((LA23_65 >= '\u0000' && LA23_65 <= '\b') + || (LA23_65 >= '\u000B' && LA23_65 <= '\f') + || (LA23_65 >= '\u000E' && LA23_65 <= '\u001F') || LA23_65 == '!' + || LA23_65 == '$' || LA23_65 == '&' || LA23_65 == '+' + || (LA23_65 >= '.' && LA23_65 <= '9') || LA23_65 == ';' || LA23_65 == '=' + || LA23_65 == '?' || (LA23_65 >= 'A' && LA23_65 <= 'Z') + || (LA23_65 >= '^' && LA23_65 <= 'z') || (LA23_65 >= '~' && LA23_65 <= '\uFFFF'))) { + s = 26; + } - else if ( (LA23_0=='\"') ) {s = 4;} + else + s = 71; - else if ( (LA23_0=='-') ) {s = 5;} + if (s >= 0) + return s; + break; + case 7: + int LA23_0 = input.LA(1); + + int index23_0 = input.index(); + input.rewind(); + s = -1; + if ((LA23_0 == '%') && ((getCharPositionInLine() == 0))) { + s = 1; + } - else if ( (LA23_0=='0') ) {s = 6;} + else if ((LA23_0 == '#')) { + s = 2; + } - else if ( ((LA23_0>='1' && LA23_0<='9')) ) {s = 7;} + else if ((LA23_0 == '\n' || LA23_0 == '\r')) { + s = 3; + } - else if ( (LA23_0=='{') ) {s = 8;} + else if ((LA23_0 == '\"')) { + s = 4; + } - else if ( (LA23_0=='}') ) {s = 9;} + else if ((LA23_0 == '-')) { + s = 5; + } - else if ( (LA23_0=='[') ) {s = 10;} + else if ((LA23_0 == '0')) { + s = 6; + } - else if ( (LA23_0==']') ) {s = 11;} + else if (((LA23_0 >= '1' && LA23_0 <= '9'))) { + s = 7; + } - else if ( (LA23_0=='<') ) {s = 12;} + else if ((LA23_0 == '{')) { + s = 8; + } - else if ( (LA23_0=='=') ) {s = 13;} + else if ((LA23_0 == '}')) { + s = 9; + } - else if ( (LA23_0=='.') ) {s = 14;} + else if ((LA23_0 == '[')) { + s = 10; + } - else if ( (LA23_0==',') ) {s = 15;} + else if ((LA23_0 == ']')) { + s = 11; + } - else if ( (LA23_0=='(') ) {s = 16;} + else if ((LA23_0 == '<')) { + s = 12; + } - else if ( (LA23_0==')') ) {s = 17;} + else if ((LA23_0 == '=')) { + s = 13; + } - else if ( (LA23_0=='*') ) {s = 18;} + else if ((LA23_0 == '.')) { + s = 14; + } - else if ( (LA23_0==':') ) {s = 19;} + else if ((LA23_0 == ',')) { + s = 15; + } - else if ( (LA23_0=='c') ) {s = 20;} + else if ((LA23_0 == '(')) { + s = 16; + } - else if ( (LA23_0=='i') ) {s = 21;} + else if ((LA23_0 == ')')) { + s = 17; + } - else if ( (LA23_0=='e') ) {s = 22;} + else if ((LA23_0 == '*')) { + s = 18; + } - else if ( (LA23_0=='r') ) {s = 23;} + else if ((LA23_0 == ':')) { + s = 19; + } - else if ( (LA23_0=='b') ) {s = 24;} + else if ((LA23_0 == 'c')) { + s = 20; + } - else if ( (LA23_0=='m') ) {s = 25;} + else if ((LA23_0 == 'i')) { + s = 21; + } - else if ( ((LA23_0>='\u0000' && LA23_0<='\b')||(LA23_0>='\u000B' && LA23_0<='\f')||(LA23_0>='\u000E' && LA23_0<='\u001F')||LA23_0=='!'||LA23_0=='$'||LA23_0=='&'||LA23_0=='+'||LA23_0=='/'||LA23_0==';'||LA23_0=='?'||(LA23_0>='A' && LA23_0<='Z')||(LA23_0>='^' && LA23_0<='a')||LA23_0=='d'||(LA23_0>='f' && LA23_0<='h')||(LA23_0>='j' && LA23_0<='l')||(LA23_0>='n' && LA23_0<='q')||(LA23_0>='s' && LA23_0<='z')||(LA23_0>='~' && LA23_0<='\uFFFF')) ) {s = 26;} + else if ((LA23_0 == 'e')) { + s = 22; + } - else if ( (LA23_0=='\t'||LA23_0==' ') ) {s = 27;} + else if ((LA23_0 == 'r')) { + s = 23; + } - - input.seek(index23_0); - if ( s>=0 ) return s; - break; - case 8 : - int LA23_33 = input.LA(1); + else if ((LA23_0 == 'b')) { + s = 24; + } - s = -1; - if ( (LA23_33=='.') ) {s = 31;} + else if ((LA23_0 == 'm')) { + s = 25; + } - else if ( (LA23_33=='E'||LA23_33=='e') ) {s = 32;} + else if (((LA23_0 >= '\u0000' && LA23_0 <= '\b') + || (LA23_0 >= '\u000B' && LA23_0 <= '\f') + || (LA23_0 >= '\u000E' && LA23_0 <= '\u001F') || LA23_0 == '!' + || LA23_0 == '$' || LA23_0 == '&' || LA23_0 == '+' || LA23_0 == '/' + || LA23_0 == ';' || LA23_0 == '?' || (LA23_0 >= 'A' && LA23_0 <= 'Z') + || (LA23_0 >= '^' && LA23_0 <= 'a') || LA23_0 == 'd' + || (LA23_0 >= 'f' && LA23_0 <= 'h') || (LA23_0 >= 'j' && LA23_0 <= 'l') + || (LA23_0 >= 'n' && LA23_0 <= 'q') || (LA23_0 >= 's' && LA23_0 <= 'z') || (LA23_0 >= '~' && LA23_0 <= '\uFFFF'))) { + s = 26; + } - else if ( ((LA23_33>='0' && LA23_33<='9')) ) {s = 33;} + else if ((LA23_0 == '\t' || LA23_0 == ' ')) { + s = 27; + } - else if ( ((LA23_33>='\u0000' && LA23_33<='\b')||(LA23_33>='\u000B' && LA23_33<='\f')||(LA23_33>='\u000E' && LA23_33<='\u001F')||LA23_33=='!'||LA23_33=='$'||LA23_33=='&'||LA23_33=='+'||LA23_33=='/'||LA23_33==';'||LA23_33=='='||LA23_33=='?'||(LA23_33>='A' && LA23_33<='D')||(LA23_33>='F' && LA23_33<='Z')||(LA23_33>='^' && LA23_33<='d')||(LA23_33>='f' && LA23_33<='z')||(LA23_33>='~' && LA23_33<='\uFFFF')) ) {s = 26;} + input.seek(index23_0); + if (s >= 0) + return s; + break; + case 8: + int LA23_33 = input.LA(1); - else s = 30; + s = -1; + if ((LA23_33 == '.')) { + s = 31; + } - if ( s>=0 ) return s; - break; - case 9 : - int LA23_45 = input.LA(1); + else if ((LA23_33 == 'E' || LA23_33 == 'e')) { + s = 32; + } - s = -1; - if ( ((LA23_45>='0' && LA23_45<='9')) ) {s = 45;} + else if (((LA23_33 >= '0' && LA23_33 <= '9'))) { + s = 33; + } - else if ( ((LA23_45>='\u0000' && LA23_45<='\b')||(LA23_45>='\u000B' && LA23_45<='\f')||(LA23_45>='\u000E' && LA23_45<='\u001F')||LA23_45=='!'||LA23_45=='$'||LA23_45=='&'||LA23_45=='+'||(LA23_45>='.' && LA23_45<='/')||LA23_45==';'||LA23_45=='='||LA23_45=='?'||(LA23_45>='A' && LA23_45<='Z')||(LA23_45>='^' && LA23_45<='z')||(LA23_45>='~' && LA23_45<='\uFFFF')) ) {s = 26;} + else if (((LA23_33 >= '\u0000' && LA23_33 <= '\b') + || (LA23_33 >= '\u000B' && LA23_33 <= '\f') + || (LA23_33 >= '\u000E' && LA23_33 <= '\u001F') || LA23_33 == '!' + || LA23_33 == '$' || LA23_33 == '&' || LA23_33 == '+' || LA23_33 == '/' + || LA23_33 == ';' || LA23_33 == '=' || LA23_33 == '?' + || (LA23_33 >= 'A' && LA23_33 <= 'D') || (LA23_33 >= 'F' && LA23_33 <= 'Z') + || (LA23_33 >= '^' && LA23_33 <= 'd') || (LA23_33 >= 'f' && LA23_33 <= 'z') || (LA23_33 >= '~' && LA23_33 <= '\uFFFF'))) { + s = 26; + } - else s = 41; + else + s = 30; - if ( s>=0 ) return s; - break; - case 10 : - int LA23_13 = input.LA(1); + if (s >= 0) + return s; + break; + case 9: + int LA23_45 = input.LA(1); - s = -1; - if ( ((LA23_13>='\u0000' && LA23_13<='\b')||(LA23_13>='\u000B' && LA23_13<='\f')||(LA23_13>='\u000E' && LA23_13<='\u001F')||LA23_13=='!'||LA23_13=='$'||LA23_13=='&'||LA23_13=='+'||(LA23_13>='.' && LA23_13<='9')||LA23_13==';'||LA23_13=='='||LA23_13=='?'||(LA23_13>='A' && LA23_13<='Z')||(LA23_13>='^' && LA23_13<='z')||(LA23_13>='~' && LA23_13<='\uFFFF')) ) {s = 26;} + s = -1; + if (((LA23_45 >= '0' && LA23_45 <= '9'))) { + s = 45; + } - else s = 34; + else if (((LA23_45 >= '\u0000' && LA23_45 <= '\b') + || (LA23_45 >= '\u000B' && LA23_45 <= '\f') + || (LA23_45 >= '\u000E' && LA23_45 <= '\u001F') || LA23_45 == '!' + || LA23_45 == '$' || LA23_45 == '&' || LA23_45 == '+' + || (LA23_45 >= '.' && LA23_45 <= '/') || LA23_45 == ';' || LA23_45 == '=' + || LA23_45 == '?' || (LA23_45 >= 'A' && LA23_45 <= 'Z') + || (LA23_45 >= '^' && LA23_45 <= 'z') || (LA23_45 >= '~' && LA23_45 <= '\uFFFF'))) { + s = 26; + } - if ( s>=0 ) return s; - break; - case 11 : - int LA23_63 = input.LA(1); + else + s = 41; - s = -1; - if ( ((LA23_63>='\u0000' && LA23_63<='\b')||(LA23_63>='\u000B' && LA23_63<='\f')||(LA23_63>='\u000E' && LA23_63<='\u001F')||LA23_63=='!'||LA23_63=='$'||LA23_63=='&'||LA23_63=='+'||(LA23_63>='.' && LA23_63<='9')||LA23_63==';'||LA23_63=='='||LA23_63=='?'||(LA23_63>='A' && LA23_63<='Z')||(LA23_63>='^' && LA23_63<='z')||(LA23_63>='~' && LA23_63<='\uFFFF')) ) {s = 26;} + if (s >= 0) + return s; + break; + case 10: + int LA23_13 = input.LA(1); + + s = -1; + if (((LA23_13 >= '\u0000' && LA23_13 <= '\b') + || (LA23_13 >= '\u000B' && LA23_13 <= '\f') + || (LA23_13 >= '\u000E' && LA23_13 <= '\u001F') || LA23_13 == '!' + || LA23_13 == '$' || LA23_13 == '&' || LA23_13 == '+' + || (LA23_13 >= '.' && LA23_13 <= '9') || LA23_13 == ';' || LA23_13 == '=' + || LA23_13 == '?' || (LA23_13 >= 'A' && LA23_13 <= 'Z') + || (LA23_13 >= '^' && LA23_13 <= 'z') || (LA23_13 >= '~' && LA23_13 <= '\uFFFF'))) { + s = 26; + } - else s = 69; + else + s = 34; - if ( s>=0 ) return s; - break; - case 12 : - int LA23_7 = input.LA(1); + if (s >= 0) + return s; + break; + case 11: + int LA23_63 = input.LA(1); + + s = -1; + if (((LA23_63 >= '\u0000' && LA23_63 <= '\b') + || (LA23_63 >= '\u000B' && LA23_63 <= '\f') + || (LA23_63 >= '\u000E' && LA23_63 <= '\u001F') || LA23_63 == '!' + || LA23_63 == '$' || LA23_63 == '&' || LA23_63 == '+' + || (LA23_63 >= '.' && LA23_63 <= '9') || LA23_63 == ';' || LA23_63 == '=' + || LA23_63 == '?' || (LA23_63 >= 'A' && LA23_63 <= 'Z') + || (LA23_63 >= '^' && LA23_63 <= 'z') || (LA23_63 >= '~' && LA23_63 <= '\uFFFF'))) { + s = 26; + } - s = -1; - if ( ((LA23_7>='0' && LA23_7<='9')) ) {s = 33;} + else + s = 69; - else if ( (LA23_7=='.') ) {s = 31;} + if (s >= 0) + return s; + break; + case 12: + int LA23_7 = input.LA(1); - else if ( (LA23_7=='E'||LA23_7=='e') ) {s = 32;} + s = -1; + if (((LA23_7 >= '0' && LA23_7 <= '9'))) { + s = 33; + } - else if ( ((LA23_7>='\u0000' && LA23_7<='\b')||(LA23_7>='\u000B' && LA23_7<='\f')||(LA23_7>='\u000E' && LA23_7<='\u001F')||LA23_7=='!'||LA23_7=='$'||LA23_7=='&'||LA23_7=='+'||LA23_7=='/'||LA23_7==';'||LA23_7=='='||LA23_7=='?'||(LA23_7>='A' && LA23_7<='D')||(LA23_7>='F' && LA23_7<='Z')||(LA23_7>='^' && LA23_7<='d')||(LA23_7>='f' && LA23_7<='z')||(LA23_7>='~' && LA23_7<='\uFFFF')) ) {s = 26;} + else if ((LA23_7 == '.')) { + s = 31; + } - else s = 30; + else if ((LA23_7 == 'E' || LA23_7 == 'e')) { + s = 32; + } - if ( s>=0 ) return s; - break; - case 13 : - int LA23_49 = input.LA(1); + else if (((LA23_7 >= '\u0000' && LA23_7 <= '\b') + || (LA23_7 >= '\u000B' && LA23_7 <= '\f') + || (LA23_7 >= '\u000E' && LA23_7 <= '\u001F') || LA23_7 == '!' + || LA23_7 == '$' || LA23_7 == '&' || LA23_7 == '+' || LA23_7 == '/' + || LA23_7 == ';' || LA23_7 == '=' || LA23_7 == '?' + || (LA23_7 >= 'A' && LA23_7 <= 'D') || (LA23_7 >= 'F' && LA23_7 <= 'Z') + || (LA23_7 >= '^' && LA23_7 <= 'd') || (LA23_7 >= 'f' && LA23_7 <= 'z') || (LA23_7 >= '~' && LA23_7 <= '\uFFFF'))) { + s = 26; + } - s = -1; - if ( ((LA23_49>='\u0000' && LA23_49<='\b')||(LA23_49>='\u000B' && LA23_49<='\f')||(LA23_49>='\u000E' && LA23_49<='\u001F')||LA23_49=='!'||LA23_49=='$'||LA23_49=='&'||LA23_49=='+'||(LA23_49>='.' && LA23_49<='9')||LA23_49==';'||LA23_49=='='||LA23_49=='?'||(LA23_49>='A' && LA23_49<='Z')||(LA23_49>='^' && LA23_49<='z')||(LA23_49>='~' && LA23_49<='\uFFFF')) ) {s = 26;} + else + s = 30; - else s = 57; + if (s >= 0) + return s; + break; + case 13: + int LA23_49 = input.LA(1); + + s = -1; + if (((LA23_49 >= '\u0000' && LA23_49 <= '\b') + || (LA23_49 >= '\u000B' && LA23_49 <= '\f') + || (LA23_49 >= '\u000E' && LA23_49 <= '\u001F') || LA23_49 == '!' + || LA23_49 == '$' || LA23_49 == '&' || LA23_49 == '+' + || (LA23_49 >= '.' && LA23_49 <= '9') || LA23_49 == ';' || LA23_49 == '=' + || LA23_49 == '?' || (LA23_49 >= 'A' && LA23_49 <= 'Z') + || (LA23_49 >= '^' && LA23_49 <= 'z') || (LA23_49 >= '~' && LA23_49 <= '\uFFFF'))) { + s = 26; + } - if ( s>=0 ) return s; - break; - case 14 : - int LA23_85 = input.LA(1); + else + s = 57; - s = -1; - if ( ((LA23_85>='\u0000' && LA23_85<='\b')||(LA23_85>='\u000B' && LA23_85<='\f')||(LA23_85>='\u000E' && LA23_85<='\u001F')||LA23_85=='!'||LA23_85=='$'||LA23_85=='&'||LA23_85=='+'||(LA23_85>='.' && LA23_85<='9')||LA23_85==';'||LA23_85=='='||LA23_85=='?'||(LA23_85>='A' && LA23_85<='Z')||(LA23_85>='^' && LA23_85<='z')||(LA23_85>='~' && LA23_85<='\uFFFF')) ) {s = 26;} + if (s >= 0) + return s; + break; + case 14: + int LA23_85 = input.LA(1); + + s = -1; + if (((LA23_85 >= '\u0000' && LA23_85 <= '\b') + || (LA23_85 >= '\u000B' && LA23_85 <= '\f') + || (LA23_85 >= '\u000E' && LA23_85 <= '\u001F') || LA23_85 == '!' + || LA23_85 == '$' || LA23_85 == '&' || LA23_85 == '+' + || (LA23_85 >= '.' && LA23_85 <= '9') || LA23_85 == ';' || LA23_85 == '=' + || LA23_85 == '?' || (LA23_85 >= 'A' && LA23_85 <= 'Z') + || (LA23_85 >= '^' && LA23_85 <= 'z') || (LA23_85 >= '~' && LA23_85 <= '\uFFFF'))) { + s = 26; + } - else s = 86; + else + s = 86; - if ( s>=0 ) return s; - break; + if (s >= 0) + return s; + break; + } + if (state.backtracking > 0) { + state.failed = true; + return -1; } - if (state.backtracking>0) {state.failed=true; return -1;} - NoViableAltException nvae = - new NoViableAltException(getDescription(), 23, _s, input); + NoViableAltException nvae = new NoViableAltException(getDescription(), 23, _s, input); error(nvae); throw nvae; } } - } \ No newline at end of file diff --git a/src/main/java/org/xerial/util/bean/BeanUpdator.java b/src/main/java/org/xerial/util/bean/BeanUpdator.java index cc2575d..3bce896 100644 --- a/src/main/java/org/xerial/util/bean/BeanUpdator.java +++ b/src/main/java/org/xerial/util/bean/BeanUpdator.java @@ -26,11 +26,10 @@ package org.xerial.util.bean; import java.lang.reflect.Method; -public interface BeanUpdator -{ +public interface BeanUpdator { public BeanUpdatorType getType(); - public Class getInputType(); + public Class< ? > getInputType(); public Method getMethod(); } diff --git a/src/main/java/org/xerial/util/bean/impl/Appender.java b/src/main/java/org/xerial/util/bean/impl/Appender.java index 32307d4..64a3b74 100644 --- a/src/main/java/org/xerial/util/bean/impl/Appender.java +++ b/src/main/java/org/xerial/util/bean/impl/Appender.java @@ -36,23 +36,19 @@ import org.xerial.util.bean.BeanUpdatorType; * @author leo * */ -public class Appender extends BeanBinderBase implements BeanUpdator -{ +public class Appender extends BeanBinderBase implements BeanUpdator { private final Class< ? > inputType; - public Appender(Class< ? > inputType, Method appender, String parameterName) - { + public Appender(Class< ? > inputType, Method appender, String parameterName) { super(appender, parameterName); this.inputType = inputType; } - public Class getInputType() - { + public Class< ? > getInputType() { return inputType; } - public BeanUpdatorType getType() - { + public BeanUpdatorType getType() { return BeanUpdatorType.APPENDER; } diff --git a/src/main/java/org/xerial/util/bean/impl/ArraySetter.java b/src/main/java/org/xerial/util/bean/impl/ArraySetter.java index e84c892..a85bb74 100644 --- a/src/main/java/org/xerial/util/bean/impl/ArraySetter.java +++ b/src/main/java/org/xerial/util/bean/impl/ArraySetter.java @@ -24,20 +24,14 @@ //-------------------------------------- package org.xerial.util.bean.impl; -import java.lang.reflect.Array; import java.lang.reflect.Method; -import org.xerial.json.JSONArray; -import org.xerial.util.bean.BeanException; -import org.xerial.util.bean.BeanUtil; - public class ArraySetter extends BeanBinderBase { - Class componentType; + Class< ? > componentType; - public ArraySetter(Method method, String parameterName, Class componentType) { + public ArraySetter(Method method, String parameterName, Class< ? > componentType) { super(method, parameterName); this.componentType = componentType; } - } \ No newline at end of file diff --git a/src/main/java/org/xerial/util/bean/impl/BeanUtilImpl.java b/src/main/java/org/xerial/util/bean/impl/BeanUtilImpl.java index 5be3cda..716877b 100644 --- a/src/main/java/org/xerial/util/bean/impl/BeanUtilImpl.java +++ b/src/main/java/org/xerial/util/bean/impl/BeanUtilImpl.java @@ -45,8 +45,7 @@ import org.xerial.util.xml.XMLTreeWalker; * @author leo * */ -public class BeanUtilImpl -{ +public class BeanUtilImpl { /** * Create a bean of the specified type from the tree walker input * @@ -66,8 +65,8 @@ public class BeanUtilImpl * @return * @throws XerialException */ - protected static E createTypedBean(TreeWalker treeWalker, Class beanType) throws XerialException - { + protected static E createTypedBean(TreeWalker treeWalker, Class beanType) + throws XerialException { return beanType.cast(createBean(treeWalker, new BeanBindingProcess(beanType))); //return new ObjectMapper().map(beanType, treeWalker); } @@ -81,83 +80,76 @@ public class BeanUtilImpl * @throws XerialException */ @SuppressWarnings("unchecked") - protected static E createBean(TreeWalker treeWalker, E bean) throws XerialException - { + protected static E createBean(TreeWalker treeWalker, E bean) throws XerialException { return (E) createBean(treeWalker, new BeanBindingProcess(bean)); //return new ObjectMapper().map(bean, treeWalker); } protected static Object createBean(TreeWalker treeWalker, BeanBindingProcess beanBindingVisitor) - throws XerialException - { + throws XerialException { treeWalker.walk(beanBindingVisitor); return beanBindingVisitor.getResultBean(); } // Silk Stream - public static E createBeanFromSilk(Class beanType, URL silkFileAddress) throws XerialException, IOException - { + public static E createBeanFromSilk(Class beanType, URL silkFileAddress) + throws XerialException, IOException { return createTypedBean(new SilkWalker(silkFileAddress), beanType); } - @SuppressWarnings("unchecked") - public static E populateBeanWithSilk(E bean, URL silkFileAddress) throws XerialException, IOException - { + public static E populateBeanWithSilk(E bean, URL silkFileAddress) throws XerialException, + IOException { return (E) createBean(new SilkWalker(silkFileAddress), bean); } // XML Stream - public static E createBeanFromXML(Class beanType, Reader xmlReader) throws XerialException - { + public static E createBeanFromXML(Class beanType, Reader xmlReader) + throws XerialException { return createTypedBean(new XMLTreeWalker(xmlReader), beanType); } - public static Object populateBeanWithXML(Object bean, Reader xmlReader) throws XerialException - { + public static Object populateBeanWithXML(Object bean, Reader xmlReader) throws XerialException { return createBean(new XMLTreeWalker(xmlReader), bean); } // XML DOM - public static E createBeanFromXML(Class beanType, Element xmlElement) throws XerialException - { + public static E createBeanFromXML(Class beanType, Element xmlElement) + throws XerialException { return createTypedBean(new XMLTreeWalker(xmlElement), beanType); } - public static Object populateBeanWithXML(Object bean, Element xmlElement) throws XerialException - { + public static Object populateBeanWithXML(Object bean, Element xmlElement) + throws XerialException { return createBean(new XMLTreeWalker(xmlElement), new BeanBindingProcess(bean)); } // ANTLR ParseTree - public static E createBeanFromParseTree(Class beanType, Tree parseTree, final String[] parserTokenNames) - throws XerialException - { + public static E createBeanFromParseTree(Class beanType, Tree parseTree, + final String[] parserTokenNames) throws XerialException { return createTypedBean(new ANTLRWalker(parserTokenNames, parseTree), beanType); } - public static E populateBeanWithParseTree(E bean, Tree parseTree, final String[] parserTokenNames) - throws XerialException - { + public static E populateBeanWithParseTree(E bean, Tree parseTree, + final String[] parserTokenNames) throws XerialException { return createBean(new ANTLRWalker(parserTokenNames, parseTree), bean); } - public static E createBeanFromJSON(Class beanType, Reader jsonReader) throws IOException, XerialException - { + public static E createBeanFromJSON(Class beanType, Reader jsonReader) + throws IOException, XerialException { return createTypedBean(new JSONStreamWalker(jsonReader), beanType); } - public static Object populateBeanWithJSON(Object bean, Reader jsonReader) throws IOException, XerialException - { + public static Object populateBeanWithJSON(Object bean, Reader jsonReader) throws IOException, + XerialException { return createBean(new JSONStreamWalker(jsonReader), bean); } - public static E createBeanFromMap(Class beanType, Map< ? , ? > map) throws XerialException - { + public static E createBeanFromMap(Class beanType, Map< ? , ? > map) + throws XerialException { return createTypedBean(new MapWalker(map), beanType); } - public static Object populateBeanWithMap(Object bean, Map< ? , ? > map) throws XerialException - { + public static Object populateBeanWithMap(Object bean, Map< ? , ? > map) throws XerialException { return createBean(new MapWalker(map), bean); } diff --git a/src/main/java/org/xerial/util/bean/impl/CollectionAdder.java b/src/main/java/org/xerial/util/bean/impl/CollectionAdder.java index 08f2355..e3be3e6 100644 --- a/src/main/java/org/xerial/util/bean/impl/CollectionAdder.java +++ b/src/main/java/org/xerial/util/bean/impl/CollectionAdder.java @@ -26,32 +26,26 @@ package org.xerial.util.bean.impl; import java.lang.reflect.Method; -import org.xerial.json.JSONArray; import org.xerial.util.bean.BeanException; import org.xerial.util.bean.BeanUpdator; import org.xerial.util.bean.BeanUpdatorType; -import org.xerial.util.bean.BeanUtil; -public class CollectionAdder extends BeanBinderBase implements BeanUpdator -{ - Class elementType; +public class CollectionAdder extends BeanBinderBase implements BeanUpdator { + Class< ? > elementType; - public CollectionAdder(Method method, String parameterName, Class elementType) throws BeanException - { + public CollectionAdder(Method method, String parameterName, Class< ? > elementType) + throws BeanException { super(method, parameterName); this.elementType = elementType; constractableTest(elementType); } - - public Class getInputType() - { + public Class< ? > getInputType() { return elementType; } - public BeanUpdatorType getType() - { + public BeanUpdatorType getType() { return BeanUpdatorType.COLLECTION_ADDER; } diff --git a/src/main/java/org/xerial/util/bean/impl/CollectionSetter.java b/src/main/java/org/xerial/util/bean/impl/CollectionSetter.java index 6e05083..52777bd 100644 --- a/src/main/java/org/xerial/util/bean/impl/CollectionSetter.java +++ b/src/main/java/org/xerial/util/bean/impl/CollectionSetter.java @@ -25,20 +25,17 @@ package org.xerial.util.bean.impl; import java.lang.reflect.Method; -import java.util.Collection; -import org.xerial.json.JSONArray; import org.xerial.util.bean.BeanException; -import org.xerial.util.bean.BeanUtil; import org.xerial.util.bean.TypeInfo; - public class CollectionSetter extends BeanBinderBase { - Class collectionType; + Class< ? > collectionType; - Class elementType; + Class< ? > elementType; - public CollectionSetter(Method method, String parameterName, Class collectionType, Class elementType) throws BeanException { + public CollectionSetter(Method method, String parameterName, Class< ? > collectionType, + Class< ? > elementType) throws BeanException { super(method, parameterName); this.collectionType = collectionType; this.elementType = elementType; @@ -49,6 +46,4 @@ public class CollectionSetter extends BeanBinderBase { assert (TypeInfo.isCollection(collectionType)); } - - } diff --git a/src/main/java/org/xerial/util/bean/impl/KeyValuePair.java b/src/main/java/org/xerial/util/bean/impl/KeyValuePair.java index 3509c05..9c7f045 100644 --- a/src/main/java/org/xerial/util/bean/impl/KeyValuePair.java +++ b/src/main/java/org/xerial/util/bean/impl/KeyValuePair.java @@ -32,75 +32,63 @@ import java.lang.reflect.Method; * @author leo * */ -public class KeyValuePair -{ +public class KeyValuePair { public final MapPutter mapPutter; private Object key = null; private Object value = null; - private final Class keyClass; - private final Class valueClass; + private final Class< ? > keyClass; + private final Class< ? > valueClass; private int setterCount = 0; - public KeyValuePair(MapPutter mapPutter) - { + public KeyValuePair(MapPutter mapPutter) { this.mapPutter = mapPutter; this.keyClass = mapPutter.getKeyType(); this.valueClass = mapPutter.getValueType(); } - public KeyValuePair(MapPutter mapPutter, Class keyType, Class valueType) - { + public KeyValuePair(MapPutter mapPutter, Class< ? > keyType, Class< ? > valueType) { this.mapPutter = mapPutter; this.keyClass = keyType; this.valueClass = valueType; } @Override - public String toString() - { + public String toString() { return String.format("%s=>%s", key, value); } - public boolean hasKeyAndValue() - { + public boolean hasKeyAndValue() { return key != null && value != null; } - public Class keyType() - { + public Class< ? > keyType() { return keyClass; } - public Class valueType() - { + public Class< ? > valueType() { return valueClass; } - public Method putter() - { + public Method putter() { return mapPutter.getMethod(); } - public Object getKey() - { + public Object getKey() { return key; } - public void setKey(Object key) - { + public void setKey(Object key) { this.key = key; } - public Object getValue() - { + public Object getValue() { return value; } - public void setValue(Object value) - { + public void setValue(Object value) { this.value = value; } diff --git a/src/main/java/org/xerial/util/bean/impl/MapPutter.java b/src/main/java/org/xerial/util/bean/impl/MapPutter.java index 4ec5994..cd40784 100644 --- a/src/main/java/org/xerial/util/bean/impl/MapPutter.java +++ b/src/main/java/org/xerial/util/bean/impl/MapPutter.java @@ -26,20 +26,17 @@ package org.xerial.util.bean.impl; import java.lang.reflect.Method; -import org.xerial.json.JSONArray; import org.xerial.util.bean.BeanException; import org.xerial.util.bean.BeanUpdator; import org.xerial.util.bean.BeanUpdatorType; -import org.xerial.util.bean.BeanUtil; -public class MapPutter extends BeanBinderBase implements BeanUpdator -{ - Class keyType; +public class MapPutter extends BeanBinderBase implements BeanUpdator { + Class< ? > keyType; - Class valueType; + Class< ? > valueType; - public MapPutter(Method method, String parameterName, Class keyType, Class valueType) throws BeanException - { + public MapPutter(Method method, String parameterName, Class< ? > keyType, Class< ? > valueType) + throws BeanException { super(method, parameterName); this.keyType = keyType; this.valueType = valueType; @@ -48,38 +45,21 @@ public class MapPutter extends BeanBinderBase implements BeanUpdator constractableTest(valueType); } - public Class getInputType() - { - throw new UnsupportedOperationException("getElementType() for MapPutter is not supported yet"); + public Class< ? > getInputType() { + throw new UnsupportedOperationException( + "getElementType() for MapPutter is not supported yet"); } - public BeanUpdatorType getType() - { + public BeanUpdatorType getType() { return BeanUpdatorType.MAP_PUTTER; } - public Class getKeyType() - { + public Class< ? > getKeyType() { return keyType; } - public Class getValueType() - { + public Class< ? > getValueType() { return valueType; } - // @Override - // public void setXMLData(Object bean, Object xmlData) throws BeanException - // { - // if(!TypeInformation.isDOMElement(xmlData.getClass())) - // return; - // - // Element mapEntryElement = (Element) xmlData; - // // TODO support for complex putter argument such as putSomething(String - // key, Map value); - // String key = mapEntryElement.getAttribute("key"); - // Object value = BeanUtil.createXMLBean(valueType, mapEntryElement); - // invokeMethod(bean, new Object[] { key, value } ); - // } - } diff --git a/src/main/java/org/xerial/util/bean/impl/MapSetter.java b/src/main/java/org/xerial/util/bean/impl/MapSetter.java index 202c282..a3e0383 100644 --- a/src/main/java/org/xerial/util/bean/impl/MapSetter.java +++ b/src/main/java/org/xerial/util/bean/impl/MapSetter.java @@ -25,22 +25,19 @@ package org.xerial.util.bean.impl; import java.lang.reflect.Method; -import java.util.Map; -import org.xerial.json.JSONArray; import org.xerial.util.bean.BeanException; -import org.xerial.util.bean.BeanUtil; import org.xerial.util.bean.TypeInfo; - public class MapSetter extends BeanBinderBase { - Class mapType; + Class< ? > mapType; - Class keyType; + Class< ? > keyType; - Class valueType; + Class< ? > valueType; - public MapSetter(Method method, String parameterName, Class mapType, Class keyType, Class valueType) throws BeanException { + public MapSetter(Method method, String parameterName, Class< ? > mapType, Class< ? > keyType, + Class< ? > valueType) throws BeanException { super(method, parameterName); this.mapType = mapType; this.keyType = keyType; diff --git a/src/main/java/org/xerial/util/bean/impl/Setter.java b/src/main/java/org/xerial/util/bean/impl/Setter.java index a3dd252..2c2cc58 100644 --- a/src/main/java/org/xerial/util/bean/impl/Setter.java +++ b/src/main/java/org/xerial/util/bean/impl/Setter.java @@ -26,28 +26,22 @@ package org.xerial.util.bean.impl; import java.lang.reflect.Method; -import org.xerial.util.bean.BeanException; import org.xerial.util.bean.BeanUpdator; import org.xerial.util.bean.BeanUpdatorType; -import org.xerial.util.bean.BeanUtil; -public class Setter extends BeanBinderBase implements BeanUpdator -{ - Class valueType; +public class Setter extends BeanBinderBase implements BeanUpdator { + Class< ? > valueType; - public Setter(Method method, String parameterName, Class valueType) - { + public Setter(Method method, String parameterName, Class< ? > valueType) { super(method, parameterName); this.valueType = valueType; } - public Class getInputType() - { + public Class< ? > getInputType() { return valueType; } - public BeanUpdatorType getType() - { + public BeanUpdatorType getType() { return BeanUpdatorType.SETTER; }