#include <fstream.h>
#include "lexer.hh"
#include "debug.hh"
+#include "main.hh"
My_flex_lexer *lexer=0;
{
name = s;
line = 1;
- if (s=="")
+ String pf(s);
+ if (pf=="")
is = &cin;
- else
- is = new ifstream( s );
-
- if ( ! *is) {
- String e("can\'t open `" + s+"\'");
- error(e);
- }
- cout << "["<<s<<flush;
+ else {
+ pf =find_file(pf);
+ if (pf=="") {
+ String e("can\'t open `" + s+"\'");
+ error(e);
+ }
+ is = new ifstream( pf);
+ }
+ cout << "["<<pf<<flush;
}
Input_file::~Input_file()