Exemplo n.º 1
0
void Lstar_spec::
do_print(const _Tt_ostream &os, const _Tt_object *obj)
{
	((Lstar_spec *)obj)->print(os.theFILE());
}
Exemplo n.º 2
0
void _Tt_signature::
print(const _Tt_ostream &os) const
{
    _Tt_arg_list_cursor	argc;

    //
    // XXX This is only used for Classing Engine, never for
    // tracing, so we can be lazy and write directly to the
    // FILE * of the _Tt_ostream.
    //
    FILE *fs = os.theFILE();
    fprintf(fs,"(\n");
    fprintf(fs,"\t\t(%s,%s,<",
            _tt_ce_attr_string(_TYPE_NAME),
            _tt_ce_attr_string(_TT_TOOLTALK_TYPE));
    if (_otid.len()) {
        _otid.print(fs);
    } else {
        _ptid.print(fs);
    }
    fputs("::", fs);
    _op.print(fs);
    if (0==_mangled_args.len()) {
        fputc('_',fs);
    } else {
        _mangled_args.print(fs);
    }
    fputs(">)\n", fs);
    fprintf(fs,"\t\t(%s,string,<%s>)\n",
            _tt_ce_attr_string(_TT_TOOLTALK_TYPE),
            _tt_ce_attr_string(_TT_TOOLTALK_SIGNATURE));
    fprintf(fs,"\t\t(%s,string,<", _tt_ce_attr_string(_TT_OP));
    _op.print(fs);
    fputs(">)\n", fs);
    fprintf(fs,"\t\t(%s,string,<%s>)\n",
            _tt_ce_attr_string(_TT_CATEGORY),
            _tt_enumname(_pattern_category));
    argc.reset(_args);
    int argn=0;
    while (argc.next()) {
        fprintf(fs,"\t\t(%s%d,string,<%s ",
                _tt_ce_attr_string(_TT_ARG), argn,
                _tt_enumname(argc->mode()));
        argc->type().print(fs);
        fputs(" ", fs);
        argc->name().print(fs);
        fputs(">)\n", fs);
        argn++;
    }
    fprintf(fs,"\t\t(%s,string,<%s>)\n",
            (_otid.len()) ? _tt_ce_attr_string(_TT_MSET_SCOPE) :
            _tt_ce_attr_string(_TT_SCOPE),
            _tt_enumname(_scope));
    fprintf(fs,"\t\t(%s,string,<%s>)\n",
            _tt_ce_attr_string(_TT_CLASS),
            _tt_enumname(_message_class));
    switch (_reliability) {
    case TT_START+TT_QUEUE:
#ifdef NOT_BACKWARD_COMPATIBLE
        fprintf(fs,"\t\t(%s,string,<TT_START+TT_QUEUE>)\n",
                _tt_ce_attr_string(_TT_MSET_DISPOSITION));
#else
        //
        // Version 1.0 can't deal with start+queue, so we
        // hide it in the typename, which version 1.0 doesn't
        // check.
        //
        fprintf(fs,"\t\t(%s,string:TT_START+TT_QUEUE,<TT_START>)\n",
                _tt_ce_attr_string(_TT_MSET_DISPOSITION));
#endif /*NOT_BACKWARD_COMPATIBLE*/
        break;
    case TT_QUEUE:
        fprintf(fs,"\t\t(%s,string,<TT_QUEUE>)\n",
                _tt_ce_attr_string(_TT_MSET_DISPOSITION));
        break;
    case TT_START:
        fprintf(fs,"\t\t(%s,string,<TT_START>)\n",
                _tt_ce_attr_string(_TT_MSET_DISPOSITION));
        break;
    case TT_DISCARD:
    default:
        fprintf(fs,"\t\t(%s,string,<TT_DISCARD>)\n",
                _tt_ce_attr_string(_TT_MSET_DISPOSITION));
        break;
    }
    fprintf(fs,"\t\t(%s,string,<%d>)\n",
            _tt_ce_attr_string(_TT_MSET_OPNUM), _opnum);
    fprintf(fs,"\t\t(%s,string,<",
            _tt_ce_attr_string(_TT_MSET_HANDLER_PTYPE));
    _ptid.print(fs);
    fputs(">)\n", fs);
    if (_otid.len()) {
        fprintf(fs,"\t\t(%s,string,<",
                _tt_ce_attr_string(_TT_MSET_OTYPE));
        _otid.print(fs);
        fputs(">)\n", fs);
    }
    fprintf(fs,"\t)");
}