private void matchEndLine ( ) { // First, parse all whitespace characters except for new lines index = skipLineSpace ( index ) ; // Second, check whether we've reached the end-of-file (as signaled by // running out of tokens), or we've encountered some token which not a // newline. if ( index >= tokens . size ( ) ) { return ; // EOF } else if ( tokens . get ( index ) . kind != NewLine ) { syntaxError ( "expected end-of-line" , tokens . get ( index ) ) ; } else { index = index + 1 ; } }
Match a the end of a line . This is required to signal for example the end of the current statement .