Skip to main content

JavaParser

Simple Story

JavaParser turns a pupil's .java file into a tree you can ask questions about, and can work out what each name in that file refers to.

What it is

JavaParser parses Java source into an abstract syntax tree and offers visitors to walk it. The companion symbol solver resolves names to their declarations, which the tree alone cannot do.

How Ares 2 uses it

Ares depends on both javaparser-core and javaparser-symbol-solver-core. The api/ast package builds structural assertions on top: the asserting subpackage holds the assertions, model the representation and type the supported constructs.

This supports exercise requirements about how a solution is written, which no runtime sandbox can express.

Further reading