Toolchains Flashcards

1
Q

What is a toolchain?

A

• Toolchain: a set of software development tools that are linked (or “chained”)
together
• At its most basic consists of a compiler and a linker to transform source code
into an executable program

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

What are the main elements of the AVR Toolchain?

A

The compiler, assembler, linker and library

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

What is the AVR Toolchain?

A

Separate programs performing distinct tasks
The ‘core’ of the toolchain is the compiler, assembler, linker and library
• Although these are separate projects, they are interconnected and developed in
partnership

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

What is semantic analysis?

A

Semantic analysis is the task of ensuring that the declarations and statements of a program are semantically correct, i.e, that their meaning is clear and consistent with the way in which control structures and data types are supposed to be used.

It observes the;

  • Implications of expression
  • Type checking, object binding, definite assignment

Example Checks

  • Types of the first and second operand
  • Check whether + is binary/unary/ternary
  • Check number of operands supplied to the operator
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is syntactic analysis?

A

Syntactic analysis is defined as analysis that tells us the logical meaning of certain given sentences or parts of those sentences. We also need to consider rules of grammar in order to define the logical meaning as well as the correctness of the sentences.

In computing,

  • Checking tokens for allowable expression
  • Grammar defines components for expressions

In summary

  • Checking for the appropriate sequence of tokens
  • Checking for right shape/form, but not meaning
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How is syntactic analysis parsed?

A
  • State transition table
  • Parsing code

Many other methods.

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

Benefits of syntactic state transition tables

A

Allow for easy identification of errors and their corresponding location.

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

What is done once a syntactic error is detected?

A

Once an error is detected the program will do one of the following to recover from the error

  • Panic mode
  • Phrase level
  • Error productions
  • Global correction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Describe Panic Mode Error Recovery

A
  • The parser throws away tokens until a ‘resynchronise’ token is found.
  • The token implies (with high probability) one particular place in the syntax diagram. suchas in C.

• Can cause a lot of sources to be skipped (and therefore other errors undetected this time around).

Benefits
• Simple, fast
• Guaranteed to terminate

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

Describe Phrase Level error Recovery

A
  • Small local correction to the token stream
  • Insert, delete or change one token
    • For example, apple[*,a:,23]
    • Ignore (delete) ‘,’ => apple[*,a:23]
  • Now syntactically legal, but if the user meant apple[*, a:b,23] this hasn’t helped much
  • BUT the semantic check, later on, will catch it (array reference with an incorrect number of dimensions)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Describe Error Productions Error Recovery

A

• Build the common errors into the grammar

• A C programmer would want to write
apple[*][a:7][23]
• So include this in the grammar definition

• The parser can get
massive - the designer
has to foresee every
possible error…

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

Describe Global Production Error Recovery

A

• The parser takes a fragment of the input token stream
error
tn-3 ⇒ tn-2 ⇒ tn-1 ⇒ tn ⇒ tn+1 ⇒ tn+2 ⇒tn+3
lo…………………..hi
… and tries to match it to the parse diagram, resynchronising wherever the overall mismatch is least
• Computationally expensive
• Not used where the compile/edit loop is tight and fast

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