T
Tom Heathcote
Apologies for posting a flex++ question rather than a C++ question, but
there does not appear to be a flex++ newsgroup...
I am trying to rebuild some old lexical scanner / analyzer code,
which I believe was generated by flex++/bison++.
The rebuild is required because existing code is only a 7-bit scanner
(uses char rather than unsigned char as its character type, and the
tables only go up to 127) and I need to work with 8-bit input.
However when I try to regenerate the code, flex++ does not seem to
understand some of the syntax in the .l file. The file starts out as
follows:
/* (a load of comments first) */
%name JobRunScan
%define LEX_PARAM \
YY_JobRunParse_STYPE* value, \
YY_JobRunParse_LTYPE* loc
%define MEMBERS \
public: \
int line() const \
{ return m_line; } \
\
private: \
istream* m_cin; \
int m_line;
But flex++ just comes up with a load of errors:
"JobRunScan.l", line 27: bad character: %
"JobRunScan.l", line 27: unknown error processing section 1
"JobRunScan.l", line 27: unknown error processing section 1
"JobRunScan.l", line 27: unknown error processing section 1
"JobRunScan.l", line 29: unrecognized '%' directive
"JobRunScan.l", line 33: unrecognized '%' directive
"JobRunScan.l", line 37: bad character: \
It simply does not recognize either %name or %define as valid.
I have tried searching Google for some relevant information, and I found
some examples that imply that this is correct flex++ syntax. But I
didn't come up with any solutions... (it doesn't help that most search
engines don't let you search for terms containing a percent sign).
Does anyone have any idea what I might be doing wrong?
there does not appear to be a flex++ newsgroup...
I am trying to rebuild some old lexical scanner / analyzer code,
which I believe was generated by flex++/bison++.
The rebuild is required because existing code is only a 7-bit scanner
(uses char rather than unsigned char as its character type, and the
tables only go up to 127) and I need to work with 8-bit input.
However when I try to regenerate the code, flex++ does not seem to
understand some of the syntax in the .l file. The file starts out as
follows:
/* (a load of comments first) */
%name JobRunScan
%define LEX_PARAM \
YY_JobRunParse_STYPE* value, \
YY_JobRunParse_LTYPE* loc
%define MEMBERS \
public: \
int line() const \
{ return m_line; } \
\
private: \
istream* m_cin; \
int m_line;
But flex++ just comes up with a load of errors:
"JobRunScan.l", line 27: bad character: %
"JobRunScan.l", line 27: unknown error processing section 1
"JobRunScan.l", line 27: unknown error processing section 1
"JobRunScan.l", line 27: unknown error processing section 1
"JobRunScan.l", line 29: unrecognized '%' directive
"JobRunScan.l", line 33: unrecognized '%' directive
"JobRunScan.l", line 37: bad character: \
It simply does not recognize either %name or %define as valid.
I have tried searching Google for some relevant information, and I found
some examples that imply that this is correct flex++ syntax. But I
didn't come up with any solutions... (it doesn't help that most search
engines don't let you search for terms containing a percent sign).
Does anyone have any idea what I might be doing wrong?