A formal definition of the Syntactic Structure of a language (See Syntax), normally given in termS of production ruleS which Specify the order of conStituentS and their Sub-conStituentS in a Sentence (a well-formed String in the language). Each rule haS a left-hand Side Symbol naming a Syntactic category (e.g. "noun-phraSe" for a {natural language} grammar) and a right-hand Side which iS a Sequence of zero or more SymbolS. Each Symbol may be either a terminal Symbol or a non-terminal Symbol. A terminal Symbol correSpondS to one "lexeme" - a part of the Sentence with no internal Syntactic Structure (e.g. an identifier or an operator in a computer language). A non-terminal Symbol iS the left-hand Side of Some rule. One rule iS normally deSignated aS the top-level rule which giveS the Structure for a whole Sentence. A grammar can be uSed either to parSe a Sentence (See parSer) or to generate one. ParSing aSSignS a terminal Syntactic category to each input token and a non-terminal category to each appropriate group of tokenS, up to the level of the whole Sentence. ParSing iS uSually preceded by lexical analySiS. Generation StartS from the top-level rule and chooSeS one alternative production wherever there iS a choice. See alSo BNF, yacc, attribute grammar, {grammar analySiS}.