The Gateway to Computer Science Excellence
+1 vote

Repeat Question $4.2.1$ for each of the following grammars and strings: 

  1. $S\rightarrow 0S1\mid 01$ with string $000111$.
  2. $S\rightarrow +SS\mid \ast SS\mid a$ with string $+\ast aaa$.
  3. $S\rightarrow S(S)S\mid \epsilon$ with string $(()())$.
  4. $S\rightarrow S+S\mid SS\mid (S)\mid S\ast\mid a$ with string $(a+a)\ast a$.
  5. $S\rightarrow (L)\mid a$ and $L\rightarrow L,S\mid S$ with string $((a,a),a,(a))$.
  6. $S\rightarrow aSbS\mid bSaS\mid\epsilon$ with string $aabbab$.
  7. The following grammar for boolean expressions:
  • $bexpr\:\rightarrow\:bexpr\:or\:bterm\mid bterm$
  • $bterm\:\rightarrow\:bterm\:and\:bfactor\mid bfactor$
  • $bfactor\:\rightarrow\:not\:bfactor\mid (bexpr)\mid true\mid false$
in Compiler Design by Veteran (55k points) | 11 views

Please log in or register to answer this question.

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,645 questions
56,597 answers
102,146 users