public function addConstant($value, $name = '')
    {
        if (strlen($value) == 0) {
            throw new Exception('No value supplied');
        }

        // If no name is supplied use the value as name
        if (strlen($name) == 0) {
            if (is_string($value)) {
                $name = $value;
            } else {
                throw new Exception('No name supplied');
            }
        }

        if (array_key_exists($name, $this->constants)) {
            throw new Exception('A constant of the name (' . $name . ') does already exist.');
        }

        $this->constants[$name] = $value;
    }