Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forumsmatch comma separated IDs between double quotes
https://www.eclipse.org/forums/index.php/mv/msg/373918/909661/#msg_909661
I need to match patterns like this
compile just fine but nothing is matched in the actual DSL file
Does it mess with STRING terminal (which I need too)?
Any suggestion?
Thanks,
Ste]]>Stefano Cottafavi2012-09-07T14:21:22-00:00Re: match comma separated IDs between double quotes
https://www.eclipse.org/forums/index.php/mv/msg/373918/909732/#msg_909732
a token for double quote '"'.
A good solution depends on other constructs in your language. You can
try to do this with a data rule (and not have a STRING token), or create
an external lexer. In this lexer you need to keep track of the "previous
interesting token" and then take alternative action.
The difficulty with the datarule is how to specify a good string rule
without ending up with a very complex rule that slows down parsing and
creates a huge node tree.
I have similar things I need to handle in support for the puppet
language. You can look at my implementation at cloudsmith/geppetto @
github (lexer/PPLexer.g) in the o.cloudsmith.geppetto.pp.dsl project.
Hope this helps.
Regards
- henrik
On 2012-07-09 16:21, Stefano Cottafavi wrote:
> Hi all,
> I need to match patterns like this
>
> List "el1,el2,el3"
>
> Trying something like this
>
> ListRule:
> 'List' '"' values+=ID (',' values+=ID)* '"'
>
> compile just fine but nothing is matched in the actual DSL file
>
>
> Does it mess with STRING terminal (which I need too)?
> Any suggestion?
>
>
> Thanks,
> Ste]]>Henrik Lindberg2012-09-07T16:56:27-00:00