On Dec 5, 2008, at 3:30 AM, Gavin Lambert wrote:
> At 19:46 5/12/2008, Kenny Leung wrote: > >One of the problems lies in parsing something like this: > > > > {vids=^vids} > > > >which means a struct named "vids", which is composed of void * > >(^v), int, double, and short. > > > >After the "{", I need to interpret vids as a single token, and > >after the "=", I need to interpret the characters as separate > >tokens. > > Nope, you don't :) Just treat it as one bigger token at the lexer > level, and then split it up at the parser level when creating the > AST or output. Much simpler. That feels rather hacky and unsatisfying. I wanted to used antlr so I wouldn't feel hacky and unsatisfying. Anyway, I don't think that would work, since the left part is a normal C identifier, which would look something like ('a'..'z'|'A'..'Z'|'_')('a'..'z'|'A'..'Z'|'0'..'9'|'_')*; and the right part is composed of characters in the set c, i, s, l, q, C, I, S, L, Q, f, d, B, v, *, @, #, : ? Thanks! -Kenny List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to il-antlr-interest@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---