// $ANTLR start "property"
// /Users/peter/Documents/workspace/ToolModel/src/tool/model/grammar/ForteAST.g:313:1: property returns [ToolProperty toolProp] : ( ^( PROPERTY IDENTIFIER literal ) | ^( PROPERTY id1= IDENTIFIER id2= IDENTIFIER ) );
public final ToolProperty property() throws RecognitionException {
ToolProperty toolProp = null;
CommonTree id1=null;
CommonTree id2=null;
CommonTree IDENTIFIER27=null;
ForteAST.literal_return literal28 = null;
try {
// /Users/peter/Documents/workspace/ToolModel/src/tool/model/grammar/ForteAST.g:314:2: ( ^( PROPERTY IDENTIFIER literal ) | ^( PROPERTY id1= IDENTIFIER id2= IDENTIFIER ) )
int alt23=2;
int LA23_0 = input.LA(1);
if ( (LA23_0==PROPERTY) ) {
int LA23_1 = input.LA(2);
if ( (LA23_1==DOWN) ) {
int LA23_2 = input.LA(3);
if ( (LA23_2==IDENTIFIER) ) {
int LA23_3 = input.LA(4);
if ( (LA23_3==IDENTIFIER) ) {
alt23=2;
}
else if ( ((LA23_3>=INTLITERAL && LA23_3<=STRINGLITERAL)||LA23_3==NIL||LA23_3==FALSE||LA23_3==TRUE||(LA23_3>=HEXLITERAL && LA23_3<=FLOATLITERAL)) ) {
alt23=1;
}
else {
if (state.backtracking>0) {state.failed=true; return toolProp;}
NoViableAltException nvae =
new NoViableAltException("", 23, 3, input);
throw nvae;
}
}
else {
if (state.backtracking>0) {state.failed=true; return toolProp;}
NoViableAltException nvae =
new NoViableAltException("", 23, 2, input);
throw nvae;
}
}
else {
if (state.backtracking>0) {state.failed=true; return toolProp;}
NoViableAltException nvae =
new NoViableAltException("", 23, 1, input);
throw nvae;
}
}
else {
if (state.backtracking>0) {state.failed=true; return toolProp;}
NoViableAltException nvae =
new NoViableAltException("", 23, 0, input);
throw nvae;
}
switch (alt23) {
case 1 :
// /Users/peter/Documents/workspace/ToolModel/src/tool/model/grammar/ForteAST.g:314:4: ^( PROPERTY IDENTIFIER literal )
{
match(input,PROPERTY,FOLLOW_PROPERTY_in_property1014); if (state.failed) return toolProp;
match(input, Token.DOWN, null); if (state.failed) return toolProp;
IDENTIFIER27=(CommonTree)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_property1016); if (state.failed) return toolProp;
pushFollow(FOLLOW_literal_in_property1018);
literal28=literal();
state._fsp--;
if (state.failed) return toolProp;
match(input, Token.UP, null); if (state.failed) return toolProp;
if ( state.backtracking==0 ) {
toolProp = new ToolProperty();
toolProp.setToolName((IDENTIFIER27!=null?IDENTIFIER27.getText():null));
toolProp.setValue((literal28!=null?(input.getTokenStream().toString(
input.getTreeAdaptor().getTokenStartIndex(literal28.start),
input.getTreeAdaptor().getTokenStopIndex(literal28.start))):null));
}
}
break;
case 2 :
// /Users/peter/Documents/workspace/ToolModel/src/tool/model/grammar/ForteAST.g:320:4: ^( PROPERTY id1= IDENTIFIER id2= IDENTIFIER )
{
match(input,PROPERTY,FOLLOW_PROPERTY_in_property1029); if (state.failed) return toolProp;
match(input, Token.DOWN, null); if (state.failed) return toolProp;
id1=(CommonTree)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_property1033); if (state.failed) return toolProp;
id2=(CommonTree)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_property1037); if (state.failed) return toolProp;
match(input, Token.UP, null); if (state.failed) return toolProp;
if ( state.backtracking==0 ) {
toolProp = new ToolProperty();
toolProp.setToolName((id1!=null?id1.getText():null));
toolProp.setValue((id2!=null?id2.getText():null));
}
}
break;