The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+1 vote
32 views
What language is generated by the following grammer?

S→ a | S+S | SS | S* |  (S)
asked in Compiler Design by Active (3.7k points) | 32 views

1 Answer

+2 votes
Best answer

for writing regular expression . we need three operator like 

  • Union: If R1 and R2 are regular expressions, then R1 | R2 (also written as R1 U R2 or R1 + R2) is also a regular expression.
  • Concatenation: If R1 and R2 are regular expressions, then R1.R2 (also written as R1.R2) is also a regular expression.
  • Kleene closure: If R1 is a regular expression, then R1* (the Kleene closure of R1) is also a regular expression.

so this grammar is converting into regular expression.

​​​​​​​

​​​​​​​

answered by Boss (33.9k points)
selected by
+1
yes.. thank u...
but one silly question.. ( S ).. what does this imply in regular expression?
+1
it is just a bracket.

we can genrate regular expression like (aa+aaa)*.

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
49,587 questions
54,197 answers
187,535 comments
71,151 users