diff options
| author | Clément Zrounba <6691770+clement-z@users.noreply.github.com> | 2023-11-03 15:04:06 +0100 |
|---|---|---|
| committer | Clément Zrounba <6691770+clement-z@users.noreply.github.com> | 2023-11-03 15:04:06 +0100 |
| commit | e95498f8e547b42233dfa2e1e756cac88ac4c5b9 (patch) | |
| tree | ab09fbd0c253bb777ae99d0a4fd50911e8fa2727 /src/parser/parser.l | |
| parent | 13c2d1ab595c5676ecd3f6bd974d834e2c3062c0 (diff) | |
| download | specs-e95498f8e547b42233dfa2e1e756cac88ac4c5b9.tar.gz specs-e95498f8e547b42233dfa2e1e756cac88ac4c5b9.zip | |
improve handling of multiple files
Diffstat (limited to 'src/parser/parser.l')
| -rw-r--r-- | src/parser/parser.l | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/parser/parser.l b/src/parser/parser.l index 7c33630..3edda2f 100644 --- a/src/parser/parser.l +++ b/src/parser/parser.l @@ -93,6 +93,13 @@ static T from_string(const string &str) %% /*** Rules section ***/ +^.*{EOL} { + // print the netlist as it is read + // note: doesnt handle included files + if(false) + cout << yytext; REJECT; +} + ^\.include {yy_push_state(INCLUDE, yyscanner);} <INCLUDE>{WS}* /* eat the whitespace */ <INCLUDE>[^ ;\t\n\r]+ { /* got the include file name */ @@ -383,12 +390,12 @@ static T from_string(const string &str) <INITIAL,INCLUDE><<EOF>> { yypop_buffer_state(yyscanner); - if ( !YY_CURRENT_BUFFER ) - { + if ( !YY_CURRENT_BUFFER ) + { yyterminate(); - } - return '\n'; } + return '\n'; +} <SUBCKT_DECLARATION,IN_DQUOTES><<EOF>> { exit(yylerror(yyscanner, "Unexpected end of file.")); |
