Lexical Grammar

In computer science, a lexical grammar is the syntax of tokens. That is, the rules governing how a character sequence is divided up into subsequences of characters, each part of which represents an individual token.

For instance, the lexical grammar for many programming languages specifies that a string starts with a " character and continues until a matching " is found, that an identifier is a sequence of letters and digits, and that a number is a sequence of digits. So in the following character sequence "abc" xyz1 23 the tokens are string, identifier and number (because the space character terminates the sequence of characters forming the identifier.)

Famous quotes containing the word grammar:

    Literary gentlemen, editors, and critics think that they know how to write, because they have studied grammar and rhetoric; but they are egregiously mistaken. The art of composition is as simple as the discharge of a bullet from a rifle, and its masterpieces imply an infinitely greater force behind them.
    Henry David Thoreau (1817–1862)