protected void convertGroovy(AST node){
  while (node != null) {
    int type=node.getType();
switch (type) {
case PACKAGE_DEF:
      packageDef(node);
    break;
case STATIC_IMPORT:
case IMPORT:
  importDef(node);
break;
case TRAIT_DEF:
case CLASS_DEF:
classDef(node);
break;
case INTERFACE_DEF:
interfaceDef(node);
break;
case METHOD_DEF:
methodDef(node);
break;
case ENUM_DEF:
enumDef(node);
break;
case ANNOTATION_DEF:
annotationDef(node);
break;
default :
{
Statement statement=statement(node);
output.addStatement(statement);
}
}
node=node.getNextSibling();
}
}

protected void convertGroovy ( AST node ) { while ( node != null ) { int type = node . getType ( ) ; switch ( type ) { case PACKAGE_DEF : packageDef ( node ) ; break ; case STATIC_IMPORT : case IMPORT : importDef ( node ) ; break ; case TRAIT_DEF : case CLASS_DEF : classDef ( node ) ; break ; case INTERFACE_DEF : interfaceDef ( node ) ; break ; case METHOD_DEF : methodDef ( node ) ; break ; case ENUM_DEF : enumDef ( node ) ; break ; case ANNOTATION_DEF : annotationDef ( node ) ; break ; default : { Statement statement = statement ( node ) ; output . addStatement ( statement ) ; } } node = node . getNextSibling ( ) ; } }
converts the antlr ast to the groovy ast
