Programming Languages Final Review

Programming Languages Final Review

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

an interpreter

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (286)

Section 1

(50 cards)

an interpreter

Front

translates the source program into a target program in machine code

Back

tape storage is useful because it is

Front

non-volatile and essentially unlimited in capacity

Back

Static semantic checks

Front

depend solely on the structure of the program and can be enforced at compile time

Back

subtype analysis helps in determining whether heap allocation can be used instead of stack allocation

Front

false

Back

in dynamic scoping the bindings are

Front

dependent on the calling sequences

Back

the definition of regular expressions is often extended by string processing programming languages

Front

true /(maybe it depends on the Chomsky language hierarchy)

Back

imperative programming languages

Front

focus on how the program is to accomplish its function and align better with the structure of the underlying hardware

Back

C & C++ differentiate declarations and definitions

Front

to support recursive and mutually-referential types

Back

for an object to be used, it must be reachable by

Front

existing in an active stack frame, being pointed to by a reachable object, being a global object

Back

roles of semantic analyzer include

Front

enforcing all dynamic rules

Back

ada assigns a ___________ to every numeric variable and _____________

Front

specific type //// requires the user to make explicit conversions

Back

the distinctions between language categories, families, etc, are precise and clear cut

Front

false

Back

internal fragmentation of a heap is when the allocated block is to small

Front

false

Back

an optimization is said to be _____ if _______

Front

unsafe //// it might lead to incorrect code in a program

Back

commonly, unintended aliasing occurs because of

Front

reference parameters

Back

Backus-Naur Form (BNF) is

Front

a formal notation for writing context free grammar

Back

regular expressions are used to specify

Front

token formats

Back

comparing argument lists in function calls to that given in the function's declaration is an example of a

Front

semantic check

Back

the kleene plus operator extends regular expressions to the expressiveness of context-free grammar

Front

false

Back

an interpreter and a compiler are similar in structure

Front

through the front end

Back

a variable of an opaque type

Front

may not be otherwise manipulated, may be declared, may be passed as an argument to the defining module

Back

optimistic compilers insert dynamic checks to undo the effects of unsafe code when it goes wrong

Front

true

Back

context free grammars are more expressive than regular expressions (true/false)

Front

true

Back

the expressiveness of regular expressions may be expanded to that of context free grammars by adding

Front

recursion

Back

a regular expression is not allowed to

Front

recurse, even indirectly

Back

semantic rules may be either _______ or _______

Front

static /// dynamic

Back

the front end of the compiler is concerned with

Front

determining what the program means

Back

a context free grammar is used to specify a languages

Front

parse structure

Back

a sentence is a Sentential Form which has only

Front

terminal symbols

Back

a self hosting compiler

Front

is written in its own language

Back

the best programming language for any application is

Front

the one you might learn something from, the one your colleagues are using, the one your boss tells you to use

Back

the Kleene plus operator represents

Front

one or more repetitions of a regular expression

Back

modules into which name must be imported explicitly are called

Front

closed scopes

Back

a precondition failure indicates a problem with

Front

a caller

Back

which of the following is/are not know until runtime?

Front

higher order functions construction, explicitly allocated object sizes, recursion limits

Back

dynamic semantic checks

Front

cannot be enforced until runtime

Back

which one of the following best describes P-code ?

Front

it is an intermediate code

Back

C's dynamic semantic checking helps prevent inadvertent erros

Front

No, C has no dynamic semantic checking at all

Back

symbol table information may be made available at run time

Front

to support symbolic debugging

Back

which of the following is true about static scoping?

Front

scope determination can be made by the compiler

Back

there is always a one-to-one corresponding between names and objects

Front

false

Back

"design by contract" interface specifications are

Front

formal, precise and verifiable

Back

the null(or empty) string is a valid regular expression

Front

true

Back

IEEE 754 is a standard mandating

Front

floating point operations

Back

semantic analysis includes items that are not convenient to capture in the language's

Front

context free grammar

Back

why are stacks used to hold local variables

Front

to make more efficient use of space and to support recursion

Back

operator associativity and precedence are usually expressed in a language's

Front

context free grammar

Back

it is possible for a language to be both declarative and imperative

Front

true

Back

the back end of a compiler is concerned with

Front

generating appropriate target code

Back

a static analyzer is said to be precise if it allows the compiler to determine whether a program will never follow a rule

Front

false

Back

Section 2

(50 cards)

classes are better than modules when

Front

one needs multiple instances

Back

C's dynamic semantic checking helps prevent inadvertent errors

Front

No, C has no dynamic semantic checking at all

Back

floating point representation has how many representations for infinity ?

Front

two, +infinity and -infinity

Back

invariants, preconditions, and postcondtions are statements about the _______ of the program

Front

correctness

Back

in two's complement, a positive number's highest bit is

Front

0

Back

almost all modern machine at the macro level are

Front

are a collection of devices connected to a bus

Back

external fragmentation of a heap is when an allocation request is combines with another request for increased efficiency (true/flase)

Front

false

Back

a machines architecture is the _______ of the ______ of the machine in the abstract

Front

formal specification //// capabilities and operation

Back

two forms of iteration are

Front

enumeration controlled and logically controlled

Back

most operators are

Front

left-associative, binding form left-to-right

Back

the referencing environment

Front

the set if active bindings

Back

semantic analysis can require the presence of a return statement in a function easily

Front

true

Back

an optimization is said to be ________ if ________

Front

speculative //// it usually improves performance but may degrade in some cases

Back

the most important device in a machine's macro architecture is its

Front

processor

Back

static and precise type checking ensure that a variable will always be used in a type safe manner

Front

true

Back

a scope hole occurs for a name when

Front

its binding is overriden by another declaration

Back

why are central reference tables preferred to association lists

Front

a lookup is fast because each slot is a linked list with the most recent binding in front

Back

the difference between modules and classes is that

Front

classes have inheritance and dynamic method dispatch and modules don't

Back

any recursion can be rewritten as iteration

Front

true

Back

in four buts, the two's complement value 1000 represents

Front

minus eight

Back

(*(+12)3) is an example of

Front

cambridge polish notation

Back

big-endian and little-endian are different

Front

orders for storing multiple-byte values in memory

Back

a side effect can cause

Front

the evaluation of the same expression to possible have a different result

Back

recently processor speeds have _______ because of _______

Front

plateaued ///// difficulties in dissipating heat

Back

the use of an uninitialized variable

Front

can always be detected, though it might be inefficient to do so

Back

in four buts, the two's complement representation for -1 is

Front

1111

Back

semantic analysis includes items that cannot be covered by the language's

Front

context free grammar

Back

an association list is

Front

a list of key, value pairs a list of linked list a linked list

Back

a static analyzer is said to be precise if it allows the compiler to determine whether a program will never follow a rule (true/false)

Front

false

Back

there are many many machine architectures in general use

Front

false

Back

bindings may be made at

Front

runtime, compile time, load time

Back

identifying an array index out of bounds error is generally an example of a _______ check

Front

dynamic semantic

Back

which of the following is/are not known until runtime

Front

recursion limits, explicitly allocated object sizes, higher-order functions constructions

Back

recently processor speeds have _______ because of ______

Front

plateaued //// difficulties in dissipating heat

Back

an implementation of a machine's architecture is

Front

how to architecture is realized as a specific machine

Back

various kinds of control flow include

Front

recursion, concurrency and procedural abstraction

Back

fortran's assigned and computed goto statements

Front

were more useful early on because fortran had no better constructs

Back

syntax concerns the ______ of a program while the semantics concern its _______

Front

form //// meaning

Back

polymorphism allows

Front

a single subroutine to accept arguments of multiple types

Back

python provides _________ integer options

Front

essentially infinite precision

Back

Generally only ______ have to care about machine language

Front

compilers (and interpreters)

Back

compilers try to keep as much as possible in registers because

Front

registers are much faster than other types of memory

Back

lisp uses

Front

cambridge polish notation

Back

tail recursion can be converted into

Front

iteration

Back

short-circuit operators

Front

have a defined evaluation order and may leave operands unevaluated

Back

C & C++ differentiate declarations and definitions

Front

to support recursive and mutually referential types

Back

conservative compilers insert dynamic checks to undo the effects of unsafe code when it goes wrong

Front

false

Back

any bits retrieved form memory may be decoded as a legal instruction

Front

false

Back

operators can be

Front

infix, prefix, or postfix

Back

a compiler might generate different machine code for different implementations of the same architecture

Front

true

Back

Section 3

(50 cards)

The C++ using statement can be dangerous because

Front

it can be misused accidentally to make more names visible than desired

Back

in two complements, the four representation of zero is

Front

0000

Back

semantic analysis can require the presence of a return statement in function easily

Front

true

Back

creating the fortran compiler took about ______ because ______

Front

18 staff years //// ti was the first compiler written

Back

the best reason to study programming languages is

Front

to get some background on how to understand all programming languages

Back

java's dynamic semantic checking helps catch malicious errors

Front

yes, that was a prime goal in the design of the language

Back

values stored in memory have no particular

Front

format or type, only a size

Back

lexical analysis converts _____ into _____

Front

characters //// tokens

Back

in java, can a name be used before it is declared?

Front

Yes, for standard package names in the global namespace

Back

assignment operators are generally

Front

right-associative, binding form right to left

Back

which one of the following is not an example of a static semantic check?

Front

pointers are never dereferenced unless they are refer to a valid object

Back

the kleene star operator represents

Front

zero or more repetitions of a regular expression

Back

floating point numbers are represented in

Front

a sign, an exponent, and a significant

Back

it is generally possible to compile a program written in an interpreted language?

Front

Yes, when assumptions are made and there is a fall-back process to handle violation

Back

structured programming emphasized

Front

top-down design and code modularization

Back

fundamental data types include

Front

signed and unsigned integers as well floating point numbers

Back

a context-free grammar that permits multiple parse trees for the same string is

Front

ambiguous

Back

in selection

Front

a choice is made of two or more statements or expression

Back

most compiled language use

Front

lexical scoping rules

Back

dynamic method dispatch is when

Front

a child class overrides a method in a parent and selection is made at compile time

Back

Nested blocks

Front

sometimes cause scope holes

Back

which of the following is not an example of a dynamic semantic check?

Front

a function with a non-void return type a value explicitly

Back

a compiler's optimistic if it applies only optimization that are both safe and effective

Front

false

Back

in java, a primitive type are ______ and object types are ______

Front

values //// references

Back

lexical scoping

Front

is defined in terms of the textual layout of the program and can be determined by the compiler

Back

most network protocols express data in _____ form

Front

big-endian

Back

formal notation is used to describe a language's ______ and _______

Front

syntax //// semantics

Back

in two's complement representation, there

Front

is one more negative number than postive numbers

Back

numbers, identifiers, keywords, operators, and punctuation marks are different kinds of

Front

tokens

Back

syntactical analysis converts _______ into _______

Front

tokens//// a parse tree

Back

floating point numbers are generally

Front

4 and 8 bytes in length

Back

in logically controlled loops, the test must be

Front

at the beginning of the loop, in the middle of the loop, at the end of the loop

Back

compilation and interpretation are so different they cannot be used together

Front

false

Back

why are compilers able to detect more static semantic errors than interpreters?

Front

compilers examine the entire code structure

Back

various kings of control flow include

Front

nondeterminacy, exception handling, and speculation

Back

almost any well defined imperative algorithm can be expressed with only

Front

sequencing, selection and iteration

Back

right-most and left-most derivation from a context free grammar

Front

may produce the same parse tree. It depends on the grammar

Back

the kleene plue operator extends regular expressions to the expressiveness of context-free grammar

Front

false

Back

Names in programming language are a way to

Front

reduce conceptual complexity by hiding irrelevant details and refer to program elements symbolically

Back

a precondition failure indicates a problem with

Front

a caller

Back

historically, the ______ increased faster than the ______

Front

processor's speed //// memory's speed

Back

the C for statement

Front

allows any changes the user wants to variables inside its body

Back

when a loop exits, the value of the loop index variable is

Front

[it depends on the language]

Back

the set of strings defined by a regular expression is known as its

Front

language

Back

most languages have _____ modules

Front

open scope

Back

grammars are categorized into classes based on

Front

the forms of production rules they are allowed to use

Back

a machine's architecture is the _______ of the ________ of the machines in the abstract

Front

formal specification//// capabilities and operations

Back

what was the first high level programming language

Front

fortran

Back

a function call may be executed for

Front

a side effect and its return value

Back

Short-circuit operators

Front

have a defined evaluation order and ma leave operands unevaluated

Back

Section 4

(50 cards)

definite assignment requires that every variable can be shown to have

Front

an assigned value on each path before each use

Back

in two's complement representation, there

Front

is one more negative number than positive numbers

Back

in concurrency, multiple sections of code

Front

are executed at the same time

Back

python provides _____ integer operations

Front

essentially infinite precision

Back

the kleene plus operator extends regular expressions to the expressiveness of cfg

Front

false

Back

changing the value of the loop iteration variable inside the loop results in

Front

undefined behavior

Back

different implementations of the same architecture will all have identical machine languages (true/false)

Front

false

Back

well formed and nested parentheses, brackets are best recognized with

Front

a context free grammar

Back

semantic analysis is required for

Front

enforcement of the rules for a valid program that go beyond the form of the program and determining information required for the generation of the output program

Back

recursion is a central concept in

Front

functional languages

Back

association lists become inefficient when

Front

programs get larger and more complex

Back

a compiler

Front

translates a source program into a target program and then goes away

Back

all of the following are phases of a compile except

Front

numerical analysis

Back

examples of processor functional units include

Front

instruction fetch, instruction decode and ALU operation

Back

in an assignment, a variable name may appear

Front

are and I-value and as an r-value

Back

the von neumann object oriented and scripting language families are distinct and do not overlap

Front

false

Back

a binding to an object that is no longer alive is called a

Front

dangling reference

Back

the definition of a regular expressions is often extended by string processing programming languages

Front

yes

Back

static and precise type checking ensures that a variable will always be used in a type-safe manner (true/false)

Front

true

Back

to avoid ambiguity in derivation from a context-free grammar

Front

the CFG must be defined so that in any derivation, only one parse tree can result

Back

assignments have

Front

an l-value and r-value

Back

context free grammars can match counted lists easily

Front

false

Back

scope analysis help determine whether heap allocation can be used instead of stack allocation

Front

false

Back

all languages have

Front

their own particular set of operators

Back

most of the time the processor is

Front

waiting for the user to do something and running the null job

Back

among other things a regular expression can be

Front

the alternation of two regular expressions and the empty string

Back

in two's complement a negative number's highest bit is

Front

1

Back

the back end of the compiler is concerned with

Front

generating appropriate target code

Back

declarative programming languages

Front

try to get away from irrelevant implementation details and focus on what the program is to do

Back

lexical scoping ....

Front

can be determined by the compiler and is most useful in dynamic binding languages

Back

case or switch statements

Front

are often clearer and cleaner than long if/then.... chains and can be implemented by the compiler in many ways

Back

identifying an array index out of bounds error is generally an example of _____

Front

dynamic semantic

Back

an r-value indicates

Front

the new value to store in an assignment

Back

non-determinacy is when language features may be used

Front

in any combination with consistent meaning

Back

alias analysis can be used to determine when it is safe to

Front

evaluate expressions out of order , cache values in registers, and allow access by concurrent threads

Back

the order of operands and function call argument evaluation is

Front

unspecified

Back

what type of binding does C have?

Front

static binding

Back

roles of the semantic analyzer include

Front

enforcing all dynamic rules

Back

two models of assignment are

Front

the value and the reference models

Back

scientific notation includes

Front

a sign, mantissas and an exponent

Back

floating point representation has how many representations for 0?

Front

two, +0 & -0

Back

sequencing is central concept in

Front

imperative languages

Back

why are central reference table preferred to association list?

Front

lookup is fast because each slot is a linked list with the most recent binding

Back

orthogonality is when language features may be used

Front

in any combination with consistent meaning

Back

loop invariants are normally checked

Front

before and after each loop iteration

Back

JIT(just in time) compilation is

Front

delaying compilation until the last possible moment

Back

even in strict imperative languages, a compiler might reorder statements for optimization reasons

Front

true

Back

historically the _____ increased faster than the _____

Front

processor's speed //// memory speed

Back

resolution of overloaded names is carried out by the

Front

semantic analyzer

Back

in four buts the two's complement representation for -1 is

Front

1111

Back

Section 5

(50 cards)

many common processors are

Front

either little or big endian

Back

the cost of maintaining a system is usually

Front

for more that the cost of developing it

Back

in selectively open scope modules

Front

names are automatically exported but require qualification

Back

there is always a one-to-one correspondence between names and objects

Front

false

Back

recently, increases in machine performance have been because of

Front

increases in the number of functional units/cores

Back

heap storage is preferred to stack storage when

Front

the size of the object may vary and the object may outlive the function that creates it

Back

static and precise type checking ensure that a variable will always be used in a type-safe manner

Front

true

Back

all languages have

Front

their own particular sets of operators

Back

Static semantic rules are those that can be enforced at

Front

compile time

Back

dynamic type checking can never by completely safe

Front

false

Back

A compiler is conservative if it applies only optimizations that are both safe and effective

Front

True

Back

operators are

Front

special, short names for certain functions

Back

reference counting, mark/sweep, copying and generational are kinds of

Front

garbage collection

Back

The same bits in memory might form both legal integer and legal floating point numbers

Front

True

Back

assertions are

Front

expected to be true when execution reaches them and used to check the correctness of a program

Back

Example(s) of processor functional units includes

Front

Registers and L1 Memory Cache

Back

Semantic analysis is required for

Front

Enforcement of the rules for a valid program that go beyond the form of the program. Determining information required for the generation of the output program.

Back

Machine languages tend to be

Front

very similar to each other

Back

In two's compliment representation, there

Front

is one more negative number than positive numbers

Back

values have a type only in how

Front

they are used

Back

overloading is when

Front

two or more different objects have the same name

Back

The X86 Architecture is

Front

little-endian

Back

the three lifespans are

Front

static, stack and heap

Back

Preconditions and Postconditions

Front

are expected to be true at the beggining and end of subroutines

Back

A Post-condition failure indicates a problem with

Front

A Callee

Back

Integer numbers can be

Front

unsigned signed 2,4,8, or 16 byte lengths two's compliment

Back

As there are ________ machine architectures in general use, there are ___________ machine languages.

Front

very few //////// very few

Back

invariants

Front

are expected to be true at all clean points of code

Back

multiway assignment allows

Front

exchanging two variables without using tempopry

Back

a static analyzer is said to be precise if it allows the compiler to determine whether a program will always follow a rule

Front

true

Back

A c\c++ double usually has about how many decimal digits of precision?

Front

about 16

Back

Roles of the semantic analyzer includes

Front

Enforcing all parsing rules

Back

Java has what level of dynamic semantic checking?

Front

High

Back

escape analysis helps in determining whether heap allocation can be used instead of stack allocation

Front

false

Back

In four bits, the two's compliment value 1000 represents what integer?

Front

-8

Back

a processor is able to determine the type of data in memory by examining it

Front

false

Back

the fastest access memory available to the processor is

Front

registers

Back

a function's local variable must always be allocated on the stack

Front

no, not necessarily depending on the language

Back

A machine's macro architecture is

Front

How it is structured as a collection of discrete units

Back

In two's compliment the negation of a number is formed by

Front

inverting the bits adding one and ignoring any overflow

Back

An Invariant failure indicates a problem with

Front

The encompassed code

Back

an bits retrieved from memory may be decoded as a legal instruction

Front

false

Back

floating point operations are generally executed in

Front

hardware

Back

Semantic Analysis can match counted list easily

Front

True

Back

In four bits, the two's compliment representation for -1 is?

Front

1111

Back

once a binding is created between a name and an object , it persists until both the name and the object are destroyed (true/false)

Front

false

Back

forward reference is

Front

a reference to a name that has not yet been declared

Back

programmers generally can distinguish _______ at the functional level

Front

registers from main memory from peripherals

Back

All patterns of bits represent a legal floating point values

Front

True

Back

the semantic analyzer annotates the _____ with any information needed to _____

Front

parse tree //// generate dynamic semantic checks

Back

Section 6

(36 cards)

modules facilitate _________ by _____________

Front

abstraction /////// allowing data to be made private.

Back

The initial goals for COBOL included

Front

Being a portable data processing programming language being self-documenting and readable by non-programmers.

Back

In a regular expression, the kleene star operator represents

Front

zero or more repetitions of a regular expression.

Back

A formal notation is one that is

Front

Sufficiently precise and well defined so that it can be processed mechanically

Back

Operator precedence is

Front

Organized into levels.

Back

in a regular expression, the ? operator represents

Front

zero or one occurrences of a regular expression

Back

Languages tend to differ greatly in _________ but often have very similar aspects of ____________

Front

Syntax////////Semantics

Back

With static scoping, a symbol table must be maintained at run time. (true/false)

Front

False.

Back

Which of the following is/are true about dynamic scoping

Front

The bindings cannot be resolved by examining the program text. In general compiled languages do not use dynamic scoping.

Back

A self-hosting compiler

Front

Is written in its own language

Back

Good reasons to study programming languages include

Front

learning how to select an appropriate language for an application making it easier to learn a new language

Back

LISP, Scheme, ML, and Haskell are examples of _____________ programming languages

Front

Functional

Back

Regular Expressions and Context Free Grammars both occur in the Chomsky Language Hierarchy, Therefore

Front

Nothing special, they are just different levels of expresivitiy

Back

The initial goals for FORTRAN included

Front

reduction in time required to write a program reduction in time required to debug a program reduction in training required to program

Back

The initial goals for LISP included

Front

supporting the investigation of artificial intelligence being a practical mathematical notation for computer programs.

Back

The early big four programming languages were

Front

FORTRAN, ALGOL, LISP, AND COBOL

Back

In C, having + represent both integer and floating point addition is an example of what?

Front

operator overloading

Back

Because a given regular expression may be converted to a finite automaton, its language

Front

might be infinite depending on the regular expression.

Back

Semantics is the ________ as opposed to its _______________

Front

meaning///////form

Back

All programming languages with nested scopes provide a scope resolution operator

Front

false

Back

Regular Expressions cannot express strings that have

Front

arbitrary matching pairs.

Back

Tokens are

Front

The basic building blocks of programs. The shortest strings of characters in a source program that have individual meaning.

Back

C and C++ differentiate declarations and definitions

Front

To support recursive and mutually-referential types.

Back

The Chomsky Language Hierarchy can be used to be differentiate grammars on the basis of

Front

The level of automaton required to recognize the grammar's language. The complexity of the language that can be expressed by the grammar. The storage required to recognize the grammar's language.

Back

Modularization has

Front

less chance of name collision improved chance of data integrity improved compartmentalization of run time erros.

Back

External fragmentation of a heap is when there is enough space, but it is not in one block

Front

true

Back

Which of the following is/are true about static scoping

Front

Scope determination can be made by the compiler

Back

Operator associativity is

Front

either left-to-right, right-to-left, or does-not-apply

Back

The hardware used to construct essentially all computers is ________ in nature

Front

imperative

Back

Context-free grammars are more expensive than regular expressions

Front

Yes

Back

A symbol table must maintain information about only one binding for a given name.

Front

False.

Back

A forward reference is

Front

A reference to a name that has not yet been declared.

Back

Aliasing can cause inefficient code because

Front

the compiler cannot depend on values kept in the registers.

Back

The exact steps to execute a program must be _______________ in a _____________

Front

determinable///////predictable and repeatable fashion

Back

A Regular Expression may refer back to an earlier matched string.

Front

False

Back

An object that outlives all of its references is known as

Front

garbage

Back