private static void parseExpression(final Reader reader,final boolean writingString,final StringBuilder templateExpressions) throws IOException {
  if (!writingString) {
    templateExpressions.append("out << \"\"\"");
  }
  templateExpressions.append("${");
  while (true) {
    int c=reader.read();
    if (c == -1)     break;
    if (c == '%') {
      c=reader.read();
      if (c == '>')       break;
      templateExpressions.append('%');
    }
    templateExpressions.append((char)c);
  }
  templateExpressions.append('}');
}

private static void parseExpression ( final Reader reader , final boolean writingString , final StringBuilder templateExpressions ) throws IOException { if ( ! writingString ) { templateExpressions . append ( "out << \"\"\"" ) ; } templateExpressions . append ( "${" ) ; while ( true ) { int c = reader . read ( ) ; if ( c == - 1 ) break ; if ( c == '%' ) { c = reader . read ( ) ; if ( c == '>' ) break ; templateExpressions . append ( '%' ) ; } templateExpressions . append ( ( char ) c ) ; } templateExpressions . append ( '}' ) ; }
parse a & lt ; % = . . . . % & gt ; expression
