Compiler Design's nullability property with C++ object oriented programming

Completed Posted Nov 28, 2012 Paid on delivery
Completed Paid on delivery

the aim of the project is writing C++ code with object oriented programming. the problem is reducibility to empty string(nullability ) of a non-terminal symbol in compiler design.

If a non-terminal symbol has a nullability property then the non-terminal symbol must be reduce to the empty string( ?) in one or more step.

a) direct to the empty string A -> ?

or

b) if there is a A -> B1B2..Bn derivational rule and B1, B2, .., Bn can be reduce to empty string.

Example 1: A non-terminal has nullability property.

A -> BC

B -> A | Ac | ?

C -> aB | Cb | ?

Example 2: E’ and T’ have nullability . E,T and F have not nullability

E -> TE’

E’ -> +TE’| ?

T -> FT’

T’ -> *FT’| ?

F -> (E) | id | num

C++ Programming : Aim find all the non-terminal symbols in a given a compiler design grammar. The program read the derivational rule of the grammar from a text or word( ? can not shown in text document you can use 'e' for ?) document. Then program palce the grammar in an appropriate data structure (stack,queue etc. there is not a constraint). Grammar symbols shown like that: non-terminal symbols: uppercase character. terminal symbols : lowercase character.

For the first example : A,B,C non-terminal, a,b,c,? terminal.

For the second example : E’ , T’ , E, T , F non-terminal. id,num, ? terminal symbol.

The Program's output : 1) The list of the grammar derivational rule. 2) list of the non-terminal sysmbols. 3) the list of the non-terminals which has reducibility to empty string (nullability) property.

Output Example :

Grammar Derivation rule :

E -> TE’

E’ -> +TE’| ?

T -> FT’

T’ -> *FT’| ?

F -> (E) | id | num

Non-Termianls : E’ , T’ , E, T , F

non-terminals which has reducibility to empty string (nullability) property: E’ , T’

C++ Programming

Project ID: #3994467

About the project

3 proposals Remote project Active Nov 29, 2012

Awarded to:

abakiaydin

Hi, could you please check your pm?

$100 USD in 2 days
(3 Reviews)
3.0

3 freelancers are bidding on average $100 for this job

nani01029x

Let me help you. Check your pm for more details.

$120 USD in 2 days
(15 Reviews)
3.7
cloe

I have experience with those types of projects. The solution will be fully commented. Regards, Cloe

$80 USD in 2 days
(0 Reviews)
0.0