Concepts of Programming Lang Exam 1

86 flashcardsby Lulu
Study these flashcardsFree · spaced repetition · iPhone, Android, Mac & web

All cards

1
What are the four major language evaluation criteria?
Readability, Writability, Reliability, Cost
2
What does readability mean?
The ease with which programs can be read and understood
3
What does writability mean?
The ease with which a language can be used to create programs
4
What does reliability mean?
Conformance to specifications and correct execution
5
What does cost include in programming languages?
Training, writing, execution, reliability, and maintenance costs
6
What is orthogonality?
A small set of primitive constructs that can be combined in many legal ways
7
What language is famous for orthogonal design?
ALGOL 68
8
What computer architecture influenced imperative languages?
Von Neumann Architecture
9
What are the main characteristics of imperative languages?
Variables, assignment statements, and iteration
10
What are the four major language categories?
Imperative, Functional, Logic, Markup/Programming Hybrid
11
Which language is associated with AI and symbolic computation?
LISP
12
Which language is associated with scientific computing?
FORTRAN
13
Which language is associated with business applications?
COBOL
14
Which language is associated with systems programming?
C
15
What is the von Neumann bottleneck?
The speed limitation caused by data transfer between memory and CPU
16
What are the three implementation methods?
Compilation, Interpretation, Hybrid Implementation
17
Which implementation method has slow translation but fast execution?
Compilation
18
Which implementation method executes programs directly without translation?
Pure Interpretation
19
Which implementation method uses intermediate code?
Hybrid Implementation
20
What is lexical analysis?
The compiler phase that converts characters into lexical units
21
What is syntax analysis?
The compiler phase that converts lexical units into parse trees
22
What is semantic analysis?
The compiler phase that checks meaning and generates intermediate code
23
What is code generation?
The compiler phase that produces machine code
24
What is linking and loading?
Combining system program units with user code into an executable
25
What is JIT compilation?
Compiling intermediate code into machine code when subprograms are called
26
What is a preprocessor?
A program that processes macros before compilation
27
What does #include do?
Includes code from another file before compilation
28
What does #define do?
Creates macro substitutions before compilation
29
What is syntax?
The form or structure of expressions, statements, and program units
30
What is semantics?
The meaning of expressions, statements, and program units
31
What is a lexeme?
The smallest syntactic unit of a language
32
What is a token?
A category of lexemes
33
Give an example of a lexeme and token pair.
sum is a lexeme and identifier is its token
34
What is a recognizer?
A device that accepts or rejects strings in a language
35
What compiler component acts as a recognizer?
The parser or syntax analyzer
36
What is a generator?
A device that generates valid sentences of a language
37
What does BNF stand for?
Backus-Naur Form
38
Who invented BNF?
John Backus
39
Who developed context-free grammars?
Noam Chomsky
40
What is a metalanguage?
A language used to describe another language
41
What is the left hand side of a BNF rule?
The nonterminal being defined
42
What is the right hand side of a BNF rule?
The definition of the nonterminal
43
What is a nonterminal symbol?
An abstraction used in grammar rules
44
What is a terminal symbol?
A token or lexeme that cannot be expanded further
45
What is the start symbol?
The special nonterminal where derivation begins
46
What symbol represents OR in BNF?
|
47
What is recursion in a grammar?
When the LHS appears in its own RHS
48
What is a derivation?
Repeated application of grammar rules
49
What is a sentential form?
Any intermediate string in a derivation
50
What is a sentence in grammar terminology?
A sentential form containing only terminals
51
What is a leftmost derivation?
A derivation that expands the leftmost nonterminal first
52
What is a parse tree?
A hierarchical representation of a derivation
53
When is a grammar ambiguous?
When a sentence can have multiple parse trees
54
How can ambiguity be removed?
By using precedence and associativity rules
55
What does associativity determine?
The order operators of the same precedence are evaluated
56
What does precedence determine?
The order different operators are evaluated
57
What does [] represent in EBNF?
Optional components
58
What does {} represent in EBNF?
Zero or more repetitions
59
What does () with | represent in EBNF?
Alternative choices
60
What is static semantics?
Rules that cannot be described by context free grammars alone
61
Give an example of static semantics.
Variables must be declared before use
62
What is an attribute grammar?
A CFG extended with semantic information
63
What are synthesized attributes?
Attributes computed from child nodes upward
64
What are inherited attributes?
Attributes passed from parent nodes downward
65
What is operational semantics?
Describing meaning through machine execution steps
66
What is denotational semantics?
Describing meaning using mathematical functions
67
What is axiomatic semantics?
Describing meaning using logic assertions
68
What is a precondition?
An assertion that must be true before execution
69
What is a postcondition?
An assertion that is true after execution
70
What is the weakest precondition?
The least restrictive condition guaranteeing a postcondition
71
What language introduced classes and inheritance?
SIMULA 67
72
What language introduced the first pointer data type?
PL/I
73
What language introduced exception handling?
PL/I
74
What language introduced packages and concurrency?
Ada
75
What language introduced object-oriented programming?
Smalltalk
76
What language introduced formal syntax definition with BNF?
ALGOL 60
77
What language first used time sharing widely?
BASIC
78
What language popularized functional programming?
LISP
79
What language was designed for teaching structured programming?
Pascal
80
What language introduced references and dynamic arrays?
ALGOL 68
81
What language introduced applets and concurrency support?
Java
82
What language is based on formal logic?
Prolog
83
What does PL/I stand for?
Programming Language One
84
What does LISP stand for?
LISt Processing
85
What does PHP stand for?
PHP Hypertext Preprocessor
86
What does JVM stand for?
Java Virtual Machine
Study all 86 cards for free