示例#1
0
void gen_xsd(propdecl_t &decl, string &xsd)
{
	ofstream o(xsd);

	gen_head(o, decl);
	gen_body(o, decl);
}
示例#2
0
static void test_attr()
{
    Head *h = gen_head();

    int i = 1; char *s = "string_1";
    Value vals[2];
    vals[0] = val_new_int(&i);
    vals[1] = val_new_str(s);
    Tuple *t = tuple_new(vals, 2);

    int pos;
    Type type;
    head_attr(h, "c", &pos, &type);
    Expr *e = expr_eq(expr_str("string_1"), expr_attr(pos, type));

    if (expr_bool_val(e, t, NULL) == 0)
        fail();

    expr_free(e);
    tuple_free(t);
    mem_free(h);
}