-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Build Process
Loosely based on https://javaparser.org/code-generation-and-maven-in-javaparser/
See https://github.com/javaparser/javaparser/wiki/A-Detailed-Guide-to-Adding-New-Nodes-and-Fields for a detailed walkthrough to adding new nodes and fields.
JavaParser uses JavaParser to build parts of JavaParser! ;)
Each of the stages is as follows:
-
JavaCC is run to be able to compile/parse Java .
-
JavaParser core (incl. the JavaCC output) is used to (re-)build the meta-model.
- The meta-model contains a static field, holding a list of node classes.
- This list is manually curated to ensure that "parent" node classes are processed prior to the "child" node classes (e.g. a
LiteralExpr.class
appears beforeLiteralStringExpr.class
).
-
Based on the annotations within each of the node classes (e.g.
@OptionalProperty
and@AllFieldsConstructor
), an in-memory meta-model is generated then used to persist details about the attributes/properties/constructor arguments intoJavaParserMetaModel
. -
Using the meta-model produced within in the previous step, the
core-generator
is then run to embellish each of the ast-nodes with getter/setter methods- e.g.
PropertyGenerator
/AcceptGenerator
/CloneGenerator
,ReplaceMethodGenerator
- e.g.
-
Finally, the bnd-generator produces the file
bnd.bnd
, which reports to external modules which packages are available for consumption. -
Finally, now that the generation is complete, build the "final" / "current" version of JavaParser. It is this version that gets used and released (Release Process).
Website: JavaParser.org Chat: Gitter.im/JavaParser/JavaParser Free eBook: leanpub.com/JavaParserVisited
- Home
- Migration Guide (2.5.1 to 3.0.0)
- Migration Guide (3.25.10 to 3.26.0)
- Inspecting an AST
JavaParser
vsStaticJavaParser
Pro* jectRoot
vsSourceRoot
(Analysing a Whole Project)- Parsing Java Comments
- Getting started with JavaParser: analyzing Java Code programmatically
- Observers for AST nodes in JavaParser
- Implementing Lexical Preservation for JavaParser
- JavaParser’s logging framework in one file
- Making strings in JavaParser
- The quick and the full API of JavaParser
- Less Casting in JavaParser
- Parse error recovery
- Inverting ifs in JavaParser
- Code generation and Maven in JavaParser
- Semantic validations in JavaParser
- Setting Java 8, 9, 10, etc
- Analysing an entire project in one go
- Pragmatic Versioning
- Testing JavaParser Code
- Functional Tree Traversal
- Coding Guidelines
- Eclipse Project Setup Guide
- Code Style / Architecture
- Build Process
- Release Process
- A Detailed Guide to Adding New Nodes and Fields
Visit the JavaParser blog
Download the JavaParserVisited book (free!).
Join the chatroom on Gitter!