blob: fe9fea899c79b14d1a9de88ad82221c0a97534ca [file] [log] [blame] [view]
Nicholas Smith646793d2015-01-20 14:53:07 +00001## Java Parser and Abstract Syntax Tree
matozoid2cab70d2013-09-16 13:31:33 +02002
Nicholas Smith26c753d2015-01-14 10:02:55 +00003This package contains a Java 1.8 Parser with AST generation and visitor support.
Nicholas Smithcd1296d2015-01-20 14:22:40 +00004
5The AST records the source code structure, javadoc and comments. It is also possible to change the AST nodes or create new ones to modify the source code.
matozoid2d4deca2011-10-30 14:35:59 +01006
Nicholas Smith6270f6f2015-02-18 15:49:02 +00007[![Join the chat at https://gitter.im/javaparser/javaparser](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/javaparser/javaparser?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
8
Nicholas Smith2b77f432015-02-23 11:01:28 +00009[![Build Status](https://travis-ci.org/javaparser/javaparser.svg?branch=master)](https://travis-ci.org/javaparser/javaparser)
Nicholas Smith26c753d2015-01-14 10:02:55 +000010
Nicholas Smithcd1296d2015-01-20 14:22:40 +000011## Features
12
13* Light weight
14* Performant
15* Easy to use
16* Modifiable AST
17* Create AST from scratch
18* Support of comments
19
20## Dependency Management
21
22The project binaries are available in Maven Central. Just add the following to your maven configuration or taylor to your own dependency management system.
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010023
Nicholas Smith15a23ae2015-01-14 10:27:51 +000024Current 1.8 Release
25```xml
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010026<dependency>
Nicholas Smith26c753d2015-01-14 10:02:55 +000027 <groupId>com.github.javaparser</groupId>
28 <artifactId>javaparser-core</artifactId>
Nicholas Smith28d50d32015-05-19 10:05:26 +010029 <version>2.1.0</version>
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010030</dependency>
Federico Tomassetti2051f042014-07-30 19:01:19 +010031```
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010032
Nicholas Smith15a23ae2015-01-14 10:27:51 +000033Final 1.7 Release
34```xml
35<dependency>
36 <groupId>com.google.code.javaparser</groupId>
37 <artifactId>javaparser</artifactId>
38 <version>1.0.11</version>
39</dependency>
40```
41
Nicholas Smithcd1296d2015-01-20 14:22:40 +000042## How To Compile Sources
Nicholas Smith15a23ae2015-01-14 10:27:51 +000043
Nicholas Smithcd1296d2015-01-20 14:22:40 +000044If you have checkout the project from GitHub you can build the project with maven using:
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010045
Federico Tomassetti2051f042014-07-30 19:01:19 +010046```
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010047mvn clean install
Federico Tomassetti2051f042014-07-30 19:01:19 +010048```
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010049
Nicholas Smith3e6e6202015-01-20 14:24:25 +000050If you checkout the sources and want to view the project in an IDE, it is best to generate the additional source files; otherwise you will get many compilation complaints in the IDE
Nicholas Smithcd1296d2015-01-20 14:22:40 +000051
52```
53mvn javacc:javacc
54```
55
56## Manual
57
58Examples of how to use the library can be found on the [Manual](https://github.com/javaparser/javaparser/wiki/Manual) page of the wiki
59
Nicholas Smith26c753d2015-01-14 10:02:55 +000060## Troubleshooting
61
Nicholas Smithcd1296d2015-01-20 14:22:40 +000062In the first instance try the [wiki](https://github.com/javaparser/javaparser/wiki)
Nicholas Smith26c753d2015-01-14 10:02:55 +000063
64In the second instance please feel free to open an [issue](https://github.com/javaparser/javaparser/issues).
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010065
66## Javadoc
67
Nicholas Smithcd1296d2015-01-20 14:22:40 +000068The libraries javadoc can be found [here](http://javaparser.github.io/javaparser/javadoc-current/)
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010069
70## History
71
Didier Villevaloisd5e88432015-03-16 14:23:45 +010072This parser is based on work by Sreenivasa Viswanadha and Jรบlio Vilmar Gesser. The original project, now inactive, was originally hosted at [Google Code](http://code.google.com/p/javaparser/) and supported only parsing Java 1.5.
matozoid2d4deca2011-10-30 14:35:59 +010073
Didier Villevaloisd5e88432015-03-16 14:23:45 +010074The project now supports parsing Java 1.8 and aims to continue support for features in future versions of the Java language.
Nicholas Smith26c753d2015-01-14 10:02:55 +000075
Didier Villevaloisd5e88432015-03-16 14:23:45 +010076## License
Nicholas Smith26c753d2015-01-14 10:02:55 +000077
Didier Villevaloisd5e88432015-03-16 14:23:45 +010078Offered under the GNU Lesser General Public License: [COPYING.LESSER](https://github.com/javaparser/javaparser/blob/master/COPYING.LESSER), [COPYING](https://github.com/javaparser/javaparser/blob/master/COPYING).