diff options
author | Adrian Thurston <thurston@complang.org> | 2012-05-26 10:37:54 -0400 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2012-05-26 10:37:54 -0400 |
commit | 421902f02d3e583225afa6d6686b64bc099a5366 (patch) | |
tree | ed26eece4735a9ba27a15a9cdc46b0155f076ab1 /colm/lmscan.h | |
parent | 918350b6c680388081bd073b04306660a0f887b1 (diff) | |
download | colm-421902f02d3e583225afa6d6686b64bc099a5366.tar.gz |
cleanup of the mainline
Allocating the primary processing objects in the mainline and calling them,
previously had scanners allocating parser and parsers allocating parse data.
Diffstat (limited to 'colm/lmscan.h')
-rw-r--r-- | colm/lmscan.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/colm/lmscan.h b/colm/lmscan.h index 55f466b4..5badaed5 100644 --- a/colm/lmscan.h +++ b/colm/lmscan.h @@ -57,23 +57,18 @@ typedef Vector<const char *> ArgsVector; extern ArgsVector includePaths; -struct Scanner +struct ColmScanner { - Scanner( const char *fileName, istream &input, - ostream &output, ColmParser *includeToParser, int includeDepth ) + ColmScanner( const char *fileName, istream &input, + ostream &output, ColmParser *parser, int includeDepth ) : fileName(fileName), input(input), output(output), includeDepth(includeDepth), line(1), column(1), lastnl(0), + parser(parser), parserExistsError(false), whitespaceOn(true) { - if ( includeToParser != 0 ) - parser = includeToParser; - else { - parser = new ColmParser( fileName, "machine", InputLoc() ); - parser->init(); - } } ifstream *tryOpenInclude( char **pathChecks, long &found ); |