public static String findTemplateName ( org . teatrove . tea . compiler . Scanner scanner ) { // System.out.println("<-- findTemplateName -->"); Token token ; String name = null ; try { while ( ( ( token = scanner . readToken ( ) ) . getID ( ) ) != Token . EOF ) { /* System.out.println("Token [Code: " + token.getCode() + "] [Image: " + token.getImage() + "] [Value: " + token.getStringValue() + "] [Id: " + token.getID() + "]"); */ if ( token . getID ( ) == Token . TEMPLATE ) { token = scanner . readToken ( ) ; if ( token . getID ( ) == Token . IDENT ) { name = token . getStringValue ( ) ; } break ; } } } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; } return name ; }
Finds the name of the template using the specified tea scanner .