145146147148149150151152153154155
pushbackToken(); return parseEnum(); } throw new SyntaxException("class or enum", t.debugString()); } catch (NoMoreTokensException ex) { return false; } }
158159160161162163164165166167168
try { // check whether the next token is a 'enum' TextToken t = nextToken(); if (!t.isIdentifier(ENUM)) { throw new SyntaxException(ENUM, t.debugString()); } t = nextToken(); if (!t.isIdentifier()) {
164165166167168169170171172173174
} t = nextToken(); if (!t.isIdentifier()) { throw new SyntaxException("enum name", t.debugString()); } //System.out.println("parsing enum " + t.getString()); DataModelTypeEnum e = new DataModelTypeEnum(t.getString());
173174175176177178179180181182183
t = nextToken(); if (!t.isChar(OCURLY)) { throw new SyntaxException(OCURLY, t.debugString()); } t = nextToken(); while (true) {
184185186187188189190191192193194
if (t.isChar(CCURLY)) { break; } if (!t.isString()) { throw new SyntaxException("enum value (string literal)", t.debugString()); } e.addValue(t.getString()); t = nextToken();
221222223224225226227228229230231
try { // check whether the next token is a 'class' TextToken t = nextToken(); if (!t.isIdentifier(CLASS)) { throw new SyntaxException(CLASS, t.debugString()); } t = nextToken(); if (!t.isIdentifier()) {
227228229230231232233234235236237
} t = nextToken(); if (!t.isIdentifier()) { throw new SyntaxException("class name", t.debugString()); } //System.out.println("parsing class " + t.getString()); currentClass = new DataModelTypeClass(t.getString()); t = nextToken();
254255256257258259260261262263264
throws Exception { try { TextToken t = nextToken(); if (!t.isChar(OCURLY)) { throw new SyntaxException(OCURLY, t.debugString()); } while (true) { t = nextToken();
281282283284285286287288289290291
throws Exception { // check whether the next token is a Identifier TextToken t = nextToken(); if (!t.isIdentifier()) { throw new SyntaxException("type specifier", t.debugString()); } String type = t.getString(); t = nextToken();
298299300301302303304305306307308
if (t.isChar(OBRACKET)) { t = nextToken(); if (!t.isChar(CBRACKET)) { throw new SyntaxException(CBRACKET, t.debugString()); } currentClass.append(new DataModelTypeArray(type, memberName)); } else if (t.isChar(OBRACE)) {