Amitesh Rai
Amitesh Rai

Reputation: 874

How does the IDE verifies the syntax errors simultaneously on the go?

I am new to the Programming era so this question might sound weird to some BUT here is my doubt :

When i write a program using a text-editor then while compiling the code I used to get syntax errors like forgetting to put the semicolon at the end of statement or forgetting to put the closing curly braces( }, etc) and some other reasons like range for numeric types and all....

But when I am writing a piece of code in my Eclipse IDE, then it generates the errors spontaneously, if any, while I'm writing the code.

My question is how does the IDE's performs this operation and what kind of mechanism(datastructures, etc) it uses to accomplish this task ?

Upvotes: 1

Views: 515

Answers (1)

AlexR
AlexR

Reputation: 115378

Each IDE uses its own way. Specifically eclipse uses its own "patched" compiler instead of javac. This compiler is invoked by IDE once you are saving the file (by default), so it compiles files while you are typing.

The eclipse compiler has unique features like ability to compile code with some syntax errors. It actually compile what it can and throws exception if you arrive to not compiled code during your execution. It is very convenient during development.

Upvotes: 3

Related Questions