]> git.donarmstrong.com Git - lilypond.git/blob - src/lexerinit.cc
43a1c2c5a6f4a73685e3ad7cc4f4798643f569d9
[lilypond.git] / src / lexerinit.cc
1 #include <iostream.h>
2 #include <strstream.h>
3 #include "proto.hh"
4 #include "plist.hh"
5 #include "lexer.hh"
6 #include "debug.hh"
7 #include "main.hh"
8 #include "sourcefile.hh"
9 #include "source.hh"
10
11 My_flex_lexer *lexer=0;
12
13 int
14 yylex() {
15         return lexer->yylex();
16 }
17
18 bool
19 busy_parsing()
20 {
21     return lexer;       
22 }
23
24 Input_file::Input_file(String s)
25 {
26     name = s;
27     line = 1;
28     String pf(s);
29     if (pf=="") {
30         is = &cin;
31         defined_ch_c_l_ = 0;
32         sourcefile_l_ = 0;
33     }
34     else {
35         Source_file* sourcefile_p = new Source_file( pf );
36         source_global_l->add( sourcefile_p );
37         sourcefile_l_ = sourcefile_p;
38         is = sourcefile_l_->istream_l();
39         defined_ch_c_l_ = sourcefile_l_->ch_c_l();
40     }
41     cout << "["<<pf<<flush;
42 }
43
44 Input_file::~Input_file()
45 {
46   cout << "]" << flush;  
47 }