1{ 2#include "stdio.h" 3#include "string.h" 4#include "stdlib.h" 5char *xdup(char *s, char *e) { 6 char *ss = malloc( e - s + 2 ); 7 memcpy(ss, s, e-s); 8 ss[e-s] = 0; 9 return ss; 10} 11} 12top: A ( B C { printf("%s\n", xdup($n.start_loc.s, $n.end)); } ) D; 13A: 'A'; 14B: 'B'; 15C: 'C'; 16D: 'D'; 17whitespace: "[\t\n ]"; 18