Discussion:
questions about parsing stuff
(too old to reply)
Ashif Harji
2011-06-12 03:50:53 UTC
Permalink
I think the assignment specification is clear:

For simplicity, assume an include directive appears at the beginning of a
line with no space or tab between the # and include. The file name must be
preceded by at least one space or tab character, be enclosed in double
quotes ("), and not followed by any other characters. Assume an include
directive has no syntax errors, so it is unnecessary to check for any
errors during parsing of the directive.
Is
#include "data/myfile.h"
supposed to occupy a whole line?
is there necessarily a space between #inlcude and "data/myfile.h" ?
Zikun Xu
2011-06-12 06:21:02 UTC
Permalink
but it does not specify this
#include "a,h".
do we need to consider this situation?
  For simplicity, assume an include directive appears at the beginning of a
  line with no space or tab between the # and include. The file name must be
  preceded by at least one space or tab character, be enclosed in double
  quotes ("), and not followed by any other characters. Assume an include
  directive has no syntax errors, so it is unnecessary to check for any
  errors during parsing of the directive.
Is
#include "data/myfile.h"
supposed to occupy a whole line?
is there necessarily a space between #inlcude and "data/myfile.h" ?
Loading...