'Return a PHP CITDL expression preceding the given trigger.
The expression drops newlines, whitespace, and function call
arguments -- basically any stuff that is not used by the codeintel
database system for determining the resultant object type of the
expression. For example (in which <|> represents the given position):
GIVEN                           RETURN
foo-<|>>                        foo
Foo:<|>:                        Foo
foo(bar-<|>>                    bar
foo(bar,blam)-<|>>              foo()
foo(bar,                        foo()
blam)-<|>>
foo(arg1, arg2)->bar-<|>>       foo().bar
Foo(arg1, arg2)::bar-<|>>       Foo().bar
Fooar:<|>:                    Fooar
Fooar::bam-<|>>               Fooar.bam
Fooar(arg1, arg2)::bam-<|>>   Fooar().bam'

def citdl_expr_from_trg(self, buf, trg, DEBUG=False):

    DEBUG = False
    if DEBUG:
        print util.banner(('%s    citdl_expr_from_trg    @    %r' % (buf.lang, trg)))
    if (trg.form == TRG_FORM_CPLN):
        if (trg.type == 'classes'):
            i = (trg.pos + 1)
        elif (trg.type == 'functions'):
            i = (trg.pos + 3)
        elif (trg.type in ('variables', 'comment-variables')):
            i = (trg.pos + 1)
        elif (trg.type == 'array-members'):
            i = trg.extra.get('bracket_pos')
        elif (trg.type == 'use'):
            i = (trg.pos + 1)
        elif (trg.type in ['namespace-members', 'use-namespace', 'namespace-members-nmspc-only']):
            i = (trg.pos - 1)
        elif (trg.type == 'use-global-namespaces'):
            i = (trg.pos + 1)
        else:
            i = (trg.pos - 2)
        citdl_expr = self._citdl_expr_from_pos(trg, buf, i, trg.implicit, DEBUG=DEBUG)
        if ((trg.type == 'functions') and (len(citdl_expr) < 3)):
            raise CodeIntelError
        return citdl_expr
    elif (trg.form == TRG_FORM_DEFN):
        return self.citdl_expr_under_pos(trg, buf, trg.pos, DEBUG)
    else:
        return self._citdl_expr_from_pos(trg, buf, (trg.pos - 1), trg.implicit, DEBUG=DEBUG)
