Identifier (computer languages)

Source: Wikipedia, the free encyclopedia.

In computer

subroutines, and modules
.

Lexical form

Which character sequences constitute identifiers depends on the

line reconstruction phase, and the source was processed via scannerless parsing
, so lexing could be context-sensitive.

In most languages, some character sequences have the lexical form of an identifier but are known as

PL/1
, the distinction is not clear.

Semantics

The scope, or accessibility within a program of an identifier can be either local or global. A global identifier is declared outside of functions and is available throughout the program. A local identifier is declared within a specific function and only available within that function.[1]

For implementations of programming languages that are using a

runtime
the compiled program contains references to memory addresses and offsets rather than the textual identifier tokens (these memory addresses, or offsets, having been assigned by the compiler to each identifier).

In languages that support

symbols
.

Compilers and interpreters do not usually assign any semantic meaning to an identifier based on the actual character sequence used. However, there are exceptions. For example:

In some languages such as Go, identifiers uniqueness is based on their spelling and their visibility.[2]

In HTML an identifier is one of the possible attributes of an HTML element. It is unique within the document.

See also

References