answersLogoWhite

0


Best Answer

Run-Time Environments

The allocation of data objects is managed by the run-time support package, consisting of routines loaded with the generated target code. The design of run-time support package is influenced by the semantics of procedures. Each execution of the procedure is referred to as an activation of the procedure. If the procedure is recursive several of its activations may be alive at the same time.

Source Language IssuesProceduresA procedure definition is a declaration that, in its simplest form, associates an identifier with a statement. The identifier is the procedure name, and the statement is the procedure body. Procedures that return values are called function in many languages; however, it is convenient to refer them as procedures. A complete will also be treated as a procedure.

When a procedure name appears within an executable statement, we say that the procedure is called at that point. The basic idea is that a procedure call executes the procedure body.

Some of the identifiers appearing in a procedure definition are special, and are called formal parameters (or just formals) of the procedure. Arguments known as actual parameters may be passed to a called procedure they are substituted for the formals in the body.

Activation Trees

We make the following assumptions about the flow of control among procedure during the execution of a program:

  1. Control flows sequentially, that is, the execution of a program consists of a sequence of steps, with control being at some point in the program at each step.
  2. Each execution of a procedure starts at the beginning of the procedure body and eventually returns control to the point immediately following the place where the procedure was called. This means the flow of control between procedures can be depicted using trees.

Each execution of a procedure body is referred to as an activation of the procedure. The lifetime of an activation of a procedure p is the sequence of steps between the first and last steps in the execution of the procedure called by them and so on. In general the term "lifetime" refers to a consecutive sequence of steps during the execution of a program.

If a, b are procedure then their lifetimes are either non-overlapping or are nested. That is if b is entered before a, is left then control must leave b before it leaves a. this nested property of activation lifetime can be illustrated by inserting two print statements in each procedure one before the first statement of the procedure body and the other after the last. The first statement prints enter followed by the name of the procedure and the values of the actual parameters; the last statement prints leave followed by the same information.

A procedure is recursive if a new activation can begin before an earlier activation of the same procedure has ended. A recursive procedure need not call itself directly; p may call another procedure q, which may then call p through some sequence of procedure calls. We can use tree, called an activation tree, to depict the way control enters and leaves activations. In an activation tree,

1. Each node represents an activation of a procedure,

2. The root represents the activation of the main program,

3. The node for a is the parent of the node for b if and only if the control flows from activation a to b, and

4. The node for a, is to the left of the node for b if and only if the lifetime of a, occurs before the lifetime of b.

Since each node represents a unique activation and vice versa it is convenient to talk of control being at a node it is in the activation represented by the node.

Control Stacks

the flow of control in a program corresponds to a depth-first traversal of the activation tree that starts at the root ,visits a node before its children, and recursively visits children at each node left to right order. the output in fig 7.2 can therefore be reconstructed by traversing the activation tree in fig7.3,printing enter when the node for an activation is reaches for the first time and printing leave after the entire sub tree of the node has been visited during the traversal.

We can use a stack, called a control stack to keep track of live procedure activations. The idea is to push the node for activation onto the control stack as the activation begins and to pop the node when the activation ends.

Then the contents of the control stack are related to the paths to the root f the activation tree. When the node n is at the top of the control stack, the stack contains the nodes along the path from n to the root.

Example 7.2:fig 7.4 shows nodes from the activation tree of fig 7.3 that that have been reached when control enters the activation represented by q(2,3).Activations with labels r, p(1,9),p(1.3),and q(1,0) have executed to completion, so the figure contains dashed lines to their nodes. The solid lines mark the path from q (2, 3) to the root.

At this point the control stack contains the following nodes along this path to the root (the top of the stack is to the right)

s, q(1,9),q(1,3),q(2,3) and the other nodes.

The Scope of a Declaration

A declaration in a language is a syntactic construct that associates information with a name. Declarations may be explicit, as in the Pascal fragment

Var i : integer;

Or they may be explicit. For example, any variable name starting with I is or assumed to denote an integer in a FORTRAN program unless otherwise declared.

There may be independent declarations of the same name in the different parts of the program. The scope rules of a language determine which declaration of a name applies when the name appears in the text of a program. In the Pascal program in fig 7.1, i am declared thrice, on lines 4, 9 and 13, and the users of the name i in procedures read array, partition and quick sort are independent of each other. The declaration on line 4 applies to uses of i on line 6.tht is, the two occurrences of i on the line 6 are in the scope of the

The portion of the program to which a declaration applies is called the scope of the declaration applies is called the scope of the declaration .An occurrence of a name in a procedure is called to be local to the procedure if it is the scope of a declaration within the procedure; otherwise, the occurrence is said to be non-local.

The distinction between local and the non-local names carries over to any syntactic construct that can have declarations within it.

While the scope is a property of the declaration of a name, it is sometimes convenient to use the abbreviation "the scope of a name x" for "the scope of the declaration of name x that applies to this occurrence of x". In this sense, the scope of ion line 17 in fig7.1 is the body of quick sort. At compile time, the symbol table can be to find the declaration that applies to an occurrence of a name. When a declaration is seen, a symbol table entry is created for it. As long as we are in the scope of the declaration, its entry is returned when the name in it is looked up. Symbol tables are discussed in section 7.6a

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are source language issues in run time environment?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is a compiler and an interpreter?

a compiler translates an entire program and then executes it while an interpreter translates and executes one line of a program at time


Why language is the source of misunderstanding?

Language is the source of misunderstanding because of the confusion that takes place when two persons of different nationalities who only speak their own language try to talk with each other. The Bible speaks of the story of the construction of the Tower of Babel. God gave these people who spoke only one language at that time different languages to speak so that they won't understand each other. The people stopped building the tower as a result and dispersed to the ends of the earth to find their own territory.


How constraints are implemented in object oriented systems?

Constraints, such as transaction throughput, response time, run-time platform, development environment, or programming language, are implemented, by using some specific principles of an object oriented systems, which are mentioned below-AbstractionEncapsulationIdentityModularityHierarchyTypingConcurrency, andPersistence


What is the difference between data binding and encapsulation?

Data binding is to tie 2 data sources together at runtime. This technique is very useful in writing software that requires different source of data in different environments (design, test, and production environment; client's region, time zone, and the language used)Encapsulation is to hide information (data and/or behaviors). This technique is used for design and coding only. It has nothing or little to do with runtime.These 2 techniques may work together from time to time, but I don't think they have anything to do with each other.


Is COBOL a compiler programming language?

COBOL, the COmmon Business Oriented Language, is considered one of the forerunners of modern programming. Designed in the 1950s, it was considered the most advanced language of its time. It was commonly programmed on punch cards, which were in common use before disk storage as an input medium for stored procedures. It also had constructs considered revolutionary at that time, including self-modifying code.

Related questions

What is compile time and run time?

Compile time is when the compiler translates your source code into computer language. Run time is when the actual program runs.


What is compiled time and run time?

Compile time is when the compiler translates your source code into computer language. Run time is when the actual program runs.


Tips how to avoid compile time errors in java?

The best tip to avoid compile time issues is to follow the coding guidelines and syntactical rules specified in the language. Every programming language has such guidelines mentioned while creating the language. If we follow them, then we will not get compile time errors.


How can you learn to speak Chinese?

The time it takes to learn a language varies, and it depends on many factors, such as the frequency of participation in Chinese language courses, practice, language environment and so on. But, as long as you want to learn Chinese, study diligently,, attend Chinese language courses frequently and practice more in a Chinese-speaking environment, you will be able to master the language over time, the same as when you learned English.


What is a naturalistic learner?

a naturalistic learner is someone who learns the language at the same time as learning to communicate in it source: Second Language Acquisition-Rod Ellis


State cell environment needed for survival?

proper environment (temperature, humidity, salinity, etc.) source of oxygen (most of the time) source of energy (food) source of minerals all of these dependent on the type of organism.


What is time environment?

What is time environment in a story


Can primary source be difficult to read?

Yes, primary sources can sometimes be difficult to read due to factors such as old language, handwriting, or technical language specific to the time period or field. One may need additional context or background knowledge to fully understand the contents of a primary source.


How is Compiler Different from Interpretor?

A traditional compiler converts the source code to machine code; many recent compilers convert the source code to some intermediate language instead. An interpreter runs the source code directly, which means the source code is basically "interpreted" one line at a time.


How does PHP work?

PHP is a programming language that stands for PHP Hypetextual Processing (recursive acronym). Technically PHP is just a program that lives on your computer which interprets code and executes PHP statements line by line. The PHP interpreter will execute changes to your computer or run-time environment based on the low-level instructions that the programmer issues.


Which would breed the most bacteria?

The amount of bacteria that could breed in a given time would depend on several factors. Bacteria require a source of nutrients, a warm environment, an energy source such as oxygen, and pH to grow and reproduce quickly.


What is the meaning of 'slang'?

The origin and meaning of the word 'slang' are unknown. The word dates back the the 18th century, and may have its source in the 'argot' or thieves' language of the time.