+ # A user defined struct that uses pointers.
+ AT_TEST([%skeleton "]b4_skel["
+ %define api.value.type {struct bar}],
+ [%code requires
+ {
+ struct u
+ {
+ int ival;
+ };
+ struct bar
+ {
+ struct u *up;
+ };
+ }
+ %token <up->ival> '1' '2'
+ %printer { ]AT_SKEL_CC_IF([[yyoutput << $$]],
+ [[fprintf (yyo, "%d", $$)]])[; } <up->ival>
+ ],
+ ['1' '2'
+ {
+ printf ("%d %d\n", $1, $<up->ival>2);
+ free ($<up>1);
+ free ($<up>2);
+ }],
+ ["12"],
+ [AT_VAL.up = (struct u *) malloc (sizeof *AT_VAL.up);
+ assert (AT_VAL.up);
+ AT_VAL.up->ival = res - '0';],
+ [1 2])
+