'Add a define at the global or namelisted scope level.'

def addDefine(self, name, vartype='', doc=None):

    log.debug('DEFINE:    %r    type:    %r    on    line    %d', name, vartype, self.lineno)
    toScope = self.fileinfo
    namelist = name.split('\\')
    if (len(namelist) > 1):
        namespace_path = '\\'.join(namelist[:(-1)])
        namespace_path = qualifyNamespacePath(namespace_path)
        log.debug('defined    in    namespace:    %r', namespace_path)
        namespace = toScope.namespaces.get(namespace_path)
        if (namespace is None):
            namespace = PHPNamespace(namespace_path, self.lineno, self.depth)
            self.fileinfo.namespaces[namespace_path] = namespace
        toScope = namespace
    const_name = namelist[(-1)]
    phpConstant = toScope.constants.get(const_name)
    if (phpConstant is None):
        if (vartype and isinstance(vartype, (list, tuple))):
            vartype = '.'.join(vartype)
        toScope.constants[const_name] = PHPConstant(const_name, self.lineno, vartype)
