CSC 351 - Chapters 1, 2, 3, 4, 5 Flashcards
Scientific application language?
Fortran
Why study programming languages?
- 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
Business application language?
COBOL
Artificial Intelligence language?
LISP
System software languages?
C, C++
Web software languages?
JavaScript, PHP
What is Readability and what characteristics are associated with it?
The ease of which programs can be read and understood. • simplicity • orthogonality • data types • syntax design
What is Writability and what characteristics are associated with it?
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
What is Reliability and what characteristics are associated with it?
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
What is the von Neumann architecture?
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.
What is compilation implementation?
Programs are translated into machine language which can be directly executed on the computer.
C, C++, COBOL
What is pure interpretation implementation?
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.
What is hybrid implementation?
A compromise between compilers and pure interpreters. High level language programs are translated to an intermediate language designed to allow easy interpretation.
Perl
What language is UNIX mostly written in?
C
How can operator overloading harm the readability of a program?
A single operator can have more than one meaning, causing confusion
What is the disadvantage of having too many features in a language?
A language is more difficult to learn. Programmers often learn a subset of the language and ignore its features.
What construct of a programming language provides process abstraction?
The use of a subprogram
Why is type checking important?
The earlier errors in programs are detected, the less expensive it is to make the required repairs
What is aliasing?
Having 2 or more distinct names that can be used to access the same memory cell
What is exception handling?
The ability to intercept run time errors, correct then, then continue.
What two language deficiencies were discovered as a result of the research in software development?
Incompleteness of type checking and inadequacy of control statements
What are the three fundamental features of an object oriented programming languages
Data abstraction, inheritance, dynamic method building
What language was the first to support the features of OOP?
Smalltalk
What are two language design criteria that are in direct conflict with each other?
Reliability and cost
What role does the symbol table play in a compiler?
It serves as a database for the compilation process
What is the van Neumann Bottleneck?
The speed of the connection between a computers memory and its processor
Was Java implemented with a pure interpreter, a hybrid implementation system, or a compiler?
Hybrid implementation system
What are the advantages/disadvantages of using eclipse?
Pros: • syntax checking • debugger tool Cons: • large and complex
What is syntax?
The form of expressions, statements and program units; the grammar/structure
What is semantics?
The meaning of the syntax
What is a sentence?
A sequence of lexemes
What is a lexeme?
Units of sentences; include numeric literals, operators and special words
What is a token?
A category of lexemes (identifiers, reserved words, equals sign)
What is a language recognizer?
A device to identify if a sentence is in a language
What is language generator?
A device that is used to generate the sentences of a language
What is BNF?
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.
What is a metalanguage?
A language that is used to describe another language. BNF is a metalanguage for programming languages.
What three extensions are common to most EBNFs?
- 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
What is a state diagram?
A directed graph; nodes are labeled with state names and arcs are labels with input characters.
What is a regular grammar?
Generative devices for regular languages. Also known as a regular expression
What is finite automata?
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.
Why is lexical analysis separated from syntax analysis?
- 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
What is a lexical analyzer?
A pattern matches; it attempts to find a substring of a given string of characters that matches a given character pattern
What are the steps to building a lexical analyzer?
- 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
Why are character classes used rather than individual characters for a lexical analyzer?
Because a much more compact state diagram can be built
How do we name things?
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
What is a special word?
They’re words used to make programs more readable by naming actions to be performed
What is a keyword?
A word in a programming language that is special only in certain contexts.
What is a reserved word?
A special word in a language that cannot be used as a name
What are variables?
An abstraction of a computer memory cell or collection of cells. Variables can be characterized by name, address, value, type, lifetime and scope.
What is a binding?
An association between an attribute and an entity, such as a variable and its type.
What is static binding?
A binding is static if it first occurs before run time begins and remains unchanged throughout execution
What is dynamic binding?
If the binding first occurs during runtime or can change in the course of execution it’s dynamic.
What is the lifetime of a variable?
The time that a variable is bound to a specific memory location.
What is a variables run time environment?
The place that the variable is referenced
What are static variables?
Variables bound to memory cells before execution begins and remains bound to the same cell until execution terminates
What are stack-dynamic variables?
Variables whose storage bindings are created when their declaration statements are elaborated, but whose types are statically bound.
What are explicit head-dynamic variables?
Variables that are nameless memory cells that are allocated and deal located by explicit run time instructions
What are implicit heap-dynamic variables?
Variables bound to heap storage only when they are assigned values.
What is scope?
The scope of a variable is the range of statements to which the variable is visible.
What is static scope?
A
What is global scope?
A
What is dynamic scope?
A
What is a named constant?
A variable that is bound to a value only once. They are useful aids to program readability and reliability.