Role of Compiler

Posted On
Socialize It →
0
A part of the compiler’s job is to Analise the program code for “correctness”, if the meaning of a program is correct, then a compiler cannot detect errors but a compiler can certainly detect errors in the form of a program.

Some of the common forms of program errors are as follows:

1. Syntax Errors

          Syntax error occurs when rules of a programming language are misused i.e. when a grammatical rule of C++ is violated.

2. Semantics Errors

          Semantic Errors occur when statements are not meaningful. Semantics refers to the set of rules which give the meaning of a statement.

3. Type Errors

          Data in C++ has an associated data type. The Value 7, for instant is an integer. “A” is a character constant where as “Hi” is a string. If a function given wrong type of data, type error is signaler by the compiler.

4. Run Time Error

          A run-time error is that occurs during the execution of a program. It is caused of some illegal operation taking place or unavailability of desired or required condition for the execution of the program.

5. Logical Error

          A logical error is that error which causes a program to produce incorrect or undesired output.

0 comments:

Post a Comment

'