Assignment Chef icon Assignment Chef

[SOLVED] Csc 446 assign #2 given the following grammar for a subset of ada: prog                                 ->          procedure idt args is

5.0 1 customer review Digital download

Digital download

$25.00

Availability
In stock
Checkout
One item

Need a hand?

Message us on WhatsApp for payment or download support.

WhatsApp QR code

Given the following grammar for a subset of Ada:

 

Prog                                 ->          procedure idt Args is

DeclarativePart

Procedures

begin

SeqOfStatements

end idt;

 

DeclarativePart           ->          IdentifierList : TypeMark ; DeclarativePart | e

 

IdentifierList                ->          idt |

IdentifierList , idt

 

TypeMark                      ->          integert | realt | chart | const assignop Value

 

Value                               ->          NumericalLiteral

 

Procedures                    ->          Prog Procedures | e

 

Args                                  ->          ( ArgList ) | e

 

ArgList                            ->          Mode IdentifierList : TypeMark MoreArgs

 

MoreArgs                       ->          ; ArgList | e

 

Mode                                ->          in | out | inout | e

 

SeqOfStatments           ->          e

 

 

 

Draw the parse trees for the following programs (PLEASE UNDERLINE ALL TOKENS):

 

begin

end two;

 

end six;
begin

end three;

Hint: You will probably want to use your paper sideways. Save this grammar, as it will be used in the next assignment.