Free Form Grammer

View: New views
3 Messages — Rating Filter:   Alert me  

Free Form Grammer

by KurtG :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



For one of my productions, I'd like to have:


<TAG>  <TEXT>  <EOL>

where text is (~[])*

Of course, TEXT ends up being the largest token and swallows my Tag.  

I could build a bigger TAG token, but then I end up parsing the line myself.  

Any ideas?

--Kurt


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Free Form Grammer

by J.Chris Findlay :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Make a new lexical state, but also define text as (~["\n","\r"])* so it doesn't eat the EOL.

On Wed, Aug 12, 2009 at 8:59 AM, Kurt Guenther <kurtg@...> wrote:


For one of my productions, I'd like to have:


<TAG>  <TEXT>  <EOL>

where text is (~[])*

Of course, TEXT ends up being the largest token and swallows my Tag.

I could build a bigger TAG token, but then I end up parsing the line myself.

Any ideas?

--Kurt


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...




--
- J.Chris Findlay
  (c:

Re: Free Form Grammer

by KurtG :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


thanks!  I had a few problems that your syntax solved.


--- On Tue, 8/11/09, J.Chris Findlay <j.chris.findlay@...> wrote:

> From: J.Chris Findlay <j.chris.findlay@...>
> Subject: Re: [JavaCC] Free Form Grammer
> To: users@...
> Date: Tuesday, August 11, 2009, 5:07 PM
> Make a new lexical state, but also define
> text as (~["\n","\r"])* so it
> doesn't eat the EOL.
>
> On Wed, Aug 12, 2009 at 8:59 AM,
> Kurt Guenther <kurtg@...>
> wrote:
>
>
>
>
>
> For one of my productions, I'd like to have:
>
>
>
>
>
> <TAG>  <TEXT>  <EOL>
>
>
>
> where text is (~[])*
>
>
>
> Of course, TEXT ends up being the largest token and
> swallows my Tag.
>
>
>
> I could build a bigger TAG token, but then I end up parsing
> the line myself.
>
>
>
> Any ideas?
>
>
>
> --Kurt
>
>
>
>
>
> ---------------------------------------------------------------------
>
> To unsubscribe, e-mail: users-unsubscribe@...
>
> For additional commands, e-mail: users-help@...
>
>
>
>
>
>
> --
>  - J.Chris Findlay
>    (c:
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...