[prev in list] [next in list] [prev in thread] [next in thread] 

List:       stringtemplate-interest
Subject:    Re: [stringtemplate-interest] <attribute.property> didn't look for
From:       "Sam Harwell" <sharwell () pixelminegames ! com>
Date:       2010-11-25 20:24:17
Message-ID: 000701cb8cde$bccc3900$3664ab00$ () pixelminegames ! com
[Download RAW message or body]

This is a multipart message in MIME format.

[Attachment #2 (multipart/alternative)]
This is a multipart message in MIME format.


Which StringTemplate assembly are you using? I know the one I wrote checks
properties because the C# port of the ANTLR Tool relies on it heavily for
compiling grammars.

 

Sam

 

From: stringtemplate-interest-bounces@antlr.org
[mailto:stringtemplate-interest-bounces@antlr.org] On Behalf Of Jon Nilsson
Sent: Thursday, November 25, 2010 12:49 AM
To: Ter Parr
Cc: stringtemplate-interest@antlr.org
Subject: [stringtemplate-interest] <attribute.property> didn't look for a
property in C# StringTemplate RE: (no subject)

 

Thank you, Ter, for suggestion: time for a formal object def in the model. 
It worked great except:

<attribute.property> did *NOT* look for property of attribute as a property
(C#) unlike what the cheat sheet said.
It did worked with getProperty() and a raw field.

Here is what the cheat sheet says:
(http://www.antlr.org/wiki/display/ST/StringTemplate+cheat+sheet)
<attribute.property> Looks for property of attribute as a property (C#),
then accessor methods like getProperty() or isProperty(). If that fails,
StringTemplate looks for a raw field of the attribute called property.
Evaluates to the empty string if no such property is found. 



  _____  

Subject: Re: [stringtemplate-interest] (no subject)
From: parrt@cs.usfca.edu
Date: Sun, 21 Nov 2010 08:37:21 -0800
CC: stringtemplate-interest@antlr.org
To: jonhansnilsson@hotmail.com

Hi Jon, probably time for a formal object def in the model.

Ter

On Nov 20, 2010, at 10:08 PM, Jon Nilsson wrote:

 

It looks like setAttribute() can handle only up to 5 arguments in
StringTemplate C# 3.2.

 

It is causing a problem when I need to do the following:

            rect.SetAttribute("rectangle.{arrayname, index, x, y, width,
height}", "MyArray", 0, 100, 100, 32, 34);

 

What do you recommend?

 

According the the documentation: 

            "The various overloads of the setAttribute() method can handle
from 1 to 5 arguments. 

            The C# version uses variable-length argument list (using params
keyword)." 

            http://www.stringtemplate.org/wiki/display/ST/Expressions

 

 

_______________________________________________
stringtemplate-interest mailing list
stringtemplate-interest@antlr.org
http://www.antlr.org/mailman/listinfo/stringtemplate-interest

 


[Attachment #5 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" \
CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 \
(filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);} o\:* \
{behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
	{font-family:SimSun;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:SimSun;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
	{font-family:"\@SimSun";
	panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p
	{mso-style-priority:99;
	mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
tt
	{mso-style-priority:99;
	font-family:"Courier New";}
span.ecxapple-style-span
	{mso-style-name:ecxapple-style-span;}
span.ecxapple-tab-span
	{mso-style-name:ecxapple-tab-span;}
span.EmailStyle22
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div \
class=WordSection1><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Which \
StringTemplate assembly are you using? I know the one I wrote checks properties \
because the C# port of the ANTLR Tool relies on it heavily for compiling \
grammars.<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Sam<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><div \
style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p \
class=MsoNormal><b><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> \
stringtemplate-interest-bounces@antlr.org \
[mailto:stringtemplate-interest-bounces@antlr.org] <b>On Behalf Of </b>Jon \
Nilsson<br><b>Sent:</b> Thursday, November 25, 2010 12:49 AM<br><b>To:</b> Ter \
Parr<br><b>Cc:</b> stringtemplate-interest@antlr.org<br><b>Subject:</b> \
[stringtemplate-interest] &lt;attribute.property&gt; didn't look for a property in C# \
StringTemplate RE: (no subject)<o:p></o:p></span></p></div></div><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal \
style='margin-bottom:12.0pt'><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Thank you, Ter, for \
suggestion: time for a formal object def in the model. <br>It worked great \
except:<br><br>&lt;<em><span \
style='font-family:"Tahoma","sans-serif"'>attribute</span></em>.<em><span \
style='font-family:"Tahoma","sans-serif"'>property</span></em>&gt; did \
<b><i>*NOT*</i></b> look for <em><span \
style='font-family:"Tahoma","sans-serif"'>property</span></em> of <em><span \
style='font-family:"Tahoma","sans-serif"'>attribute</span></em> as a property (C#) \
unlike what the cheat sheet said.<br>It did worked with get<i>Property</i>() and a \
raw field.<br><br>Here is what the cheat sheet says: (<a \
href="http://www.antlr.org/wiki/display/ST/StringTemplate+cheat+sheet">http://www.antlr.org/wiki/display/ST/StringTemplate+cheat+sheet</a>)<br>&lt;<em><span \
style='font-family:"Tahoma","sans-serif"'>attribute</span></em>.<em><span \
style='font-family:"Tahoma","sans-serif"'>property</span></em>&gt; Looks for \
<em><span style='font-family:"Tahoma","sans-serif"'>property</span></em> of <em><span \
style='font-family:"Tahoma","sans-serif"'>attribute</span></em> as a property (C#), \
then accessor methods like </span><tt><span \
style='font-size:10.0pt'>get</span></tt><em><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Property</span></em><tt><span \
style='font-size:10.0pt'>()</span></tt><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> or </span><tt><span \
style='font-size:10.0pt'>is</span></tt><em><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Property</span></em><tt><span \
style='font-size:10.0pt'>()</span></tt><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>. If that fails, \
</span><tt><span style='font-size:10.0pt'>StringTemplate</span></tt><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> looks for a raw field of \
the <em><span style='font-family:"Tahoma","sans-serif"'>attribute</span></em> called \
<em><span style='font-family:"Tahoma","sans-serif"'>property</span></em>. Evaluates \
to the empty string if no such property is found. <br><br><o:p></o:p></span></p><div \
class=MsoNormal align=center style='text-align:center'><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><hr size=2 width="100%" \
align=center id=stopSpelling></span></div><p class=MsoNormal><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Subject: Re: \
[stringtemplate-interest] (no subject)<br>From: <a \
href="mailto:parrt@cs.usfca.edu">parrt@cs.usfca.edu</a><br>Date: Sun, 21 Nov 2010 \
08:37:21 -0800<br>CC: <a \
href="mailto:stringtemplate-interest@antlr.org">stringtemplate-interest@antlr.org</a><br>To: \
<a href="mailto:jonhansnilsson@hotmail.com">jonhansnilsson@hotmail.com</a><br><br>Hi \
Jon, probably time for a formal object def in the model.<o:p></o:p></span></p><div><p \
class=MsoNormal><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Ter<o:p></o:p></span></p><div><div><p \
class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>On \
Nov 20, 2010, at 10:08 PM, Jon Nilsson wrote:<o:p></o:p></span></p></div><blockquote \
style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p>&nbsp;</o:p></span></p><div><div><p \
class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>It \
looks like setAttribute() can handle only up to 5 arguments in StringTemplate C# \
3.2.<o:p></o:p></span></p></div><div><p class=MsoNormal><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p>&nbsp;</o:p></span></p></div><div><p \
class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>It \
is causing a problem when I need to do the \
following:<o:p></o:p></span></p></div><div><p class=MsoNormal><span \
class=ecxapple-tab-span><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
</span></span><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>rect.SetAttribute(&quot;rectangle.{arrayname, \
index, x, y, width, height}&quot;, &quot;MyArray&quot;, 0, 100, 100, 32, \
34);<o:p></o:p></span></p></div><div><p class=MsoNormal><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p>&nbsp;</o:p></span></p></div><div><p \
class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>What \
do you recommend?<o:p></o:p></span></p></div><div><p class=MsoNormal><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p>&nbsp;</o:p></span></p></div><div><p \
class=MsoNormal><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>According the the \
documentation:&nbsp;<o:p></o:p></span></p></div><div><p class=MsoNormal><span \
class=ecxapple-tab-span><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
</span></span><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&quot;The \
various overloads of the setAttribute() method can handle from 1 to 5 \
arguments.&nbsp;<o:p></o:p></span></p></div><div><p class=MsoNormal><span \
class=ecxapple-tab-span><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
</span></span><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>The C# \
version uses variable-length argument list (using params \
keyword).&quot;&nbsp;<o:p></o:p></span></p></div><div><p class=MsoNormal><span \
class=ecxapple-tab-span><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
</span></span><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><a \
href="http://www.stringtemplate.org/wiki/display/ST/Expressions" \
target="_blank">http://www.stringtemplate.org/wiki/display/ST/Expressions</a><o:p></o:p></span></p></div><div><p \
class=MsoNormal><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p>&nbsp;</o:p></span></p></div><div><p \
class=MsoNormal><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p>&nbsp;</o:p></span></p></div><p \
class=MsoNormal><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>_______________________________________________<br>stringtemplate-interest \
mailing list<br><a href="mailto:stringtemplate-interest@antlr.org">stringtemplate-interest@antlr.org</a><br><a \
href="http://www.antlr.org/mailman/listinfo/stringtemplate-interest" \
target="_blank">http://www.antlr.org/mailman/listinfo/stringtemplate-interest</a><o:p></o:p></span></p></div></blockquote></div><p \
class=MsoNormal><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p>&nbsp;</o:p></span></p></div></div></body></html>




_______________________________________________
stringtemplate-interest mailing list
stringtemplate-interest@antlr.org
http://www.antlr.org/mailman/listinfo/stringtemplate-interest


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic