Hieu Phung wrote: > Hi David, > > Thank you for your suggestion. However, a MIX can start with number, '_' and > '.' :(( > > Actually I am trying to write a CIMP message format in Antlr. Reference: > http://www.parse2.com/example-cargoimp-FFA4.shtml > > Alpha = %x41-5A; > Numeric = %x30-39; > Decimal = %x30-39 / "."; > Mixed = Alpha / Numeric; > Text = %x41-5A / %x30-39 / "." / "-" / " "; <--- this is my MIX token > > This format can be written in ABNF easily... but in Antlr, once I introduce > the MIX token, everything which is mixed of numeric and alpha is returned as > a MIX. Currently I have to use Java code in action to split the MIX string.
For that format, I can't immediately see any simpler way of doing it. Sometimes formats are just ugly and irregular, and those tend to require a lot of action code. -- David-Sarah Hopwood ⚥ http://davidsarah.livejournal.com List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/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 [email protected] 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 -~----------~----~----~----~------~----~------~--~---
