parser = $parser; $this->pos = $pos; $this->length = $length; $this->end = $pos + $length; } public function error( $message ) { $text = $this->getText(); throw new CLDRPluralRuleError( "$message at position " . ( $this->pos + 1 ) . ": \"$text\"" ); } public function getText() { return substr( $this->parser->rule, $this->pos, $this->length ); } }