Other Concepts
Synthesized Translation
The term synthesized translation includes two ideas:
- A complex expression is constructed from subexpressions
- The translation of a complex expression is constructed in a mechanical way form the translations of its subexpressions
if x > max then max := x
is constructed of (x > max) and (max := x), therefore, ( if (> x max) (:= max x) )
Controllability and Observability
These are central concepts from control theory. We will define them as :
- Controllability: the ability to chance the behavior of a system by changing its parameters.
- Observability: the ability to observe the behavior of a system well enough to control it.
In order to control a system, both controllability and observability are required.
The implications For Large Software Systems
- Aspects of software that cannot easily be observed will never be debugged
- All Large Software Systems must have observability built in
- Observability is a requirement, not a luxury. The time spent building in observability will be well repaid.
- In-process traces can be turned on by setting bits in a bit vector.
Comparison of Parsing Techniques
Recursive Descent and Operator Precedence
Advantages:
- easy to control, understand
- Good error messages can be produced
Disadvantages:
- More code to write
- Grammar not as clear
Parser Generator (yacc)
Advantages
- Less code to write
- Grammar is clear and easy to change
Disadvantages:
- The programmer may get stuck on grammar errors that are hard to understand
- Error messages during compilation may be unhelpful and far from the actual error
Lexical Scoping
Scope is the region of program text over which a symbol can be referenced.
With lexical scoping, a name is defined when it can be looked up in the lexicon at the point of use.
Structure References
- Every expression has type
- Types from a tree structure (a graph when pointers to types are included, but still treated as a tree)
- The structure references in source code specify a traversal down the type tree
- A reference to a part of a structure depends on the type of the structure; the results of the reference are:
- An address expression for the substructure
- A new type for the substructure
Citation:
- Aho, Lam, Sethi, & Ullman, Compilers: Principles, Techniques, and Tools
- UT Austin CS375: Compilers by G.Novak.