private void parseLine(List<Elem> elems,String line){
  int i=0;
  boolean lastWasOpenBrace=false;
  StringBuilder sb=new StringBuilder();
  while (i < line.length()) {
    char ch=line.charAt(i++);
    if (ch == '@') {
      if (i < line.length() && line.charAt(i) == '@') {
        sb.append('@');
        i++;
      }
 else       if (i < line.length() && line.charAt(i) == '\\') {
        sb.append('\\');
        i++;
      }
 else       if (i < line.length() && line.charAt(i) == '#') {
        sb.append('#');
        i++;
      }
 else       if (lastWasOpenBrace) {
        sb.deleteCharAt(sb.length() - 1);
        flushLiteral(elems,sb);
        i=parseExpr(elems,line,i);
      }
 else {
        sb.append('@');
        i++;
      }
      lastWasOpenBrace=false;
    }
 else {
      lastWasOpenBrace=ch == '{';
      sb.append(ch);
    }
  }
  flushLiteral(elems,sb);
}

private void parseLine ( List < Elem > elems , String line ) { int i = 0 ; boolean lastWasOpenBrace = false ; StringBuilder sb = new StringBuilder ( ) ; while ( i < line . length ( ) ) { char ch = line . charAt ( i ++ ) ; if ( ch == '@' ) { if ( i < line . length ( ) && line . charAt ( i ) == '@' ) { sb . append ( '@' ) ; i ++ ; } else if ( i < line . length ( ) && line . charAt ( i ) == '\\' ) { sb . append ( '\\' ) ; i ++ ; } else if ( i < line . length ( ) && line . charAt ( i ) == '#' ) { sb . append ( '#' ) ; i ++ ; } else if ( lastWasOpenBrace ) { sb . deleteCharAt ( sb . length ( ) - 1 ) ; flushLiteral ( elems , sb ) ; i = parseExpr ( elems , line , i ) ; } else { sb . append ( '@' ) ; i ++ ; } lastWasOpenBrace = false ; } else { lastWasOpenBrace = ch == '{' ; sb . append ( ch ) ; } } flushLiteral ( elems , sb ) ; }
parse a line into elements .
