10.2.1 How it works
Every code has a single severity, fixed in the catalogue and independent of its class. They are grouped by a letter:
| Letter | Severity | Examples |
|---|---|---|
| A | structural error or runtime failure | missingStatementTerminator, divisionByZero |
| C | hygiene warning | variableDeclaredNeverUsed |
| D | information | suggestions without consequence |
| E | recoverable reading warning | readValueTypeMismatch |
The letter B is not assigned.
At the top, the four classes in order: lexical, syntactic and semantic before running, and runtime during. Below, the four severity letters: A error, C hygiene, D information and E reading.
Classes follow the program's journey: lexical and syntactic while reading the text, semantic while checking types and names, and runtime while it runs. If there are lexical or syntactic errors, the semantic phase does not run: that way no errors derived from a broken tree appear.
A warning stops nothing. When reading a value that does not fit the type, the engine warns and asks again, without changing the variable:
ProgramA read that is repeated
Algorithm Edad
Define edad As Integer;
Read edad;
Write "Tienes ", edad;
EndAlgorithmInput
doce 12
Output
Tienes 12
Diagnostics
readValueTypeMismatch· warning · 3:3 · Expected a value of type Entero, and received doce
The program finishes normally.
In short
- Every code has a fixed severity: A error, C hygiene, D information, E reading.
- Classes give the phase: lexical, syntactic, semantic or runtime.
- With syntax errors no semantic analysis is done.