[prev in list] [next in list] [prev in thread] [next in thread]
List: antlr-dev
Subject: Re: [antlr-dev] [antlr-interest] ignoring auto template
From: Loring Craymer <lgcraymer () yahoo ! com>
Date: 2008-04-05 0:37:08
Message-ID: 591641.71215.qm () web55905 ! mail ! re3 ! yahoo ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Ter--
The solution I implemented in Yggdrasil depends on a few key insights:
1.) ST output provides real visibility into the input stream (or anidealized, \
user-friendly. tweaked version of the input stream), and that visibility can be \
provided to development tools to provide RAD support, not just pretty output but \
pretty output that makes the tools more usable. 2.) The ST structuring mechanism is \
via named slots and is fundamentally different from the tree structuring mechanisms \
which determine order in an output "stream". 3.) The proper view for AST versus ST \
output is not "either/or" but "and/or". The printing of intermediate forms should \
not require a grammar dedicated to template output: that just prolongs the \
development process. Oddly enough, I think that this is the fundamental \
insight--none of the possibilities I explored "felt right" until I got here. 4.) \
Heavy duty rearrangement of the input stream should be done through trees; a \
minimalist syntax for ST support is sufficient. The first class attributes in \
Yggdrasil can support major rewrites of template outputs, but I consider that \
fortuitous; the real benefits are visualization and a more rapid development cycle.
Efficiency is achieved through code generation flags--either the ST generation \
support is included in the target code generated from a grammar or not.
Cheers!
--Loring
----- Original Message ----
From: Terence Parr <parrt@cs.usfca.edu>
To: antlr-interest Interest <antlr-interest@antlr.org>
Cc: antlr-dev list <antlr-dev@antlr.org>
Sent: Friday, April 4, 2008 3:43:58 PM
Subject: [antlr-interest] ignoring auto template construction for now
Hi. decided it's too hard to get a perfect solution in short order. i
easily added auto temp construction but got stuck thinking about
efficiency and hidden channel stuff.
For now, i realized I can just add this to rules that must return the
text by default, which suits my purposes with output=template and
rewrite=true at moment:
@after {
if ( $st==null ) {
StringTemplate t = %{"<element>"};
%t.element = $text;
$st = t;
}
}
Ter
____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total \
Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com
[Attachment #5 (text/html)]
<html><head><style type="text/css"><!-- DIV {margin:0px;} \
--></style></head><body><div style="font-family:times new roman, new york, times, \
serif;font-size:12pt"><div style="font-family: times new roman,new york,times,serif; \
font-size: 12pt;">Ter--<br><br>The solution I implemented in Yggdrasil depends on a \
few key insights:<br><br>1.) ST output provides real visibility into the input \
stream (or an idealized, user-friendly. tweaked version of the input stream), and \
that visibility can be provided to development tools to provide RAD support, not just \
pretty output but pretty output that makes the tools more usable.<br>2.) The ST \
structuring mechanism is via named slots and is fundamentally different from the tree \
structuring mechanisms which determine order in an output "stream".<br> 3.) The \
proper view for AST versus ST output is not "either/or" but "and/or". The \
printing of intermediate forms should not require a grammar dedicated to template \
output: that just prolongs the development process. Oddly enough, I think \
that this is the fundamental insight--none of the possibilities I explored "felt \
right" until I got here.<br>4.) Heavy duty rearrangement of the input stream should \
be done through trees; a minimalist syntax for ST support is sufficient. The \
first class attributes in Yggdrasil can support major rewrites of template outputs, \
but I consider that fortuitous; the real benefits are visualization and a more rapid \
development cycle.<br><br>Efficiency is achieved through code generation \
flags--either the ST generation support is included in the target code generated from \
a grammar or not.<br><br>Cheers!<br><br>--Loring<br><br><br><br><div \
style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- \
Original Message ----<br>From: Terence Parr <parrt@cs.usfca.edu><br>To: \
antlr-interest Interest <antlr-interest@antlr.org><br>Cc: antlr-dev list \
<antlr-dev@antlr.org><br>Sent: Friday, April 4, 2008 3:43:58 PM<br>Subject: \
[antlr-interest] ignoring auto template construction for now<br><br>Hi. decided it's \
too hard to get a perfect solution in short order. i <br>easily added \
auto temp construction but got stuck thinking about <br>efficiency and hidden \
channel stuff.<br><br>For now, i realized I can just add this to rules that must \
return the <br>text by default, which suits my purposes with output=template \
and <br>rewrite=true at moment:<br><br>@after {<br>if ( $st==null ) \
{<br> StringTemplate t = \
%{"<element>"};<br> %t.element = $text;<br> \
$st = t;<br>}<br>}<br><br>Ter<br></div><br></div></div><br>
<hr size=1>You rock. That's why Blockbuster's offering you <a \
href="http://us.rd.yahoo.com/evt=47523/*http://tc.deals.yahoo.com/tc/blockbuster/text5.com">one \
month of Blockbuster Total Access</a>, No Cost.</body></html>
_______________________________________________
antlr-dev mailing list
antlr-dev@antlr.org
http://www.antlr.org:8080/mailman/listinfo/antlr-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic