[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: overriding the filter method



It's not in the copy that I printed. (or on the page you referred me to, or on any of the other pages
in that document.  I did a search for "TKeyword", "token.getLine", and they're not present in
thesis.html.) Page 38 has the syntax for Helpers, States, Tokens, ....  Page 39 has the only filter
example I could find. That code shows how to recognize nested comments.

The TKeyword method looks useful and needs to be documented better. I see (on page 35) that
root.node.TSomeToken is generated by the Lexer, but it's not until page 62 that you mention
get/setLine (but not get/setColumn). Even though the method is mentioned, there doesn't appear to be a
description of what arguments are needed for the TSomeToken constructor. I'm trying to get javadoc to
generate the documentation, but having some trouble getting the details to work under Cygwin with the
NT version of Java.

Steve

"Etienne M. Gagnon" wrote:

> Steve Kelem wrote:
> >...Do I set
> > keyword1 = token; id = null; ?
>
> Why don't you read chapter 4.6 (http://www.sable.mcgill.ca/sablecc/thesis.html#PAGE37).
>
> Here's the short answer:
>
> ... filter()
> {
>   ...
>   if(...)
>   {
>     ...
>     token = new TKeyword1(token.getLine(), token.getColumn());
>   }
> ...
> }
>
> Or something like this.  I haven't tried to compile this, so there may be some errors.  I hope you
> get the idea though.
>
> Etienne
> --
> ----------------------------------------------------------------------
> Etienne M. Gagnon, M.Sc.                     e-mail: egagnon@j-meg.com
> Author of SableCC:                 http://www.sable.mcgill.ca/sablecc/
> ----------------------------------------------------------------------
begin:vcard 
n:Kelem;Steve
tel;fax:408-399-8905
tel;work:408-335-2718
x-mozilla-html:FALSE
url:http://www.adaptivesilicon.com
org:Adaptive Silicon, Inc.
adr:;;985 University Ave., Suite 31;Los Gatos;CA;95032-7639;U.S.
version:2.1
email;internet:kelem@adaptivesilicon.com
title:Chief Scientist
fn:Steve Kelem
end:vcard