answersLogoWhite

0

Each individual interpreter is free to react however the creators see fit. Typically they will stop executing and display a descriptive message to the user.

Some will make a "best guess" at what it thinks the programmer was trying to write, though this approach tends to be more frustrating than useful.

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

JudyJudy
Simplicity is my specialty.
Chat with Judy
LaoLao
The path is yours to walk; I am only here to hold up a mirror.
Chat with Lao
ReneRene
Change my mind. I dare you.
Chat with Rene

Add your answer:

Earn +20 pts
Q: How would an interpreter react to a syntax error?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Is syntax error a compilation error?

Not entirely. A compilation error can contain a syntax error, but what a syntax error actually is, is an error in how the coding is spelled. For example, say you are trying to program a router. You type in the code, of which you know it's the correct code, but receive an error. You proofread the code and notice that one or more of the words are not spelled correctly. This would be a syntax error. They can also take the form of misplacing the words in the code's syntax.


What Errors are relatively easy to locate and correct because the compiler or interpreter you use highlights every error?

Run time errors or syntax errors are most easy to locate, since the compiler will show you where the errors are. A logic error would be more difficult to locate, since the program runs but does not compute the desired result.


Difference between semantic error and logical errors?

Syntax Error: error due to missing colon, semicolon, parenthesis, etc. Syntax is the way in which we construct sentences by following principles and rules. Example: In C++, it would be a syntax error to say int x = "five"; This will not compile because it does not follow the syntax of the language and does not make any sense to the compiler. Semantic Error: it is a logical error. it is due to wrong logical statements. Semantics is the interpretations of and meanings derived from the sentence transmission and understanding of the message. Semantics errors are Logical, while Syntax errors are code errors. Example: A semantic error would compile, but be incorrect logically: const int pi = 12345; Your program will likely compile and run without error but your results will be incorrect. (Note that these types of errors are usually much harder to debug)


What are Mistakes that cause a running program to produce incorrect results?

You could call it a bug in general but more specifically code with no syntax errors (i.e. it compiles and runs) but doesn't produce the output you expect would be called a semantic error.


What is the difference between interpreter and parser and compiler?

in my personal point of view i would say a parser is more like "one-directional" "automatic" vs. an interpreter, the interpreter has more "intelligence"