Posts

Showing posts from October, 2013

Source-code errors found during compilation

There might be questions in CIE from chapter 3.2 asking about errors found during lexical, syntax and semantic stages of compilation. Below I describe found errors Errors during Lexical Analysis: There are relatively few errors which can be detected during lexical analysis. a) Strange characters Some programming languages do not use all possible characters, so any strange ones which appear can be reported. Note however that almost any character is allowed within a quoted string. b) Long quoted strings (1) Many programming languages do not allow quoted strings to extend over more than one line; in such cases a missing quote can be detected. Languages of this type often have some way of automatically joining consecutive quoted strings together to allow for really long strings. c) Long quoted strings (2) If quoted strings can extend over multiple lines then a missing quote can cause quite a lot of text to be 'swallowed up' before an error is detected. The ...