{
// Haxe.g:423:24: ^( FUNCTION NEW ( declAttrList )? funcDeclPart )
{
Object root_1 = (Object)adaptor.nil();
root_1 = (Object)adaptor.becomeRoot(
new Function(stream_FUNCTION.nextToken())
, root_1);
adaptor.addChild(root_1,
stream_NEW.nextNode()
);
// Haxe.g:423:49: ( declAttrList )?
if ( stream_declAttrList.hasNext() ) {
adaptor.addChild(root_1, stream_declAttrList.nextTree());
}
stream_declAttrList.reset();
adaptor.addChild(root_1, stream_funcDeclPart.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
}
break;
case 2 :
// Haxe.g:424:19: ( declAttrList )? FUNCTION IDENTIFIER ( typeParam )? funcDeclPart
{
// Haxe.g:424:19: ( declAttrList )?
int alt99=2;
int LA99_0 = input.LA(1);
if ( (LA99_0==DYNAMIC||LA99_0==INLINE||LA99_0==OVERRIDE||LA99_0==PRIVATE||LA99_0==PUBLIC||LA99_0==STATIC) ) {
alt99=1;
}
switch (alt99) {
case 1 :
// Haxe.g:424:19: declAttrList
{
pushFollow(FOLLOW_declAttrList_in_funcDecl5516);
declAttrList333=declAttrList();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_declAttrList.add(declAttrList333.getTree());
}
break;
}
FUNCTION334=(Token)match(input,FUNCTION,FOLLOW_FUNCTION_in_funcDecl5519); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_FUNCTION.add(FUNCTION334);
IDENTIFIER335=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_funcDecl5521); if (state.failed) return retval;
if ( state.backtracking==0 ) stream_IDENTIFIER.add(IDENTIFIER335);
// Haxe.g:424:53: ( typeParam )?
int alt100=2;
int LA100_0 = input.LA(1);
if ( (LA100_0==LT) ) {
alt100=1;
}
switch (alt100) {
case 1 :
// Haxe.g:424:53: typeParam
{
pushFollow(FOLLOW_typeParam_in_funcDecl5523);
typeParam336=typeParam();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_typeParam.add(typeParam336.getTree());
}
break;
}
pushFollow(FOLLOW_funcDeclPart_in_funcDecl5526);
funcDeclPart337=funcDeclPart();
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) stream_funcDeclPart.add(funcDeclPart337.getTree());
// AST REWRITE
// elements: typeParam, FUNCTION, declAttrList, IDENTIFIER, funcDeclPart
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
if ( state.backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (Object)adaptor.nil();
// 425:21: -> ^( FUNCTION IDENTIFIER ( declAttrList )? funcDeclPart ( typeParam )? )
{
// Haxe.g:425:24: ^( FUNCTION IDENTIFIER ( declAttrList )? funcDeclPart ( typeParam )? )
{
Object root_1 = (Object)adaptor.nil();
root_1 = (Object)adaptor.becomeRoot(
new Function(stream_FUNCTION.nextToken())
, root_1);
adaptor.addChild(root_1,
stream_IDENTIFIER.nextNode()
);