// -*- c-basic-offset: 4 -*- #include "range_checking.hh" #include "ast.hh" #include #include int yyparse(); ast::DProg *dprog = 0; int main (int argc, char *argv[]) { yyparse(); if (!dprog) return 2; // parse error! if (argc == 1) { range_checking::check(dprog); return 0; } if (strcmp(argv[1],"-r") == 0) { try { range_checking::check(dprog); assert(false); } catch (range_checking::RangeError *ex) { // expected exception delete ex; } } return 0; }