CPSC Quiz 5-7 Flashcards
A binding is an association between an attribute and an entity. Identify which is a binding category.
Static, Explicit heap-dynamic, Stack-dynamic
What is an attribute?
An attribute is any quantity associated with a programming construct.
True or False: A variable is a three tuple V = (T, L, C) where T = token, L = lexeme, and C = class.
False
What is a semantic rule?
A semantic rule is a specification declaring which attributes to associate with a given nonterminal.
True or False: An explicitly typed language may also be dynamically typed.
False
Which IR are linear?
TAC, IL
Which IR are graphical?
DAG, CST
True or False: A name is a string of characters used to identify an entity in a program.
True
What are the jobs of the semantic analysis phase?
Type checking, Access control and Scope Checking, Function Parameter Count and Consistency
The edges of a control flow graph represent
Control flow changes
The nodes of a control flow graph represent
Basic Blocks
A language that requires variables to have a declared type in the source code is called
Explicitly Typed
True or False: Side effects don’t impact the order that the operands are evaluated in
False
Which of the following are common primitive types?
Integer Types, Character Types
What is the difference between a pointer and a reference type?
A pointer is when a variable has a range of values that consists of memory addresses and nil. A reference type is a value of object in memory that can’t be changed to refer to a different variable once initialized.