Chapter 7 Flashcards
Expressions and Assignment Statements
___ are the fundamental means of specifying computations in a programming language.
Expressions
It is crucial for a programmer to understand both the ___ and ___ of expressions of the used language.
syntax and semantics
To understand expression evaluation, it is necessary to be familiar with the ___ of ___ and ___ evaluation.
order, operator, operand
Although the value of an expression sometimes depends on it, the order of operand evaluation in expressions is often ___ by language designers.
unstated
Implementors being allowed to choose order of operand evaluations in expressions can lead to the possibility of programs producing ___ results in different implementations.
different
Other issues in expression semantics are ___ ___, ___, and ___-___ evaluation.
type mismatches, coercions, short-circuit
The essence of imperative programming languages is the ___ role of assignment statements.
dominant
The purpose of assignment statements in imperative languages is to cause the ___ ___ of changing the values of variables, or the state, of the program.
side effect
An integral part of all imperative languages is the concept of variables whose values change during program ___.
execution.
Functional languages use variables of a different sort, such as the parameters of ___.
functions
Functional languages, like imperative languages, also have declaration statements that bind values to ___.
names
Declarations of functional languages are similar to assignment statements, but do not have ___ ___
side effects
Automatic evaluation of arithmetic expressions similar to those found in mathematics, science, and engineering was one of the ___ of the first ___-___ programming languages.
goals, high-level
Most of the characteristics of arithmetic expressions in programming languages were inherited from convention that had evolved in ___.
mathematics.
In programming languages, arithmetic expressions consist of ___, ___, ___, and ___ ___.
operators, operands, parentheses, and function calls.
An operator can be ___, meaning it has a single operand, ___, meaning it has two operands, or ___, meaning it has three operands.
unary, binary, ternary
In most programming languages, binary operators are ___, which means they appear between their operands.
infix
Some languages, such as Perl, has some operators that are ___, which means they precede their operands.
prefix
Some languages have operators that are ___, which means they come after their operands.
postfix
The ___ precedence and ___ rules of a language dictate the order of evaluation of its operators.
operator, associativity
The ___ ___ rules for expression evaluation partially define the order in which the operators of different precedence levels are evaluated.
operator precedence rules
The operator precedence rules for expressions are based on the ___ of operator priorities, as seen by the language designer.
hierarchy