public Document parse(String input){
  int lineStart=0;
  int lineBreak;
  while ((lineBreak=Parsing.findLineBreak(input,lineStart)) != -1) {
    CharSequence line=Substring.of(input,lineStart,lineBreak);
    incorporateLine(line);
    if (lineBreak + 1 < input.length() && input.charAt(lineBreak) == '\r' && input.charAt(lineBreak + 1) == '\n') {
      lineStart=lineBreak + 2;
    }
 else {
      lineStart=lineBreak + 1;
    }
  }
  if (input.length() > 0 && (lineStart == 0 || lineStart < input.length())) {
    incorporateLine(Substring.of(input,lineStart,input.length()));
  }
  return finalizeAndProcess();
}

public Document parse ( String input ) { int lineStart = 0 ; int lineBreak ; while ( ( lineBreak = Parsing . findLineBreak ( input , lineStart ) ) != - 1 ) { CharSequence line = Substring . of ( input , lineStart , lineBreak ) ; incorporateLine ( line ) ; if ( lineBreak + 1 < input . length ( ) && input . charAt ( lineBreak ) == '\r' && input . charAt ( lineBreak + 1 ) == '\n' ) { lineStart = lineBreak + 2 ; } else { lineStart = lineBreak + 1 ; } } if ( input . length ( ) > 0 && ( lineStart == 0 || lineStart < input . length ( ) ) ) { incorporateLine ( Substring . of ( input , lineStart , input . length ( ) ) ) ; } return finalizeAndProcess ( ) ; }
the main parsing function . returns a parsed document ast .
