[stringtemplate-interest] ST4: How to get group template name list?
Igor Katrayev
ikatraev at gmail.com
Tue May 17 19:54:05 PDT 2011
Great! Thank you.
On Tuesday, May 17, 2011, Terence Parr <parrt at cs.usfca.edu> wrote:
> sure! add away and please update CHANGES.txt.T
> On May 17, 2011, at 12:23 AM, Udo Borkowski wrote:
> What a coincidence! I was going to ask for just the same.
> I am working on some kind of "Template Workbench". The list of template names of a group will be needed in various places, e.g. in some kind of browser, when analyzing groups, etc.
> For now I patched the STGroup class and added this function to experiment with:
> public Set<String> getTemplateNames() { load(); HashSet<String> result = new HashSet<String>(); for (Map.Entry<String, CompiledST> e: templates.entrySet()) { if (e.getValue() != NOT_FOUND_ST) { result.add(e.getKey()); } } return result; }
> If it is OK with Ter I could add this to the sources.
>
> Udo
>
>
> On 17.05.2011, at 00:59, Terence Parr wrote:
> Hi Igor,
>
> so you just need StringTemplateGroup.getTemplateNames to return a collection of strings representing the names? I I can add that if you want. what are you going to use the names for?
> T
> On May 16, 2011, at 3:23 PM, Igor Katrayev wrote:
>
> Hello,
>
> There is a method in stringtemplate 3 called StringTemplateGroup.getTemplateNames. What is the ST4 counterpart of this method? It seems there is no anything that could give me a list of templates in a template group.
>
> Igor.
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
>
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
>
>
>
More information about the stringtemplate-interest
mailing list