hi
Yin and Yang Surfboard
Tampilkan postingan dengan label Concept Of Programming Language. Tampilkan semua postingan
Tampilkan postingan dengan label Concept Of Programming Language. Tampilkan semua postingan

Kamis, 06 November 2014

Chapter 6 : Data Types

From Book : Concept Of Programming  Languages 
By : Robert W. Sebesta

REVIEW QUESTION :

16. What array operations are provided specifically for single-dimensioned arrays in Ada?
Answer :
Catenation specified by the ampersand (&).


17. Define row major order and column major order.
Answer :
Row major order is where elements of the array that have as their first subscript the lower bound value of the subscript are stored first.

Column major order has elements of an array that have as their last subscript the lower bound value of that subscript are stored first.

18. What is an access function for an array?

Answer :
Access function maps subscript expressions to an address in the array


19. What are the required entries in a Java array descriptor, and when must they be stored (at compile time or run time)?
Answer :

In Java all arrays are fixed heap-dynamic arrays. Once created, tese arrays keep the same subscript ranges and storage. Secondarily, Java supports jagged arrays and not rectangular arrays. Being a fixed heap-dynamic array the entries will be established and fixed at run time.

20. What is the structure of an associative array?

Answer :
An associative array is an unordered collection of data elements that are indexed by an equal number of values called keys. User-defined keys must be stored.

Read More

Kamis, 23 Oktober 2014

Chapter 5 : Names, Bindings, and Scopes

From Book : Concept Of Programming  Languages 
By : Robert W. Sebesta

REVIEW QUESTION :


16. What is the referencing environment of a statement?
Answer :
The referencing environment of a statement is the collection of all variables that are visible in the statement. The referencing environment of a statement in a static-scoped language is the variables declared in its local scope plus the collection of all variables of its ancestor scopes that are visible.


17. What is a static ancestor of a subprogram? What is a dynamic ancestor of a subprogram?
Answer :
The static ancestors of a subprogram sub() are all the procedures in the program within which the procedure sub() is defined, i.e., the definition of the procedure sub() is nested. The definition of a procedure may be directly nested within only one procedure, called its static parent procedure. However, this static parent procedure may itself be nested within another procedure, and so on up to the main() program. All these procedures are considered to be static ancestors of the procedure sub(). Simply put, the static ancestors are those that strictly contain the subprogram in question.
The dynamic ancestors of a subprogram sub() are all the procedures called before sub() during the execution of a program, that have not yet finished executing. These are the procedures that are waiting for procedure sub() to finish executing before they can terminate. Simply put, dynamic ancestors are those that are called to reach the subprogram in question.

Read More

Minggu, 19 Oktober 2014

Chapter 1 : Preliminaries


From Book : Concept Of Programming  Languages 
By : Robert W. Sebesta


REVIEW QUESTION :

16. What is exception handling ?
Answer :
Exception handling is ability of a program to intercept run time errors as well other unusual conditions, take corrective / repairing measures then resume its function.
Exception handling is the process of responding to the occurrence, during computation, of exceptions – anomalous or exceptional events requiring special processing – often changing the normal flow of program execution. It is provided by specialized programming language constructs or computer hardware mechanisms.
In general, an exception is handled (resolved) by saving the current state of execution in a predefined place and switching the execution to a specific subroutine known as an exception handler. If exceptions are continuable, the handler may later resume the execution at the original location using the saved information. For example, a floating point divide by zero exception will typically, by default, allow the program to be resumed, while an out of memory condition might not be resolvable transparently.

17. Why is readability important to writability ?
Answer :
Readability affects whether it is possible to read a written program and how easy to read and user friendly a code is. A program that is easy to read means it is also easy to maintain the program in case of errors and also makes it easy to write the program. Readibility is very important when we as a programmers work on a team, so that our code can be read easily by another programmers.

Read More

Chapter 4 : Lexical And Syntax Analysis

From Book : Concept Of Programming  Languages 
By : Robert W. Sebesta


REVIEW QUESTION :

16. What is the FIRST set for a given grammar and sentential form?
Answer :
FIRST( ) = {a => * a } (If => * , is in FIRST( ))
in which =>* means 0 or more derivation steps
17. Describe the pairwise disjointness test.
Answer : 
It is a test of non-left recursive grammar that indicates whether left recursion can be done. It requires the ability to compute a set based on the RHS of a given nonterminal symbol in a grammar.

18. What is left factoring ?
Answer : 
Left factoring is the action taken when a grammar leads backtracking while marking parsing.syntax tree.

Read More

Kamis, 09 Oktober 2014

Chapter 3 : Describing Syntax And Semantic

From Book : Concept Of Programming  Languages 
By : Robert W. Sebesta


REVIEW QUESTION :

16. In denotational semantics, what are the syntactic and semantic domains?
Answer :
The mapping functions of a denotational semantics programming language specification, like all functions in math, have a domain and a range, the domain is called the syntactic domain, and the range is called the semantic domain

17. What is stored in the state of a program for denotational semantics?
Answer :    
The state of a program for denotational semantics is the value of all its current variable.

18. Which semantics approach is most widely known?
Answer :  
The Denotational semantics is the most widely known semantics approach. 

Read More

Chapter 2 : Evolution of the Major Programming Language


From Book : Concept Of Programming  Languages 
By : Robert W. Sebesta


REVIEW QUESTION :

16. In what way are scheme and Common LISP opposites of each other ?
Answer :
In its sizes, complexity, adn scoping(scheme: static scoping, Common LISP: both dynamic and static scoping).

17.What dialect of LISP is used for introductory programming courses at
some universities?

Answer :
Scheme is mostly used for courses in functional programming.

18. What two professional organizations together designed ALGOL 60 ?
Answer :
GAMM and ACM (Association for Computing Machinery).

19. What was the goal for developing C ?
Answer :
C has adequate control statements and data-sructuring facilities to allow its use in many application areas. It alse has a rich set of operators that provide a high degree of expressiveness.

Read More