There is kinds of errors that Basis can find.
Syntax Errors occur during the parsing of input code, and is caused by grammatically incorrect statemen Ts.
Typical errors might is an illegal character in the input, a missing operator, both operators in a row,
Statements on the same line with no intervening semicolon, unbalanced parentheses, a misplaced reserved word, etc.
Semantic Errors occur during the execution of the code, after it had been parsed as grammatically Corre Ct.
These has the to do and how statements is constructed, but with what they mean.
Such things as incorrect variable types or sizes, nonexistent variables, subscripts out of range, and the like, is Semant IC errors.
Basis is a single-pass parser, which is, it looks in its input only once.
It also is a one-look ahead parser, meaning that at the most it's never looking more than one symbol ahead of the Curren T context.
By the time a syntax error has been detected, it's likely that a lot of the context information to the left of the the error has already been lost.
The diagnostic information that Basis gives attempts to be as useful as possible,
But because of the very limited context information available, it's far from perfect.
Semantic errors is often possible to diagnose more precisely.
We have attempted to make the semantic error information supplied as useful as possible.
Sometimes some of the information are only useful to someone familiar with the internals of Basis;
But we hope this in the most cases it would help you find your error.
Syntax Error:
Error due to missing colon, semicolon, parenthesis, etc.
Syntax is the same as which we construct sentences by following principles and rules.
Example:in C + +, it would is a syntax error to say
int x = "five";
This would not be compile because it does not follow the syntax of the language and does do any sense to the compiler.
Semantic Error:
It is a logical error. It's due to wrong logical statements.
Semantics is the interpretations of and meanings derived from the sentence transmission and understanding of the message.
Semantics Errors is Logical, while Syntax errors is code errors.
Example:a semantic error would compile, but being incorrect logically:
const int PI = 12345;
Your program would likely compile and run without error but Your results would be incorrect.
(Note that these types of errors is usually much harder to debug)
Syntactic and Semantic Errors