I am currently using regular expressions to parse a text report in order to extract various bits of information. While this approach works, it becomes increasingly difficult to maintain the regex. I am wondering if Antlr can provide a better way to accomplish the task in the long run. BTW, I haven't used Antlr before.
AFAIK, Antlr is mostly used for parsing languages, but my report is not a language. On the other hand, the report follows some patterns and that's how I am able to use regex to extract information.
More about my text report: The report has several sections, and I am only interested in some of the sections while ignoring the rest. For example, there is a thread dump section:
===Start===
(some text I do not care about.)
thread <thread-number> <owning-proc-name> <proc-id>
<resource-owned-by-thread> (optional line)
...
===End===
And then there is a terminated app section:
===Start===
(some text I do not care about, followed by the stack trace of the app)
<app-name>
<stack-layer1>
<stack-layer2>
...
===End===
What I hope to get out of by parsing the report is a data object with getter methods to various piece of data in the report.
Is it suitable task for Antlr or should I look elsewhere? Thank you very much!