Question: Consider the following pseudocode. Suppose this was code for a language with the declaration - order rules of C ( but with nested subroutines )
Consider the following pseudocode.
Suppose this was code for a language with the declarationorder rules of but with nested
subroutines that is names must be declared before use, and the scope of a name extends from its
declaration through the end of the block. At each print statement lines indicate which
declarations of a and are in the referencing environment. For any of these following questionssub
problems, if there is a static compiletime semantic error according to the rules, indicate and
describe what the error is
a Using rules, what does the program print or will the compiler identify static semantic errors?
Assume proceduresfunctions can be nested and classes do not exist.
b Repeat the exercise for the declarationorder rules of # names: local, nonlocal, nonclass
member names must be declared before use, but the scope of a name is the entire block in which
it is declared.
c Repeat the exercise using Modula scope rules: all names can be declared in any order, and
their scope is the entire block in which they are declared.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
