## Regular expression for 0 or more occurrence of either a or b or both

Regular expression for 0 or more occurrence of either a or b or both =>   (a+b)*

## Regular expression for all binary string

All binary string. =>    (0+1)*

## Regular expression for string having zero or more a

Regular expression for String having zero or more a =>        a*

## Regular expression over ∑={a,b,c} that represent all string of length 3

Regular expression over ∑={a,b,c} that represent all string of length 3 =>     (a+b+c)(a+b+c)(a+b+c)

## Define predictive parsers

A predictive parser is an efficient way of implementing recursive_descent parsing by handling the stack of activation records explicitly. The predictive parser has an input, a stack , a parsing…

## Define recursive-descent parser

A parser that uses a set of recursive procedures to recognize its input with non backtracking is called a recursive-descent parser. The recursive procedures can be quite easy to write.

## What are the problems in top down parsing

The problems in top down parsinga) Left recursion.b) Backtracking.c) The order in which alternates are tried can affect the language accepted.

## Define ambiguity

A grammar that produces more than one parse tree for some sentence is said to be ambiguous. An ambiguous grammar is one that produces more than one leftmost or more…

## Define context-free language

Given a grammar G with start symbol S, we can use the ==> relation to define L(G) , the language generated by G. We say a string of terminals w…

## Write a grammar to define simple arithmetic expression

Grammar to define simple arithmetic expressionexpr ->expr op exprexpr ->(expr)expr -> – exprexpr ->idop -> + | – | * | / | ^