« Return to Thread: Grammar for parsing regular expression

Re: Grammar for parsing regular expression

by Tom Copeland :: Rate this Message:

Reply to Author | View in Thread


On Apr 15, 2009, at 11:11 AM, Krzysztof Langner wrote:

> Yes you are right. I forgot that in java you put regex in strings.  
> In action script RE syntax is:
>
> myVariable = /abc/i
>
> So even this syntax is valid:
> myVariable = /"/
>
> The problem is that it is similar to math expressions like 2/3/4.
> Because of it I can't define it as TOKEN (and have problems with  
> strings too).
>
> I think the same syntax is in javascript and in ruby maybe in other  
> languages too. Thats why I'm looking for same grammar similar to AS  
> to learn how this problem can be solved.

There's an ecmascript grammar that's got a lexical-state based  
tokenizer for regular expressions; I'll send it to you,

Yours,

Tom
http://generatingparserswithjavacc.com/


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

 « Return to Thread: Grammar for parsing regular expression