COMPILER DESIGN

LEXICAL ANALYSIS

CONSTRUCTION OF A LEXICAL ANALYZER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Type 3 grammar is otherwise called as ____
A
Regular Language
B
Recursive Language
C
Context Free language
D
Context Sensitive language
Explanation: 

Detailed explanation-1: -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 explanation-2: -Type-3 Grammar Type-3 grammars generate regular languages. Type-3 grammars must have a single non-terminal on the left-hand side and a right-hand side consisting of a single terminal or single terminal followed by a single non-terminal. The rule S → is allowed if S does not appear on the right side of any rule.

Detailed explanation-3: -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 explanation-4: -In automata theory, the class of unrestricted grammars (also called semi-Thue, type-0 or phrase structure grammars) is the most general class of grammars in the Chomsky hierarchy.

Detailed explanation-5: -Recursively enumerable grammars –recognizable by a Turing machine. Context-sensitive grammars –recognizable by the linear bounded automaton. Context-free grammars-recognizable by the pushdown automaton. Regular grammars –recognizable by the finite state automaton.

There is 1 question to complete.