SOLVED:CSC 446 Assign #6

$55.00

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (4 votes)

Add the following grammar rules to your parser.

 

StatList                        ->        Statement ; StatList|

e

Statement                    ->         AssignStat       |

IOStat

AssignStat                   ->        idt  =  Expr

IOStat                          ->        e

Expr                            ->        Realtion

Realtion                      ->        SimpleExpr

SimpleExpr                 ->        SignOp Term MoreTerm

MoreTerm                   ->        Addop Term MoreTerm

e

Term                           ->        Factor  MoreFactor

MoreFactor                 ->         Mulop Factor MoreFactor

e

Factor                          ->        id |

num     |

( Expr )

Addop                         ->        + | – | ‘||’

Mulop                         ->         *  | /  | &&

SignOp                        ->        ! | – | e

 

Add the appropriate actions to your parser to check for undeclared variables used in an assignment statement.