CSC 351 - Chapters 1, 2, 3, 4, 5 Flashcards

0
Q

Scientific application language?

A

Fortran

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

Why study programming languages?

A
  • increased capacity to express ideas
  • improved background for choosing an appropriate language
  • increased ability to learn a new language
  • better understanding of the significance of implementation
  • better use of languages already known
  • overall advancement of computing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Business application language?

A

COBOL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Artificial Intelligence language?

A

LISP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

System software languages?

A

C, C++

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Web software languages?

A

JavaScript, PHP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Readability and what characteristics are associated with it?

A
The ease of which programs can be read and understood.
• simplicity
• orthogonality
• data types 
• syntax design
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Writability and what characteristics are associated with it?

A
The measure of how easily a language can be used to create programs for a chosen problem domain.
• simplicity
• orthogonality
• data types
• syntax design
• support for abstraction
• expressivity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is Reliability and what characteristics are associated with it?

A
A program is reliable if it performs to its specifications under all conditions. 
• simplicity
• orthogonality
• data types
• syntax design
• support for abstraction
• expressivity
• type checking
• exception handling
• restricted aliasing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the von Neumann architecture?

A

An architecture that most popular languages have been designed around. These are imperative languages. Both data and programs are stored in the same memory. The CPU is separate from the memory. Instructions are piped from memory to the CPU. Results are piped back to memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is compilation implementation?

A

Programs are translated into machine language which can be directly executed on the computer.
C, C++, COBOL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is pure interpretation implementation?

A

Programs are interpreted by another program called an interpreted, with no translation at all. Execution is slower than compiled systems and often requires more space. Allows easy implementation of many source level debugging operations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is hybrid implementation?

A

A compromise between compilers and pure interpreters. High level language programs are translated to an intermediate language designed to allow easy interpretation.
Perl

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What language is UNIX mostly written in?

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How can operator overloading harm the readability of a program?

A

A single operator can have more than one meaning, causing confusion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the disadvantage of having too many features in a language?

A

A language is more difficult to learn. Programmers often learn a subset of the language and ignore its features.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What construct of a programming language provides process abstraction?

A

The use of a subprogram

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Why is type checking important?

A

The earlier errors in programs are detected, the less expensive it is to make the required repairs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is aliasing?

A

Having 2 or more distinct names that can be used to access the same memory cell

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is exception handling?

A

The ability to intercept run time errors, correct then, then continue.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What two language deficiencies were discovered as a result of the research in software development?

A

Incompleteness of type checking and inadequacy of control statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What are the three fundamental features of an object oriented programming languages

A

Data abstraction, inheritance, dynamic method building

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What language was the first to support the features of OOP?

A

Smalltalk

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What are two language design criteria that are in direct conflict with each other?

A

Reliability and cost

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What role does the symbol table play in a compiler?

A

It serves as a database for the compilation process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What is the van Neumann Bottleneck?

A

The speed of the connection between a computers memory and its processor

26
Q

Was Java implemented with a pure interpreter, a hybrid implementation system, or a compiler?

A

Hybrid implementation system

27
Q

What are the advantages/disadvantages of using eclipse?

A
Pros:
• syntax checking
• debugger tool
Cons:
• large and complex
28
Q

What is syntax?

A

The form of expressions, statements and program units; the grammar/structure

29
Q

What is semantics?

A

The meaning of the syntax

30
Q

What is a sentence?

A

A sequence of lexemes

31
Q

What is a lexeme?

A

Units of sentences; include numeric literals, operators and special words

32
Q

What is a token?

A

A category of lexemes (identifiers, reserved words, equals sign)

33
Q

What is a language recognizer?

A

A device to identify if a sentence is in a language

34
Q

What is language generator?

A

A device that is used to generate the sentences of a language

35
Q

What is BNF?

A

Backus Naur Form, the way in which programming languages are specified. It uses abstractions for syntactic structures. The abstractions in a BNF description are called nonterminals, the lexemes and tokens are called terminals. A rule is recursive if it’s LHS appears in its RHS.

36
Q

What is a metalanguage?

A

A language that is used to describe another language. BNF is a metalanguage for programming languages.

37
Q

What three extensions are common to most EBNFs?

A
  • The use of brackets to indicate an optional part
  • the use of braces to indicate that the enclosed part can be repeated or left out
  • multiple choice options separated by an or operator
38
Q

What is a state diagram?

A

A directed graph; nodes are labeled with state names and arcs are labels with input characters.

39
Q

What is a regular grammar?

A

Generative devices for regular languages. Also known as a regular expression

40
Q

What is finite automata?

A

State diagrams of the form used for lexical analyzes. Finite automata can be designed to recognize members of a class of languages called regular languages.

41
Q

Why is lexical analysis separated from syntax analysis?

A
  • simplicity, techniques for lexical analysis are less complex than those required for syntax analysis
  • efficiency
  • portability, the lexical analyzer is platform dependent and the syntax analyzer is not
42
Q

What is a lexical analyzer?

A

A pattern matches; it attempts to find a substring of a given string of characters that matches a given character pattern

43
Q

What are the steps to building a lexical analyzer?

A
  • write a formal description of the token patterns of the language using a descriptive language related to regular expressions
  • draw a state diagram that describes the token patterns of the language and write a program to implement it
  • draw a state diagram that describes the token patterns of the language and hand construct a table driven implementation
44
Q

Why are character classes used rather than individual characters for a lexical analyzer?

A

Because a much more compact state diagram can be built

45
Q

How do we name things?

A

Names are a string of characters used to identify an entity in a program. Each programming language has a set of rules for name syntax

46
Q

What is a special word?

A

They’re words used to make programs more readable by naming actions to be performed

47
Q

What is a keyword?

A

A word in a programming language that is special only in certain contexts.

48
Q

What is a reserved word?

A

A special word in a language that cannot be used as a name

49
Q

What are variables?

A

An abstraction of a computer memory cell or collection of cells. Variables can be characterized by name, address, value, type, lifetime and scope.

50
Q

What is a binding?

A

An association between an attribute and an entity, such as a variable and its type.

51
Q

What is static binding?

A

A binding is static if it first occurs before run time begins and remains unchanged throughout execution

52
Q

What is dynamic binding?

A

If the binding first occurs during runtime or can change in the course of execution it’s dynamic.

53
Q

What is the lifetime of a variable?

A

The time that a variable is bound to a specific memory location.

54
Q

What is a variables run time environment?

A

The place that the variable is referenced

55
Q

What are static variables?

A

Variables bound to memory cells before execution begins and remains bound to the same cell until execution terminates

56
Q

What are stack-dynamic variables?

A

Variables whose storage bindings are created when their declaration statements are elaborated, but whose types are statically bound.

57
Q

What are explicit head-dynamic variables?

A

Variables that are nameless memory cells that are allocated and deal located by explicit run time instructions

58
Q

What are implicit heap-dynamic variables?

A

Variables bound to heap storage only when they are assigned values.

59
Q

What is scope?

A

The scope of a variable is the range of statements to which the variable is visible.

60
Q

What is static scope?

A

A

61
Q

What is global scope?

A

A

62
Q

What is dynamic scope?

A

A

63
Q

What is a named constant?

A

A variable that is bound to a value only once. They are useful aids to program readability and reliability.