[stringtemplate-interest] What is in an identifier

Caleb Lyness caleb.lyness at ezswitch.net
Thu Oct 26 23:16:20 PDT 2006


> The Java language spec is a little vague about what it allows for an
> identifier but it is basically anything that in some lanuage would be
> used to form words.
> I only speak English so I only use a-z, A-Z, 0-9 but I can define a
> property getter such as: public int get\u0391Foo?() {...} I would not
> be able to access this property using ST.
>  
> Specifically Java allows _ and $ for any character including the first
> one. You are discouraged from using $ which is good because it would
> conflict with ST's use of $.
See the section: "Difficult propetry names" on
http://www.antlr.org/wiki/display/ST/Expressions
Also related to
http://www.antlr.org/wiki/display/ST/numbers+not+allowed+as+keys
>  
> How did / sneak in?
>  
> For consistency and to reduce confusion I think that all the grammars
> should use the same definition for ID.
>  
> I think that _ should be allowed as the first character in ID since
> Java allows it.
>  
> For better i18n support the same set of characters that
> Character.isJavaIdentifierStart and Character.isJavaIdentifierPart do.
>  
> -John
>  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org:8080/pipermail/stringtemplate-interest/attachments/20061027/a5ee4745/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3269 bytes
Desc: S/MIME Cryptographic Signature
Url : http://www.antlr.org:8080/pipermail/stringtemplate-interest/attachments/20061027/a5ee4745/attachment.bin 


More information about the stringtemplate-interest mailing list