COMPILER DESIGN

LEXICAL ANALYSIS

REGULAR EXPRESSIONS AND FINITE AUTOMATA

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
The push down automata indicate the acceptance of input string in terms of
A
Finial state
B
Empty store
C
Both (a) and (b)
D
None of these
Explanation: 

Detailed explanation-1: -In final state acceptability, a PDA accepts a string when, after reading the entire string, the PDA is in a final state. From the starting state, we can make moves that end up in a final state with any stack values. The stack values are irrelevant as long as we end up in a final state.

Detailed explanation-2: -Pushdown Automata is a finite automaton with extra memory called stack, which helps Pushdown Automata recognize Context-Free Languages. A Pushdown Automata (PDA) can be defined as : Q is the set of states. ∑is the set of input symbols. is the set of pushdown symbols (which can be pushed and popped from stack)

Detailed explanation-3: -If some 2’s are still left and top of stack is a 0 then string is not accepted by the PDA. Thereafter if 2’s are finished and top of stack is a 0 then for every 3 as input equal number of 0’s are popped out of stack. If string is finished and stack is empty then string is accepted by the PDA otherwise not accepted.

Detailed explanation-4: -The languages which can be accepted by PDA are called context-free languages (CFL), denoted by LCF. Diagrammatically, a PDA is a finite state automaton (see Fig. 5.1), with memories (push-down stacks).

There is 1 question to complete.