<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 6.00.2900.5726" name=GENERATOR></HEAD>
<BODY 
style="WORD-WRAP: break-word; webkit-nbsp-mode: space; webkit-line-break: after-white-space">
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=296350809-23022009><FONT face=Arial color=#0000ff size=2>Hi 
Terence,</FONT></SPAN></DIV>
<DIV><SPAN class=296350809-23022009><FONT face=Arial color=#0000ff size=2>thank 
you very much for your hint. In the meantime, I found a solution that works fine 
for me. I now just pass in three lists in parallel (without a wrapping object) 
and apply a anonymous template to them:</FONT></SPAN></DIV>
<DIV><SPAN class=296350809-23022009><FONT face=Arial size=2>entryMethod(once, 
cols1, cols2, cols3)::=&lt;&lt;<BR>&nbsp; void 
rule_r&lt;first(col1)&gt;(Map\&lt;String, Attribut\&gt; attrs, String 
id){<BR>&nbsp;&nbsp; &lt;if(once)&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
rule_r&lt;first(col1)&gt;_default(attrs);<BR>&nbsp;&nbsp; 
&lt;else&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
if(id.equals("&lt;first(col3)&gt;"))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
rule_r&lt;first(col1)&gt;_&lt;first(col2)&gt;(attrs);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp;&nbsp; <FONT color=#ff0000>&lt;rest(col1), 
rest(col2),rest(col3):{one,two,three|<BR>&nbsp; else 
if(id.equals("&lt;three&gt;")<BR>&nbsp; {<BR>&nbsp;&nbsp;&nbsp; 
rule_r&lt;one&gt;_&lt;two&gt;(attrs);<BR>&nbsp; 
}<BR></FONT>}&gt;<BR>&nbsp;&nbsp; &lt;endif&gt;<BR>&nbsp; 
}<BR>&gt;&gt;</FONT></SPAN></DIV>
<DIV class=Section1>
<P style="MARGIN: 0cm 0cm 0pt">&nbsp;</P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN class=296350809-23022009><FONT face=Arial 
color=#0000ff size=2>Best regards,</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN class=296350809-23022009></SPAN><SPAN 
class=296350809-23022009><FONT face=Arial color=#0000ff 
size=2>Claus</FONT></SPAN>&nbsp;<?xml:namespace prefix = o ns = 
"urn:schemas-microsoft-com:office:office" /><o:p></o:p></P>
<P>
<P class=MsoNormal style="MARGIN: 0cm -4.05pt 0pt -9pt; TEXT-ALIGN: center" 
align=center><B style="mso-bidi-font-weight: normal"><SPAN 
style="FONT-SIZE: 6.5pt; COLOR: navy; FONT-FAMILY: Arial; mso-bidi-font-size: 12.0pt"></SPAN></B></P><FONT 
face=Tahoma size=2>-----Ursprüngliche Nachricht-----<BR><B>Von:</B> Terence Parr 
[mailto:parrt@cs.usfca.edu]<BR><B>Gesendet:</B> Montag, 23. Februar 2009 
03:20<BR><B>An:</B> Seitter Claus-Jochen<BR><B>Cc:</B> 
stringtemplate-interest@antlr.org<BR><B>Betreff:</B> Re: 
[stringtemplate-interest] How to access properties of an attribute of 
&lt;first(multi-valued-attr)&gt;<BR><BR></FONT></P></DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">if 
  everything is public then perhaps you're testing .one on some 
  other&nbsp;object? &nbsp;Perhaps an array of array not an array or something?
  <DIV>Ter<BR>
  <DIV>
  <DIV>On Feb 20, 2009, at 7:03 AM, &lt;<A 
  href="mailto:seitter.claus@muenchener-verein.de">seitter.claus@muenchener-verein.de</A>&gt; 
  wrote:</DIV><BR class=Apple-interchange-newline>
  <BLOCKQUOTE type="cite">
    <DIV>
    <DIV><FONT face=Arial size=2><SPAN class=374574114-20022009>Hi 
    all,</SPAN></FONT></DIV>
    <DIV><FONT face=Arial size=2><SPAN class=374574114-20022009>I just got stuck 
    with the syntax of accessing properties of an attribut that is the result of 
    an operation like &lt;first(multi-valued-attr)&gt;. My intention is to 
    output text for java if clauses like</SPAN></FONT></DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=374574114-20022009></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=374574114-20022009>if(id.equals("a.b.c"))</SPAN></FONT></DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=374574114-20022009>{</SPAN></FONT></DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=374574114-20022009>&nbsp;&nbsp;&nbsp; 
rule_a_b_c();</SPAN></FONT></DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=374574114-20022009>}</SPAN></FONT></DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=374574114-20022009>else if(id.equals("a.b.d"))</SPAN></FONT></DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=374574114-20022009>{</SPAN></FONT></DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=374574114-20022009>&nbsp;&nbsp;&nbsp; 
rule_a_b_d();</SPAN></FONT></DIV>
    <DIV class=Section1>
    <DIV style="MARGIN: 0cm 0cm 0pt"><FONT color=#0000ff>&nbsp;<SPAN 
    class=374574114-20022009><FONT face=Arial 
size=2>}</FONT></SPAN></FONT></DIV>
    <P style="MARGIN: 0cm 0cm 0pt"><FONT face=Arial color=#0000ff size=2><SPAN 
    class=374574114-20022009></SPAN></FONT>&nbsp;</P>
    <DIV style="MARGIN: 0cm 0cm 0pt"><SPAN class=374574114-20022009><FONT 
    face=Arial color=#0000ff size=2>.....&nbsp;&nbsp;&nbsp; .//many of 
    them</FONT></SPAN></DIV></DIV>
    <DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=374574114-20022009></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=374574114-20022009>else if(id.equals("a.b.z"))</SPAN></FONT></DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=374574114-20022009>{</SPAN></FONT></DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
    class=374574114-20022009>&nbsp;&nbsp;&nbsp; 
rule_a_b_z();</SPAN></FONT></DIV>
    <DIV class=Section1>
    <DIV style="MARGIN: 0cm 0cm 0pt"><FONT color=#0000ff>&nbsp;<SPAN 
    class=374574114-20022009><FONT face=Arial 
size=2>}</FONT></SPAN></FONT></DIV>
    <P style="MARGIN: 0cm 0cm 0pt"><SPAN class=374574114-20022009><FONT 
    face=Arial size=2></FONT></SPAN>&nbsp;</P>
    <DIV style="MARGIN: 0cm 0cm 0pt"><SPAN class=374574114-20022009><FONT 
    face=Arial size=2>here are my templates:</FONT></SPAN></DIV>
    <P style="MARGIN: 0cm 0cm 0pt"><SPAN class=374574114-20022009><FONT 
    face=Arial size=2></FONT></SPAN>&nbsp;</P>
    <DIV style="MARGIN: 0cm 0cm 0pt"><SPAN class=374574114-20022009><FONT 
    face=Arial color=#0000ff size=2>entryMethod(once, 
    rows3cols)::=&lt;&lt;<BR>&nbsp; void 
    rule_r&lt;first(rows3cols).one&gt;(Map\&lt;String, Attribut\&gt; attrs, 
    String id){<BR>&nbsp;&nbsp; &lt;if(once)&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
    rule_r&lt;first(rows3cols).one&gt;_default(attrs);<BR>&nbsp;&nbsp; 
    &lt;else&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    if(id.equals("&lt;first(rows3col).three&gt;")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    rule_r&lt;first(rows3cols).one&gt;_&lt;first(rows3cols).two&gt;(attrs);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    }<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
    &lt;rest(rows3cols):entryIfs()&gt;<BR>&nbsp;&nbsp; &lt;endif&gt;<BR>&nbsp; 
    }<BR>&gt;&gt;<BR>entryIfs()::=&lt;&lt;<BR>&nbsp; else 
    if(id.equals("&lt;it.two&gt;")<BR>&nbsp; {<BR>&nbsp;&nbsp;&nbsp; 
    rule_r&lt;it.one&gt;_&lt;it.three&gt;(attrs);<BR>&nbsp; 
    }<BR>&gt;&gt;</FONT></SPAN></DIV>
    <P style="MARGIN: 0cm 0cm 0pt"><SPAN class=374574114-20022009><FONT 
    face=Arial size=2></FONT></SPAN>&nbsp;</P>
    <DIV style="MARGIN: 0cm 0cm 0pt"><SPAN class=374574114-20022009><FONT 
    face=Arial size=2>the template is called from an antl3 tree 
    parser:</FONT></SPAN></DIV>
    <DIV style="MARGIN: 0cm 0cm 0pt"><SPAN class=374574114-20022009><FONT 
    face=Arial size=2><FONT 
    color=#0000ff>//--------------------------------------------------------------------------------<BR>entrytoken<BR>&nbsp; 
    : ENTRY<BR>&nbsp; -&gt; entryMethod<BR>&nbsp; (<BR>&nbsp;&nbsp;&nbsp; 
    once={$rulestart::auths.size()== 1},<BR>&nbsp;&nbsp;&nbsp; 
    rows3cols={Utils.makeRows3Cols(Utils.makeList(new 
    Integer($all::ruleCnt).toString(),$rulestart::auths.size()),$rulestart::auths,Utils.dotList($rulestart::auths))} 
    <BR>&nbsp; )<BR>&nbsp; 
    ;<BR>//--------------------------------------------------------------------------------</FONT></FONT></SPAN></DIV><SPAN 
    class=374574114-20022009><FONT face=Arial size=2><FONT 
    color=#0000ff></FONT></FONT></SPAN></DIV>
    <DIV class=Section1><SPAN class=374574114-20022009>
    <DIV style="MARGIN: 0cm 0cm 0pt"><SPAN class=374574114-20022009></SPAN><FONT 
    face=Arial size=2>t<SPAN class=374574114-20022009>he Object array&nbsp;I 
    pass in&nbsp; is an Array of </SPAN></FONT></DIV><FONT face=Arial 
    size=2><SPAN class=374574114-20022009></SPAN></FONT></SPAN></DIV>
    <DIV class=Section1><SPAN class=374574114-20022009><FONT face=Arial 
    color=#0000ff size=2><SPAN class=374574114-20022009>public class Row3Cols 
    {</SPAN></FONT></SPAN></DIV>
    <DIV><FONT color=#0000ff></FONT>&nbsp;</DIV>
    <DIV class=Section1><SPAN class=374574114-20022009><FONT face=Arial 
    color=#0000ff size=2><SPAN class=374574114-20022009>&nbsp; public String 
    one;<BR>&nbsp; public String two;<BR>&nbsp; public String 
    three;</SPAN></FONT></SPAN></DIV>
    <DIV><FONT color=#0000ff></FONT>&nbsp;</DIV>
    <DIV class=Section1><SPAN class=374574114-20022009><FONT face=Arial 
    color=#0000ff size=2><SPAN class=374574114-20022009>&nbsp; public 
    Row3Cols(String one, String two, String three) {<BR>&nbsp;&nbsp;&nbsp; 
    super();<BR>&nbsp;&nbsp;&nbsp; this.one = one;<BR>&nbsp;&nbsp;&nbsp; 
    this.two = two;<BR>&nbsp;&nbsp;&nbsp; this.three = three;<BR>&nbsp; 
    }</SPAN></FONT></SPAN></DIV>
    <DIV><FONT color=#0000ff></FONT>&nbsp;</DIV>
    <DIV class=Section1><SPAN class=374574114-20022009><FONT face=Arial 
    color=#0000ff size=2><SPAN class=374574114-20022009>&nbsp; public String 
    getOne() {<BR>&nbsp;&nbsp;&nbsp; return one;<BR>&nbsp; 
    }</SPAN></FONT></SPAN></DIV>
    <DIV><FONT color=#0000ff></FONT>&nbsp;</DIV>
    <DIV class=Section1><SPAN class=374574114-20022009><FONT face=Arial 
    color=#0000ff size=2><SPAN class=374574114-20022009>&nbsp; public String 
    getTwo() {<BR>&nbsp;&nbsp;&nbsp; return two;<BR>&nbsp; 
    }</SPAN></FONT></SPAN></DIV>
    <DIV><FONT color=#0000ff></FONT>&nbsp;</DIV>
    <DIV class=Section1><SPAN class=374574114-20022009><FONT face=Arial 
    color=#0000ff size=2><SPAN class=374574114-20022009>&nbsp; public String 
    getThree() {<BR>&nbsp;&nbsp;&nbsp; return three;<BR>&nbsp; 
    }</SPAN></FONT></SPAN></DIV>
    <DIV><FONT color=#0000ff></FONT>&nbsp;</DIV>
    <DIV class=Section1><SPAN class=374574114-20022009><FONT face=Arial 
    size=2><SPAN class=374574114-20022009><FONT 
    color=#0000ff>}</FONT></SPAN></FONT></SPAN></DIV>
    <DIV class=Section1><SPAN class=374574114-20022009><FONT face=Arial 
    size=2><SPAN class=374574114-20022009><FONT 
    color=#0000ff></FONT></SPAN></FONT></SPAN>&nbsp;</DIV>
    <DIV class=Section1><SPAN class=374574114-20022009><FONT face=Arial 
    size=2><SPAN class=374574114-20022009>What happens is are exceptions on 
    runtime:</SPAN></FONT></SPAN></DIV>
    <DIV class=Section1><SPAN class=374574114-20022009><FONT face=Arial 
    size=2><SPAN class=374574114-20022009></SPAN></FONT></SPAN>&nbsp;</DIV>
    <DIV class=Section1><SPAN class=374574114-20022009><FONT face=Arial 
    color=#ff0000 size=2><SPAN class=374574114-20022009>Class 
    [Lde.emvau.ruletool.compiler.Row3Cols; has no such attribute: one in 
    template context [ruleSetClass aliasesBlocksAndMethods 
    entryMethod]<BR>java.lang.NoSuchFieldException: 
    one</SPAN></FONT></SPAN></DIV>
    <DIV class=Section1><SPAN class=374574114-20022009><FONT face=Arial 
    color=#ff0000 size=2><SPAN class=374574114-20022009>Exception in thread 
    "main" java.util.NoSuchElementException: no such attribute: rows3col in 
    template context [ruleSetClass aliasesBlocksAndMethods entryMethod 
    else_subtemplate]</SPAN></FONT></SPAN></DIV>
    <DIV class=Section1><SPAN class=374574114-20022009><FONT face=Arial 
    color=#ff0000 size=2><SPAN 
    class=374574114-20022009></SPAN></FONT></SPAN>&nbsp;</DIV>
    <DIV class=Section1><SPAN class=374574114-20022009><FONT face=Arial 
    size=2><SPAN class=374574114-20022009>What am I missing? Any help 
    appreciated !</SPAN></FONT></SPAN></DIV>
    <DIV class=Section1><SPAN class=374574114-20022009><FONT face=Arial 
    size=2><SPAN class=374574114-20022009>Best 
    Regards,</SPAN></FONT></SPAN></DIV>
    <DIV class=Section1><SPAN class=374574114-20022009><FONT face=Arial 
    size=2><SPAN class=374574114-20022009>Claus</SPAN></FONT></SPAN></DIV>
    <DIV class=Section1><SPAN class=374574114-20022009><FONT face=Arial 
    color=#ff0000 size=2><SPAN 
    class=374574114-20022009></SPAN></FONT></SPAN>&nbsp;</DIV>
    <DIV class=Section1><SPAN class=374574114-20022009><FONT face=Arial 
    size=2><SPAN class=374574114-20022009></SPAN></FONT></SPAN>&nbsp;</DIV><FONT 
    face=Arial size=2>
    <DIV 
    style="MARGIN: 0cm 0cm 0pt"><BR></DIV></FONT></DIV></DIV>_______________________________________________<BR>stringtemplate-interest 
    mailing list<BR><A 
    href="mailto:stringtemplate-interest@antlr.org">stringtemplate-interest@antlr.org</A><BR>http://www.antlr.org/mailman/listinfo/stringtemplate-interest<BR></BLOCKQUOTE></DIV><BR></DIV></BLOCKQUOTE></BODY></HTML>