Study Guide Jeopardy Flashcards
What is a graphical IR?
representation of structure and semantics of code in a visual way
What is a syntax tree(Concrete and Abstract)
Rooted, undirected graph containing no cycles.
Flows from start symbol, to terminal, where state is root and terminals are leaves, interior nodes are all non terminals
What is an abstract syntax tree?
A CST, with details abstracted away. Near source level representation.
What is a directed acyclic graph?
Directed graph with no cycles, partially ordered.
What is a linear IR?
Representation of code as a sequence of instructions.
What is postfix notation?
linear IR where expressions are written at the end of the operator (ab+)
What is Three Address code?
Linear IR, 4 tuple, closely resembling assembly for modern machines
What are the benefits of an intermediate language
Completely decouples front and backends
Useful for debugging
Why might you use graphical IR over linear? And vice versa?
Graphical: good for analyzing and optimizing code and showing relationships
Linear: better for code generation and execution, concise and closer to machine code
What is the value of utilizing an IR?
Simplifies compiler design by breaking it into modular phases
What is syntax-directed translation?
Translation scheme by which the parse of the source program is used to derive the meaning of the program using semantic rules or actions associated with grammar symbols
What is a syntax-directed definition?
Context free grammar augmented with a set of attributes and a set of rules which guides semantic analysis
Which direction along a parse tree do synthesized and inherited attributes move information?
Synthesized attributes are used to pass information up the parse tree
Inherited attributes are used to pass information down parse tree
What is a variable?
A named storage location in a program that holds the value which determines what data it can store.
What is type coercion? Is it good or bad?
When a type conversion is initiated by the compiler or runtime environment. Like converting an int into a float