Returning special EOF token when EOF found in scanner

Eric Bezault <ericb-D6Qt/9opevxWk0Htik3J/[email protected]>
Newsgroups gmane.comp.lang.eiffel.gobo.general
Organization Gobo
Message-ID <[email protected]>
-------- Original Message --------
Subject: Returning special EOF token when EOF found in scanner
Date: Fri, 4 Feb 2005 11:10:25 +0100
From: Nicholas Allen <nick.allen-53koH/AXb86i2/[email protected]>
To: ericb-D6Qt/9opevxWk0Htik3J/[email protected]

Hi Eric,

Thanks for Gobo Eiffel. You have done a great job!

I have a quick question though. I want to return my own token when EOF is
matched in the scanner to my parser. The reason is that I gather up all the
comments and add them to my own TOKEN object so that each token found also
includes the comments that appeared immediately before it.

So if I can pass my own special EOF token object back to my parser I can 
get
the comments that appear at the end of the file. I tried this:

<<EOF>>			{
				terminate;
				last_token := EOF_TK;
				matched_token(create {TOKEN}.make(EOF_TK, line, column, line, column,
comments));
				}

But it seems the parser does not get this token. Any idea why or how I 
should
be doing this instead?

Thanks very much in advance,

Nicholas Allen




To Post a message, send it to:   [email protected]
To Unsubscribe, send a blank message to: [email protected] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/gobo-eiffel/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.