LEXICAL ANALYSIS
CONSTRUCTION OF A LEXICAL ANALYZER
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]


Regular Language


Recursive Language


Context Free language


Context Sensitive language

Detailed explanation1: Type 3 Grammar is known as Regular Grammar. Regular languages are those languages which can be described using regular expressions. These languages can be modeled by NFA or DFA . Type 3 is most restricted form of grammar.
Detailed explanation2: Type3 Grammar Type3 grammars generate regular languages. Type3 grammars must have a single nonterminal on the lefthand side and a righthand side consisting of a single terminal or single terminal followed by a single nonterminal. The rule S → is allowed if S does not appear on the right side of any rule.
Detailed explanation3: Regular grammars (rgs) are cfgs that generate regular languages. A regular grammar is a cfg where productions are restricted to two forms, either A → a or A → aB, where A, B ∈ NT and a ∈ T. Regular grammars are equivalent to regular expressions; they encode precisely those languages that can be recognized by a dfa.
Detailed explanation4: In automata theory, the class of unrestricted grammars (also called semiThue, type0 or phrase structure grammars) is the most general class of grammars in the Chomsky hierarchy.
Detailed explanation5: Recursively enumerable grammars –recognizable by a Turing machine. Contextsensitive grammars –recognizable by the linear bounded automaton. Contextfree grammarsrecognizable by the pushdown automaton. Regular grammars –recognizable by the finite state automaton.