14 if ( top == stack_size ) {
15 printf( "growing stack\n" );
17 stack = (int*)realloc( stack, sizeof(int)*stack_size );
22 if ( stack_size > (top * 4) ) {
24 stack = (int*)realloc( stack, sizeof(int)*stack_size );
25 printf( "shrinking stack\n" );
29 action item_start { item = p; }
34 fwrite( item, 1, p-item, stdout );
40 printf( "calling main\n" );
47 printf( "STRAY CLOSE\n" );
51 printf( "returning from main\n" );
62 ( number | id ) >item_start %item_finish |
72 void test( char *buf )
77 char *p, *pe, *eof, *item = 0;
79 int len = strlen( buf );
84 stack = (int*)malloc( sizeof(int) * stack_size );
92 if ( cs == recdescent_error ) {
93 /* Machine failed before finding a token. */
94 printf( "PARSE ERROR\n" );
100 test( "88 foo { 99 {{{{}}}}{ } }");
105 #ifdef _____OUTPUT_____