// $ANTLR start "serviceDeclaration"
// /Users/peter/Documents/workspace/ToolModel/src/tool/model/grammar/ForteAST.g:252:1: serviceDeclaration[String projectName] returns [ToolServiceObject so] : ^( SERVICE IDENTIFIER qualifiedType ( serviceAttribute[so] )+ ^( UUID STRINGLITERAL ) ) ;
public final ToolServiceObject serviceDeclaration(String projectName) throws RecognitionException {
ToolServiceObject so = null;
CommonTree IDENTIFIER15=null;
CommonTree STRINGLITERAL17=null;
ForteAST.qualifiedType_return qualifiedType16 = null;
try {
// /Users/peter/Documents/workspace/ToolModel/src/tool/model/grammar/ForteAST.g:258:2: ( ^( SERVICE IDENTIFIER qualifiedType ( serviceAttribute[so] )+ ^( UUID STRINGLITERAL ) ) )
// /Users/peter/Documents/workspace/ToolModel/src/tool/model/grammar/ForteAST.g:258:4: ^( SERVICE IDENTIFIER qualifiedType ( serviceAttribute[so] )+ ^( UUID STRINGLITERAL ) )
{
match(input,SERVICE,FOLLOW_SERVICE_in_serviceDeclaration761); if (state.failed) return so;
match(input, Token.DOWN, null); if (state.failed) return so;
IDENTIFIER15=(CommonTree)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_serviceDeclaration763); if (state.failed) return so;
pushFollow(FOLLOW_qualifiedType_in_serviceDeclaration765);
qualifiedType16=qualifiedType();
state._fsp--;
if (state.failed) return so;
if ( state.backtracking==0 ) {
so = new ToolServiceObject((IDENTIFIER15!=null?IDENTIFIER15.getText():null));
so.setType((qualifiedType16!=null?(input.getTokenStream().toString(
input.getTreeAdaptor().getTokenStartIndex(qualifiedType16.start),
input.getTreeAdaptor().getTokenStopIndex(qualifiedType16.start))):null));
so.setPlanName(projectName);
}
// /Users/peter/Documents/workspace/ToolModel/src/tool/model/grammar/ForteAST.g:264:3: ( serviceAttribute[so] )+
int cnt19=0;
loop19:
do {
int alt19=2;
int LA19_0 = input.LA(1);
if ( ((LA19_0>=SO_VIS && LA19_0<=SO_PASSWORD)) ) {
alt19=1;
}
switch (alt19) {
case 1 :
// /Users/peter/Documents/workspace/ToolModel/src/tool/model/grammar/ForteAST.g:0:0: serviceAttribute[so]
{
pushFollow(FOLLOW_serviceAttribute_in_serviceDeclaration774);
serviceAttribute(so);
state._fsp--;
if (state.failed) return so;
}
break;
default :
if ( cnt19 >= 1 ) break loop19;
if (state.backtracking>0) {state.failed=true; return so;}
EarlyExitException eee =
new EarlyExitException(19, input);
throw eee;
}
cnt19++;
} while (true);
match(input,UUID,FOLLOW_UUID_in_serviceDeclaration782); if (state.failed) return so;
match(input, Token.DOWN, null); if (state.failed) return so;
STRINGLITERAL17=(CommonTree)match(input,STRINGLITERAL,FOLLOW_STRINGLITERAL_in_serviceDeclaration784); if (state.failed) return so;
if ( state.backtracking==0 ) {
so.setUuid(so.stripQuotes((STRINGLITERAL17!=null?STRINGLITERAL17.getText():null)));
}
match(input, Token.UP, null); if (state.failed) return so;
match(input, Token.UP, null); if (state.failed) return so;