
#include <stdio.h>
#include "mt.tab.h"

int tleft;
extern int yydebug;

int yylex(void)
{
  yylval = tleft;
  if (tleft) {
    tleft--;
    return B;
  } else {
    return EOF;
  }
} 


int main(int argc, char **argv) {
  int rc; 

  if (argc != 2) {
    fprintf(stderr, "Usage: %s token-stream-length\n", argv[0]);
    return 1;
  }

  tleft = atoi(argv[1]);
  yydebug = 1;
  rc = yyparse();
  fprintf(stderr, "yyparse returns %d.\n", rc);
  return rc;
}

void yyerror(const char *m) {
  fprintf(stderr, "yyerror: %s\n", m);
}
