Identifier (class)
public sealed Identifier {inherits Terminal, CoreIdentifier}
Package: CURL.LANGUAGE.SOURCE

Source representation of a Curl identifier


Constructors
default:Initializes an Identifier
constructor public {Identifier.default
    name:StringInterface,
    src:#SourceLocation = null,
    start:int = {default-start-location src},
    end:int = {default-end-location src}
}
unique:Creates a new unique Identifier
factory public {Identifier.unique
    prefix:String = "unique",
    src:#SourceLocation = null,
    start:int = {default-start-location src},
    end:int = {default-end-location src}
}:Identifier
Properties
name:The identifier name as string.
accessor public Identifier.name:String
Properties inherited from SourceInfo: end-location, file-info, start-location
Properties inherited from CurlSource: url
Class Variables and Constants
chars:Provides the CharClass containing the characters that can appear in the Curl identifier after the first character.
public constant Identifier.chars:CharClass ={CharClass Identifier.start-chars, CharClass.digit-chars, CharClass.wide-digit-chars, CharClass.extra-letter-chars, || "word separator" characters. "?-" & "\uFF1F" & || FULLWIDTH QUESTION MARK "\uFF0D" & || FULLWIDTH HYPHEN-MINUS "\u30FB" || KATAKANA MIDDLE DOT }
start-chars:Provides the CharClass containing the characters that can appear at the start of a Curl identifier.
public constant Identifier.start-chars:CharClass ={CharClass CharClass.letter-chars, "_" & "\uFF3F" || FULLWIDTH LOW LINE }
Methods
get-text:Convert source into a string.
public {Identifier.get-text index:ParseIndex = BOS}:StringInterface
identifier:Returns this object if it is an Identifier.
public {Identifier.identifier}:#Identifier
Methods inherited from Parsed: parse-text, parse-token, skip-whitespace
Methods inherited from CurlSource: infix-operator, literal, location-to-line-column, parse-error, parse-expression, parse-head, parse-keywords, parse-parameters, parse-verbatim, token-operator
Methods inherited from SourceLocation: get-url-line-column
Methods inherited from Object: object-describe, object-describe-for-debugging, object-serialize

Constructor Details
default (constructor)
public {Identifier.default
    name:StringInterface,
    src:#SourceLocation = null,
    start:int = {default-start-location src},
    end:int = {default-end-location src}
}

Initializes an Identifier

name: is the name of the identifier.
src: refers to the original source file from which the element was obtained.
start: indicates where in the src the element begins. Defaults to the beginning of the source.
end: indicates where in the src the element ends. Defaults to the end of the source.


unique (factory)
public {Identifier.unique
    prefix:String = "unique",
    src:#SourceLocation = null,
    start:int = {default-start-location src},
    end:int = {default-end-location src}
}:Identifier

Creates a new unique Identifier

prefix: is an optional prefix to include in the identifier name. This is only useful when debugging.
src: refers to the original source file from which the element was obtained.
start: indicates where in the src the element begins. Defaults to the beginning of the source.
end: indicates where in the src the element ends. Defaults to the end of the source.

Description

The identifier is guaranteed not to collide with any other identifier.


Property Details
name (accessor)
accessor public Identifier.name:String

The identifier name as string.



Class Variable and Constant Details
chars (class constant)
public constant Identifier.chars:CharClass ={CharClass Identifier.start-chars, CharClass.digit-chars, CharClass.wide-digit-chars, CharClass.extra-letter-chars, || "word separator" characters. "?-" & "\uFF1F" & || FULLWIDTH QUESTION MARK "\uFF0D" & || FULLWIDTH HYPHEN-MINUS "\u30FB" || KATAKANA MIDDLE DOT }

Provides the CharClass containing the characters that can appear in the Curl identifier after the first character.



start-chars (class constant)
public constant Identifier.start-chars:CharClass ={CharClass CharClass.letter-chars, "_" & "\uFF3F" || FULLWIDTH LOW LINE }

Provides the CharClass containing the characters that can appear at the start of a Curl identifier.



Method Details
get-text (method)
public {Identifier.get-text index:ParseIndex = BOS}:StringInterface

Convert source into a string.

Description

Converts the source object beginning at the specified index into a string.

The result may not be parsable back to the same object.


identifier (method)
public {Identifier.identifier}:#Identifier

Returns this object if it is an Identifier.

Description

Returns null otherwise.