Question: Consider the following pseudocode: What does the program print or will the compiler identify static semantic errors if: a) names must be declared before use,

  1. Consider the following pseudocode:

 Consider the following pseudocode: What does the program print or will

What does the program print or will the compiler identify static semantic errors if:

a) names must be declared before use, and the scope of a name extends from its declaration through the end of the block?

b) names must be declared before use, but the scope of a name is the entire block in which it is declared?

c) names can be declared in any order, and their scope is the entire block in which they are declared?

  1. Suppose that procedure swap is declared as follows (using Pascal syntax):

the compiler identify static semantic errors if: a) names must be declared

Describe the effect of the procedure call swap(i, A[i]) assuming that macro expansion is used.

- : ? : ;F- F procedure main() a: integer 11 b: integer : 2 2 C: integer :-) procedure first b: integer :c C: integer :- procedure second) print a, b, c a: integer : 2 --body of first second) print a, b, c --body of main first print a, b, c 10. procedure swap(x,y: integer); procedure f(a): integer; begin 1 f*) ay return x end fi begin swap y = f(x) and swap

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!