Show/Hide Toolbars

XSharp

Identifiers in X# appear on many places in the language. They consist of a character followed by one or more characters, numbers or digits. The lexer definition for identifiers is below. As you can see, we also allow 'special characters' and 'unicode characters', but in general, that is not recommended.
 

New keywords that are introduced in Vulcan and X# (see the keyword table) can also be used as Identifier.

When an identifier must be used that has the same value as a keyword, then you can prefix the identifier with a double @@ sign, like in the following example.

This is not recommended. But it can happen that code in an external DLL has properties or method names that are keywords in X#. In that case using the @@ prefix can work too.

 

LOCAL @@Class as STRING
LOCAL @@Local as LOGIC

ID                        : IDStartChar IDChar*
                       ;
 
fragment IDStartChar: 'A'..'Z' | 'a'..'z'
                       | '_'
                       | '\u00C0'..'\u00D6'
                       | '\u00D8'..'\u00F6'
                       | '\u00F8'..'\u02FF'
                       | '\u0370'..'\u037D'
                       | '\u037F'..'\u1FFF'
                       | '\u200C'..'\u200D'
                       ;
 
fragment IDChar          : IDStartChar
                       | '0'..'9'
                       | '\u00B7'
                       | '\u0300'..'\u036F'
                       | '\u203F'..'\u2040'
                       ;