static SourceLocation createSrcLoc ( String filePath , Token first , Token ... rest ) { int beginLine = first . beginLine ; int beginColumn = first . beginColumn ; int endLine = first . endLine ; int endColumn = first . endColumn ; for ( Token next : rest ) { checkArgument ( startsLaterThan ( next , beginLine , beginColumn ) ) ; checkArgument ( endsLaterThan ( next , endLine , endColumn ) ) ; endLine = next . endLine ; endColumn = next . endColumn ; } // this special case happens for completely empty files. if ( beginLine == 0 && endLine == 0 && beginColumn == 0 && endColumn == 0 ) { return new SourceLocation ( filePath ) ; } return new SourceLocation ( filePath , beginLine , beginColumn , endLine , endColumn ) ; }
Returns a source location for the given tokens .