blob: d8b03da5df8d9711267e725899f8a3a20b920cd2 [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 Smithcc80fc12015-08-17 15:15:26 +010011[![Coverage Status](https://coveralls.io/repos/javaparser/javaparser/badge.svg?branch=master&service=github)](https://coveralls.io/github/javaparser/javaparser?branch=master)
12
Nicholas Smithcd1296d2015-01-20 14:22:40 +000013## Features
14
15* Light weight
16* Performant
17* Easy to use
18* Modifiable AST
19* Create AST from scratch
20* Support of comments
21
22## Dependency Management
23
24The 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 +010025
Nicholas Smith15a23ae2015-01-14 10:27:51 +000026Current 1.8 Release
27```xml
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010028<dependency>
Nicholas Smith26c753d2015-01-14 10:02:55 +000029 <groupId>com.github.javaparser</groupId>
30 <artifactId>javaparser-core</artifactId>
Nicholas Smithc86a9ff2015-08-12 13:20:26 +010031 <version>2.2.1</version>
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010032</dependency>
Federico Tomassetti2051f042014-07-30 19:01:19 +010033```
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010034
Nicholas Smith15a23ae2015-01-14 10:27:51 +000035Final 1.7 Release
36```xml
37<dependency>
38 <groupId>com.google.code.javaparser</groupId>
39 <artifactId>javaparser</artifactId>
40 <version>1.0.11</version>
41</dependency>
42```
43
Nicholas Smithcd1296d2015-01-20 14:22:40 +000044## How To Compile Sources
Nicholas Smith15a23ae2015-01-14 10:27:51 +000045
Nicholas Smithcd1296d2015-01-20 14:22:40 +000046If you have checkout the project from GitHub you can build the project with maven using:
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010047
Federico Tomassetti2051f042014-07-30 19:01:19 +010048```
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010049mvn clean install
Federico Tomassetti2051f042014-07-30 19:01:19 +010050```
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010051
Nicholas Smith3e6e6202015-01-20 14:24:25 +000052If 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 +000053
54```
55mvn javacc:javacc
56```
57
58## Manual
59
60Examples of how to use the library can be found on the [Manual](https://github.com/javaparser/javaparser/wiki/Manual) page of the wiki
61
Nicholas Smith26c753d2015-01-14 10:02:55 +000062## Troubleshooting
63
Nicholas Smithcd1296d2015-01-20 14:22:40 +000064In the first instance try the [wiki](https://github.com/javaparser/javaparser/wiki)
Nicholas Smith26c753d2015-01-14 10:02:55 +000065
66In the second instance please feel free to open an [issue](https://github.com/javaparser/javaparser/issues).
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010067
68## Javadoc
69
Nicholas Smithc86a9ff2015-08-12 13:20:26 +010070The libraries javadoc can be found [here](http://www.javadoc.io/doc/com.github.javaparser/javaparser-core/)
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010071
72## History
73
Didier Villevaloisd5e88432015-03-16 14:23:45 +010074This 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 +010075
Didier Villevaloisd5e88432015-03-16 14:23:45 +010076The 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 +000077
Federico Tomassetti43e1e412015-08-06 17:31:26 +020078## Related projects
79
80From JavaParser other projects have been derived:
81
82* [Walkmod](http://walkmod.com/): a tool to automatically correct violations of code conventions
83
84## Credits
85
86This project has been maintained thanks to the joint efforts of many contributors: we are extremely grateful to all of them.
87
88In particular we are thankful to the contributions we received by the [Walkmod](http://walkmod.com/) project which permitted to finalize support for Java 8. The author granted us the permissions to release that code also under the Apache License and we have greatly appreciated that.
89
Didier Villevaloisd5e88432015-03-16 14:23:45 +010090## License
Nicholas Smith26c753d2015-01-14 10:02:55 +000091
Federico Tomassetti2c7ba122015-08-12 08:06:33 +020092JavaParser is available either under the terms of the LGPL License or the Apache License. You as the user are entitled to choose the terms under which adopt JavaParser.
Federico Tomassettiee6a48a2015-07-25 14:42:17 +020093
94For details about the LGPL License please refer to [LICENSE.LGPL](ttps://github.com/javaparser/javaparser/blob/master/LICENSE.LGPL).
95
96For details about the Apache License please refer to [LICENSE.APACHE](ttps://github.com/javaparser/javaparser/blob/master/LICENSE.APACHE).