[antlr-interest] book, online doc discrepancy?
Terence Parr
parrt at cs.usfca.edu
Mon Jan 7 11:11:14 PST 2008
On Jan 7, 2008, at 10:58 AM, Mathew Yeates wrote:
> Using StringTemplate the book says to do (using Python)
>
> hello=stringtemplate.StringTemplate("Hello, <name>")
> hello.setAttribute("name","World")
> print hello.toString() #is an error :AttributeError:
> 'StringTemplate' object has no attribute 'toString'
must be a python difference. how do you convert to string in python?
use that not .toString()
Ter
>
>
> if I do
> print str(hello) I get Hello, <name>
>
> But the online docs say to use $name$ and hello["name"] = "World"
> and this works.
>
>
> ????
>
> Mathew
>
>
>
More information about the antlr-interest
mailing list