SOLVED:CSC 446 Assign #6

$55.00

Original Work ?

Download Details:

  • Name: Assignment6-2-s8yute.zip
  • Type: zip
  • Size: 659.94 KB

Category: You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

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.