}
void parseClassElement()
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();
if (t.isIdentifier()) {
// simple member of array member or method
String memberName = t.getString();
t = nextToken();
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)) {
t = nextToken();
if (!t.isChar(CBRACE)) {
throw new SyntaxException(CBRACE, t.debugString());
}
currentClass.append(new DataModelTypeMethod(type, memberName));
} else if (t.isChar(SEMICOLON)) {
currentClass.append(new DataModelTypeMember(type, memberName, null));
pushbackToken();
} else if (t.isChar(ASSIGN)) {
t = nextToken();
if (!t.isString()) {
throw new SyntaxException("string literal (init value)", t.debugString());
}
currentClass.append(new DataModelTypeMember(type, memberName, t.getString()));
} else {
throw new SyntaxException("( or [ or ; or =", t.debugString());
}
t = nextToken();
if (!t.isChar(SEMICOLON)) {
throw new SyntaxException(SEMICOLON, t.debugString());
}
} else {
throw new SyntaxException("member name", t.debugString());
}
}