[antlr-interest] what does /** do?

Loring Craymer lgcraymer at yahoo.com
Mon Feb 25 15:51:20 PST 2008


That's actually the expected behavior:  ANTLR accepts javadoc comments just before grammar or rule declarations and nowhere else.  Regular comments (/* .. */ or // ) are accepted anywhere--they are filtered out before they can be seen by the parser.

--Loring

----- Original Message ----
> From: Benjamin Shropshire <shro8822 at vandals.uidaho.edu>
> To: Jim Idle <jimi at temporal-wave.com>; Antlr Interest <antlr-interest at antlr.org>
> Sent: Monday, February 25, 2008 2:44:55 PM
> Subject: Re: [antlr-interest] what does /** do?
> 
> Jim Idle wrote:
> >> -----Original Message-----
> >> From: Benjamin Shropshire [mailto:shro8822 at vandals.uidaho.edu]
> >> Sent: Monday, February 25, 2008 2:02 PM
> >> To: Antlr Interest
> >> Subject: [antlr-interest] what does /** do?
> >>
> >> I just noticed that if I uses a /**** */ comment (more than one *)
> >> things don't work. Is this an artifact of the lexer or are these
> >> comments used for something? I don't recall ever seeing them used
> >> anywhere for anything (and Google won't search for non text :-b )
> >>     
> >
> > What does it do in what?
> >
> > /** is the introducer for a Doxygen/Javadoc like comment, but any more 
> > '*' would just be ignored in an ANTLR source, or should be. Are you 
> > saying that they are not, or are you talking about your own lexer?
> >
> > Jim
> 
> In my test.g file I used it as a comment and it thew an error. by
> deleting the remaining *'s the error went away.
> 
> test case:
> 
> ---start of file ----
> grammar test_g;
> options {
>     output=AST;
>     ASTLabelType=CommonTree; // type of $stat.tree ref etc...
>     language=CSharp;
> }
> 
> tokens {
> NewLine        =    '\r\n';
> }
>         eol  : NewLine
>              ;
> 
> 
> /**
> */
> 
> ---- end of file ----
> 
> Dang, forgot reply all, and BTW from the above comment; is antlr expecting 
> javadoc stuff in there and failing when it doesn't find it?
> 
> 




      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs


More information about the antlr-interest mailing list