CSE 3302 Exam 3 vocab

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/96

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

97 Terms

1
New cards

Lexical structure

the structure of the tokens, or words, of a language

2
New cards

Scanning phase

the phase in which a translator collects sequences of characters from the input program and forms them into tokens

3
New cards

Parsing phase

the phase in which the translator processes the tokens, determining the program's syntactic structure

4
New cards

Tokens generally fall into what several categories:

-Reserved words (or keywords)

-Literals or constants

-Special symbols, such as ";"m "<=", or "+"

-Identifiers

5
New cards

Predefined identifiers

identifiers that have been given an initial meaning for all programs in the language but are capable of redirection

6
New cards

Principle of longest substring

process of collecting the longest possible string of nonblank characters

7
New cards

Token delimiters (or white space)

formatting that affects the way tokens are recognized

8
New cards

Free-format language

one in which format has no effect on program structure other than satisfying the principle of longest substring

9
New cards

Fixed format language

one in which all tokens must occur in prespecified locations on the page

10
New cards

Tokens can be formally described by what?

regular expressions

11
New cards

Three basic patterns of characters in regular expressions

-Concatenation: done by sequencing the items

-Repetition: indicated by an asterisk after the item to be repeated

-Choice, or selection: indicated by a vertical bar between items to be selected

12
New cards

Metasymbols

symbols used to describe the grammar rules

13
New cards

Derivation

the process of building in a language by beginning with the start symbol and replacing left-hand sides by choices of right-hand sides in the rules

14
New cards

Context-free grammar

consists of a series of grammar rules

15
New cards

Nonterminals

names for phrase structures, since they are broken down into further phrase structures

16
New cards

Language of the grammar

defined by a context-free grammar

17
New cards

Start symbol

a nonterminal representing the entire top-level phrase being defined

18
New cards

Backus-Naur form

uses only the metasymbols "->" and "|"

19
New cards

Productions

another name for grammar rules

20
New cards

Syntax-directed semantics

process of associating the semantics of a construct to its syntactic structure

21
New cards

Terminals

words or token symbols that cannot be broken down further

22
New cards

Parse tree

graphical depiction of the replacement process in a derivation

23
New cards

Abstract syntax trees (or syntax trees

trees that abstract the essential structure of the parse tree

24
New cards

Concrete syntax

ordinary syntax

25
New cards

Ambiguous grammar

one for which two distinct parse or syntax trees are possible

26
New cards

Leftmost derivation

the leftmost remaining nonterminal is singled out for replacement at each step

27
New cards

First rule is ______; second rule is _____

left-recursive; right-recursive

28
New cards

Extended Backus-Naur form (or EBNF)

introduces new notation to handle common issues

•Use curly braces to indicate 0 or more repetitions

-Assumes that any operator involved in a curly bracket repetition is left-associative

-Example: number -> digit {digit}

•Use square brackets to indicate optional parts

-Example: if-statement -> if(expression) statement [else statement]

29
New cards

Syntax diagram

indicates the sequence of terminals and nonterminals encountered in the right-hand side of the rule

30
New cards

Recognizer

accepts or rejects strings based on whether they are legal strings in the language

31
New cards

Bottom-up parser

constructs derivations and parse trees from the leaves to the roots

-Matches an input with right side of a rule and reduces it to the nonterminal on the left

32
New cards

Top-down parser

expands nonterminals to match incoming tokens and directly construct a derivation

33
New cards

Parser generator

a program that automates top-down or bottom-up parsing

34
New cards

Recursive-descent parsing

turns nonterminals into a group of mutually recursive procedures based on the right-hand sides of the BNFs

35
New cards

Single-symbol lookahead

using a single token to direct a parse

36
New cards

Predictive parser

a parser that commits itself to a particular action based only on the lookahead

37
New cards

Lexics

the lexical structure of a programming language

38
New cards

Parsing shell

applies the grammar rules to check whether tokens are of the correct types

39
New cards

TinyAda

a small language that illustrates the syntactic features of many high-level languages

40
New cards

Names (or identifiers)

a fundamental abstraction mechanism used to denote language entities or constructs

41
New cards

Value

any storable quantities

42
New cards

Location

place where value can be stored; usually a relative location

43
New cards

Attributes

properties that determine the meaning of the name to which they are associated

44
New cards

Binding

process of associating an attribute with a name

45
New cards

Binding time

the time when an attribute is computed and bound to a name

46
New cards

Static binding

occurs prior to execution

47
New cards

Dynamic binding

occurs during execution

48
New cards

Static attribute

an attribute that is bound statically

49
New cards

Dynamic attribute

an attribute that is bound dynamically

50
New cards

Symbol table

a function from names to attributes

51
New cards

Lexical analysis

determines whether a string of characters represents a token

52
New cards

Syntax analysis

determines whether a sequence of tokens represents a phrase in the context-free grammar

53
New cards

Static semantic analysis

establishes attributes of names in declarations and ensures that the use of these names conforms to their declared attributes

54
New cards

Definition

in C and C++, a declaration that binds all potential attributes

55
New cards

Prototype

function declaration that specifies the data type but not the code to implement it

56
New cards

Block

a sequence of declarations followed by a sequence of statements

57
New cards

Compound statements

blocks in C that appear as the body of functions or anywhere an ordinary program statement could appear

58
New cards

Local declarations

associated with a block

59
New cards

Nonlocal declarations

associated with surrounding blocks

60
New cards

Each declared name has a ________________containing a ____________ and an _______

lexical address, level number, offset

61
New cards

Scope of a binding

region of the program over which the binding is maintained

62
New cards

Lexical scope

in block-structured languages, scope is limited to the block in which its associated declaration appears (and other blocks contained within it)

63
New cards

Declaration before use rule

in C, scope of a declaration extends from the point of declaration to the end of the block in which it is located

64
New cards

Visibility

includes only regions where the bindings of a declaration apply

65
New cards

Symbol table

Must support insertion, lookup, and deletion of names with associated attributes, representing bindings in declarations

66
New cards

scope analysis

-On block entry, all declarations of that block are processed and bindings added to symbol table

-On block exit, bindings are removed, restoring any previous bindings that may have existed

67
New cards

dynamic scoping

If symbol table is managed dynamically (during execution), declarations will be processed as they are encountered along an execution path

68
New cards

Overload resolution

process of choosing a unique function among many with the same name

69
New cards

Calling context

the information contained in each call

70
New cards

Environment

maintains the bindings of names to locations

71
New cards

Activation

a call to a function

72
New cards

Activation record

the corresponding region of allocated memory

73
New cards

____________________ of an object is the duration of its allocation in the environment

Lifetime (or extent)

74
New cards

Pointer

an object whose stored value is a reference to another object

75
New cards

Heap

area in memory from which locations can be allocated in response to calls to new

76
New cards

Dynamic allocation

allocation on the heap

77
New cards

Storage class

the type of allocation

-Static (for global variables)

-Automatic (for local variables)

-Dynamic (for heap allocation)

78
New cards

Variable

an object whose stored value can change during execution

79
New cards

Box and circle diagram

focuses on name and location

80
New cards

Assignment statement

principle way in which a variable changes its value

81
New cards

Address of operator (&) in C

turns a reference into a pointer to fetch the address of a variable

82
New cards

Assignment by sharing

the location is copied instead of the value

83
New cards

Assignment by cloning

allocates new location, copies value, and binds to the new location

84
New cards

Constant

an entity with a fixed value for the duration of its existence in a program

-Like a variable, but has no location attribute

-Sometimes say that a constant has value semantics

85
New cards

Literal

a representation of characters or digits

86
New cards

Compile-time constant

its value can be computed during compilation

87
New cards

Static constant

its value can be computed at load time

88
New cards

Manifest constant

a name for a literal

89
New cards

Dynamic constant

its value must be computed during execution

90
New cards

Alias

occurs when the same object is bound to two different names at the same time

91
New cards

Side effect

any change in a variable's value that persists beyond the execution of the statement

92
New cards

Dangling reference

a location that has been deallocated from the environment but can still be accessed by a program

-Occurs when a pointer points to a deallocated object

93
New cards

Garbage

memory that has been allocated in the environment but is now inaccessible to the program

94
New cards

Garbage collection

process of automatically reclaiming garbage

95
New cards

Translation unit

external declaration

96
New cards

Classes,structs, and name spaces

C++

97
New cards

Classes and packages

in Java