Windows LEX and YACC?? (no printf, etc).
Mon, 13 Dec 1993 03:30:07 GMT

          From comp.compilers

Related articles
Windows LEX and YACC?? (no printf, etc). (1993-12-13)
| List of all articles for this month |

Keywords: lex, yacc, question, comment
Organization: Univ of Cincinnati Academic IT Services
Date: Mon, 13 Dec 1993 03:30:07 GMT

I know there's been some discussion about YACC and generated source
containing printf, stderr, stdout, malloc, etc. use. I also picked up
that this is ok if handled properly. However, is there any offering out
there tailored specifically for Windows which won't generate code using
such features? I need both the Lex and YACC utilities that do this. If
not, I'll fix up the calls and standard stream use best I can. However,
this seems a little hokey...

Tom Morrison
[I haven't seen any such versions, but it shouldn't be hard. In Flex, for
example, if you define ECHO and YY_INPUT() yourself, that overrides all of
the stdio calls that flex would use. In Berkeley yacc, the only I/O calls
are printfs that are conditional on YYDEBUG. The parser input comes from
yylex(), the errors go to yyerror(), which you can redefine, and the
output is all up to you in the semantic routines. So, in fact, you don't
need to change the skeletons at all so long as you get your defines right.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.