void endOptional(boolean successful){
  if (successful) {
    parsed.remove(parsed.size() - 2);
  }
 else {
    parsed.remove(parsed.size() - 1);
  }
}

void endOptional ( boolean successful ) { if ( successful ) { parsed . remove ( parsed . size ( ) - 2 ) ; } else { parsed . remove ( parsed . size ( ) - 1 ) ; } }
ends the parsing of an optional segment of the input .
