private String skipUntilEL(){
  char prev=0;
  StringBuilder buf=new StringBuilder();
  while (hasNextChar()) {
    char ch=nextChar();
    if (prev == '\\') {
      prev=0;
      if (ch == '\\') {
        buf.append('\\');
        if (!escapeBS)         prev='\\';
      }
 else       if (ch == '$' || ch == '#') {
        buf.append(ch);
      }
    }
 else     if (prev == '$' || prev == '#') {
      if (ch == '{') {
        this.isDollarExpr=(prev == '$');
        prev=0;
        break;
      }
      buf.append(prev);
      if (ch == '\\' || ch == '$' || ch == '#') {
        prev=ch;
      }
 else {
        buf.append(ch);
      }
    }
 else     if (ch == '\\' || ch == '$' || ch == '#') {
      prev=ch;
    }
 else {
      buf.append(ch);
    }
  }
  if (prev != 0) {
    buf.append(prev);
  }
  return buf.toString();
}

private String skipUntilEL ( ) { char prev = 0 ; StringBuilder buf = new StringBuilder ( ) ; while ( hasNextChar ( ) ) { char ch = nextChar ( ) ; if ( prev == '\\' ) { prev = 0 ; if ( ch == '\\' ) { buf . append ( '\\' ) ; if ( ! escapeBS ) prev = '\\' ; } else if ( ch == '$' || ch == '#' ) { buf . append ( ch ) ; } } else if ( prev == '$' || prev == '#' ) { if ( ch == '{' ) { this . isDollarExpr = ( prev == '$' ) ; prev = 0 ; break ; } buf . append ( prev ) ; if ( ch == '\\' || ch == '$' || ch == '#' ) { prev = ch ; } else { buf . append ( ch ) ; } } else if ( ch == '\\' || ch == '$' || ch == '#' ) { prev = ch ; } else { buf . append ( ch ) ; } } if ( prev != 0 ) { buf . append ( prev ) ; } return buf . toString ( ) ; }
skip until an el expression ( ' $ { ' or ' # { ' ) is reached , allowing escape sequences ' \ \ ' , ' \ $ ' , and ' \ # ' .
