COMPILER DESIGN

LEXICAL ANALYSIS

REGULAR EXPRESSIONS AND FINITE AUTOMATA

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Chomsky classify the grammar into:
A
3 types
B
4types
C
2types
D
grammar can not be classified
Explanation: 

Detailed explanation-1: -The category of language in Chomsky’s Hierarchy is as given below: Type 0 known as Unrestricted Grammar. Type 1 known as Context Sensitive Grammar. Type 2 known as Context Free Grammar.

Detailed explanation-2: -In English, there are two kinds of grammar: prescriptive grammar & descriptive grammar.

Detailed explanation-3: -Grammatical category refers to a set of specific syntactic properties of words that can cause those words and/or other related words to change in form for grammatical reasons (ensuring agreement between words).

Detailed explanation-4: -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.