fields.add(field);
}
final public Message MessageDeclaration(Protocol p) throws ParseException {
String name;
Schema request;
Schema response;
boolean oneWay = false;
List<Schema> errorSchemata = new ArrayList<Schema>();
errorSchemata.add(Protocol.SYSTEM_ERROR);
response = ResultType();
name = Identifier();
request = FormalParameters();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ONEWAY:
case THROWS:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ONEWAY:
jj_consume_token(ONEWAY);
oneWay = true;
break;
case THROWS:
jj_consume_token(THROWS);
ErrorList(errorSchemata);
break;
default:
jj_la1[17] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
default:
jj_la1[18] = jj_gen;
;
}
jj_consume_token(SEMICOLON);
Schema errors = Schema.createUnion(errorSchemata);
if (oneWay && response.getType() != Type.NULL)
{if (true) throw error("One-way message'"+name+"' must return void", token);}
{if (true) return oneWay
? p.createMessage(name, null, request)
: p.createMessage(name, null, request, response, errors);}