Static & Syntactic Analysis Flashcards

1
Q

Stuff you can do with an AST (syntactic analysis-y things)

A
  • build a call graph
  • build a def-use chain
  • build a flowchart (tiny bit semantic)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Def-use chain: definition

A

links uses of a symbol to the definition of that symbol

=> becomes chain when a new symbol is partially defined by an existing symbol

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Control flow analysis: definition

A

static code analysis technique for determining control flow of a diagram

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Data flow analysis: definition

A

gathering information about the possible set of values calculated at various points in a computer program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why can’t you create a def-use chain with lexical analysis?

A

Because you need to know the grammar of the code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Algorithm for creating a def-use chain

A

at the def site: record name of the variable in the map along with its line number
at the use site: link use to last def for that variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly