예제 #1
0
파일: gen_xsd.cpp 프로젝트: mildrock/dummy
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);
}