[antlr-interest] The filter option

Marcos Marín marcosmarin at gmail.com
Thu Aug 2 13:23:38 PDT 2007


On 8/2/07, Jim Idle <jimi at temporal-wave.com> wrote:
>
>  You are probably missing something but were you trying to use a filtering
> lexer with a parser? A filtering lexer is currently stand alone.
>

So you mean that I can't use a parser if I specify the filter option? if
this is the case, is there any way I can ignore everything else without the
filter option?

I'm sorry, this is all very new and confusing to me.

Jim
>
>
>
> *From:* Marcos Marín [mailto:marcosmarin at gmail.com]
> *Sent:* Thursday, August 02, 2007 12:54 PM
> *To:* Jim Idle
> *Subject:* Re: [antlr-interest] The filter option
>
>
>
> Thanks again for your help.
>
> I have looked at both C and C++ parser you mentioned and they are really
> much more than I would want, the C one is useless for me because I require
> to parse C++ files too, and the C++ parser is way to complicated for what I
> need.
>
> All I really want is to ignore *everything* except for lines that look
> like a variable declaration and function definitions. I don't really even
> care if the types are correct.
>
> I thought the filter option would help me with this, but apparently when I
> use it it ignores everything, am I using it wrong or am I missing something?
>
>
> On 8/2/07, *Jim Idle* <jimi at temporal-wave.com> wrote:
>
> The parser, or the example? The parser does not as C++ is a much less
> trivial problem than C, but there is a C++ grammar posted on the web site
> somewhere too.
>
>
>
> Jim
>
>
>
> *From:* Marcos Marín [mailto:marcosmarin at gmail.com]
> *Sent:* Thursday, August 02, 2007 11:40 AM
> *To:* Jim Idle
> *Subject:* Re: [antlr-interest] The filter option
>
>
>
> Thanks, I'll have a look at it.
>
> Does it work with C++ too?
>
> On 8/2/07, *Jim Idle* <jimi at temporal-wave.com > wrote:
>
> Marcos,
>
>
>
> The C parser in the downloadable examples does something almost exactly
> like this. Why don't you start there as you will have a much more complete
> grammar that way too?
>
>
>
> Jim
>
>
>
> *From:* antlr-interest-bounces at antlr.org [mailto:antlr-interest-bounces at antlr.org]
> *On Behalf Of *Marcos Marín
> *Sent:* Thursday, August 02, 2007 10:48 AM
> *To:* antlr-interest at antlr.org
> *Subject:* [antlr-interest] The filter option
>
>
>
> Hello, I'm new to ANTLR, what I'm trying to do is a very simple parser to
> keep track of variables in a C/C++ source file and what function they are
> declared in (if any).
> This is my grammar so far (I'm mostly just testing, it's not complete):
>
> *grammar cvartracker;
>
> options {
>     language = CSharp;
>     filter = true;*
>
> * *
>
> *
> *Nothing happens (ie, the System.Console.WriteLine() that is supposed to
> be called when there is a function or variable declaration is not called).
> If I turn the filter option off it does work, but then it complains about
> other things I'm not interested in. Anyone have any ideas on what I can do?
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070802/cee41916/attachment-0001.html 


More information about the antlr-interest mailing list