protected ExpressionInterpolationExpression expression_interpolation()
{
ExpressionInterpolationExpression e;
IToken firstseparator = null;
IToken startsep = null;
IToken format_sep = null;
IToken formatString = null;
IToken endsep = null;
IToken lastseparator = null;
e = null;
Expression param = null;
LexicalInfo info = null;
try { // for error handling
{
if ((LA(1)==ESEPARATOR) && (LA(2)==ESEPARATOR))
{
firstseparator = LT(1);
match(ESEPARATOR);
}
else if ((LA(1)==ESEPARATOR) && (tokenSet_5_.member(LA(2)))) {
}
else
{
throw new NoViableAltException(LT(1), getFilename());
}
}
{ // ( ... )+
int _cnt625=0;
for (;;)
{
if ((LA(1)==ESEPARATOR) && (tokenSet_5_.member(LA(2))))
{
startsep = LT(1);
match(ESEPARATOR);
if (0==inputState.guessing)
{
if (info == null)
{
info = ToLexicalInfo(startsep);
e = new ExpressionInterpolationExpression(info);
}
}
param=expression();
{
switch ( LA(1) )
{
case ID:
case COLON:
{
{
switch ( LA(1) )
{
case COLON:
{
format_sep = LT(1);
match(COLON);
break;
}
case ID:
{
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
formatString = LT(1);
match(ID);
break;
}
case ESEPARATOR:
{
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
if (0==inputState.guessing)
{
if (null != param)
{
e.Expressions.Add(param);
if (null != formatString)
param.Annotate("formatString", formatString.getText());
}
}
endsep = LT(1);
match(ESEPARATOR);
}
else
{
if (_cnt625 >= 1) { goto _loop625_breakloop; } else { throw new NoViableAltException(LT(1), getFilename());; }
}
_cnt625++;
}
_loop625_breakloop: ;
} // ( ... )+
{
if ((LA(1)==ESEPARATOR) && (tokenSet_41_.member(LA(2))))
{
lastseparator = LT(1);
match(ESEPARATOR);
}
else if ((tokenSet_41_.member(LA(1))) && (tokenSet_15_.member(LA(2)))) {
}
else
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex, "expression_interpolation");
recover(ex,tokenSet_41_);
}
else
{
throw ex;
}
}
return e;
}