Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Eclipse detect errors in code

Tags:

java

eclipse

I wonder how Eclipse detects errors in Java code before compiling it.

I've found this answer from the Eclipse forums which mentions reconciliation. But that doesn't tell me how it works.

Is the error and warning detection done by comparing the code with the Java specification using regular expressions?

like image 519
Matthias Braun Avatar asked Oct 26 '12 22:10

Matthias Braun


1 Answers

When you change something in your code, the changes are represented as deltas. The deltas get analyzed by creating the AST (Abstract Syntax Tree) and JDT looks for errors. If there are any, then the error markers are generated.

Here is a good explanation how CDT parser for C/C++ works. The JDT parser should be working the same way.

like image 172
aphex Avatar answered Oct 19 '22 16:10

aphex