[antlr-interest] A postmortem of my use of antler
Gerald B. Rosenberg
gbr at newtechlaw.com
Tue Mar 11 11:55:38 PDT 2008
At 09:34 AM 3/11/2008, Benjamin Shropshire wrote:
>Gerald B. Rosenberg wrote:
>>At 03:08 PM 3/10/2008, Benjamin Shropshire wrote:
>Your points #12 & #13 cover a lot of what I would have liked to see
>on the front page. (That and enough context for someone new to known
>what they are talking about.)
Yes, but there is no practical way to fit it into one page. Chapter,
maybe; more likely a book.
>>The step function learning problem is largely (I believe) one of
>>learning how to design a recognition specification subject to the
>>available mechanics of the Antlr language operators.
>
>Oddly I was having a blast building and debugging my grammar. It was
>when I started trying to put in actions that stuff got difficult.
Unfortunately, that is the nature of the beast. Grammars are highly
custom and if you don't have a good grasp of the full set of
requirements at the outset, trying to tack on things at the end can
really bork the whole design -- most of the time you can, but
sometimes the change requirement trickles down to requiring a change
in token definitions -- and that is very frustrating.
And, if there is a #16, it would be:
16) Don't try to do too much in actions; just call a method. Any
standard programming language is far better at procedural logic.
>>11) Unless performance is absolutely your top 6 design
>>requirements, don't worry about using predicates.
>that would be "don't worry about what predicates /cost/"?
Yes.
>>14) Don't try to dump complex blocks from a parser or AST. Use
>>StringTemplate to unparse.
>Does this hold if the final output is not a text file (e.g. in
>memory structures or a binary data file)
No and maybe. Would be an interesting application to have
StringTemplate operate as a directed byte code generator.
----
Gerald B. Rosenberg, Esq.
NewTechLaw
260 Sheridan Ave., Suite 208
Palo Alto, CA 94306-2009
650.325.2100 (office) / 650.703.1724 (cell)
650.325.2107 (facsimile)
www.newtechlaw.com
CONFIDENTIALITY NOTICE: This email message (including any
attachments) is being sent by an attorney, is for the sole use of the
intended recipient, and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the intended recipient,
please contact the sender immediately by reply email and delete all
copies of this message and any attachments without retaining a copy.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080311/774e43aa/attachment.html
More information about the antlr-interest
mailing list