, , , , , , , , ,

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

$25

File Name: Csc_446_assign__2_given_the_following_grammar_for_a_subset_of_ada______prog______________________________________________________________________________________procedure_idt_args_is.zip
File Size: 1714.44 KB

5/5 - (1 vote)

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.

 

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

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