ma************@gmail.com wrote:
# Hi everybody!
#
# I am using lex and yacc to write a vhdl to systemc converter.
#
# Lex simply reads the input file and yacc implements grammar and
# translation.
#
# I'd like to be able to make yacc able to command lex to stop reading
# the current file and starting reading another file, when the inclusion
# syntax is reached.
Use three stages: character input --lex --yacc. The character input
is responsible for input files, character set translations, include
file stacking, etc, to present lex with a continuous stream of characters
from various sources. Depending on how vhdl does inclusion, either lex
or yacc might recognise it and send back to the character input commands
on including files. The tricky part is that you may have characters
buffered in lex and tokens buffered in yacc so that if you don't arrange
it carefully, you can read past where included text is inserted.
--
SM Ryan
http://www.rawbw.com/~wyrmwif/
I ASSURE YOU WE'RE OPEN!