ANTLR would work since the format is well-defined, but based on what
you've said about the format it may be massive overkill if the target
language has good regex & string operations support. On the other hand,
a simple format like this would be a great learning opportunity, so I
say go for it. J

 

There are many examples on the ANTLR site:

http://www.antlr.org/grammar/list

 

You might start with this one. It's another line-based simple text
format:

http://www.antlr.org/grammar/1205078833386/StackTraceText.g

 

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark Darnell
Sent: Wednesday, November 12, 2008 12:41 PM
To: [EMAIL PROTECTED]
Subject: [antlr-interest] (no subject)

 

I have a requirement to parse a text report in the following format:

SUBJ:  <<report subject>>

A. <<report_type>>/YY/NNNNN/NNNN

B. YYMMDD/HHMM:SS

C. <<field1>>/<<field2>>

D. <<line#>>/<<field3>>/<<field4>>/<<field5>>/<<field6>>

   <<line#>>/<<field3>>/<<field4>>/<<field5>>/<<field6>>

 <<some text would go here>>

E. <<some text would go here>>

I was wondering if ANTLR would be a help in parsing this type of text
file. I need to get the items marked as fields into an XML file that is
later parsed by another system.

If ANTLR is a good fit, could you point me to some examples of writing a
grammar for text file parsing?

Mark Darnell

BIT Systems, Inc.


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address

Reply via email to