Lexical Grammar
The specification of a programming language often includes a set of rules which defines the lexer. These rules usually consist of regular expressions, and they define the set of possible character sequences that are used to form individual tokens or lexemes.
In programming languages that delimit blocks with tokens (e.g., "{" and "}"), as opposed to off-side rule languages that delimit blocks with indentation, white space is also defined by a regular expression and influences the recognition of other tokens but does not itself contribute tokens. White space is said to be non-significant in such languages.
Read more about this topic: Lexical Analysis
Famous quotes containing the word grammar:
“Grammar is a tricky, inconsistent thing. Being the backbone of speech and writing, it should, we think, be eminently logical, make perfect sense, like the human skeleton. But, of course, the skeleton is arbitrary, too. Why twelve pairs of ribs rather than eleven or thirteen? Why thirty-two teeth? It has something to do with evolution and functionalismbut only sometimes, not always. So there are aspects of grammar that make good, logical sense, and others that do not.”
—John Simon (b. 1925)