| Nicholas Smith | cd1296d | 2015-01-20 14:22:40 +0000 | [diff] [blame^] | 1 | # Java Parser and Abstract Syntax Tree.
|
| matozoid | 2cab70d | 2013-09-16 13:31:33 +0200 | [diff] [blame] | 2 |
|
| Nicholas Smith | 26c753d | 2015-01-14 10:02:55 +0000 | [diff] [blame] | 3 | This package contains a Java 1.8 Parser with AST generation and visitor support.
|
| Nicholas Smith | cd1296d | 2015-01-20 14:22:40 +0000 | [diff] [blame^] | 4 |
|
| 5 | The 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.
|
| matozoid | 2d4deca | 2011-10-30 14:35:59 +0100 | [diff] [blame] | 6 |
|
| Nicholas Smith | 26c753d | 2015-01-14 10:02:55 +0000 | [diff] [blame] | 7 | [](https://drone.io/github.com/javaparser/javaparser/latest)
|
| 8 |
|
| Nicholas Smith | cd1296d | 2015-01-20 14:22:40 +0000 | [diff] [blame^] | 9 | ## Features
|
| 10 |
|
| 11 | * Light weight
|
| 12 | * Performant
|
| 13 | * Easy to use
|
| 14 | * Modifiable AST
|
| 15 | * Create AST from scratch
|
| 16 | * Support of comments
|
| 17 |
|
| 18 | ## Dependency Management
|
| 19 |
|
| 20 | The project binaries are available in Maven Central. Just add the following to your maven configuration or taylor to your own dependency management system.
|
| Federico Tomassetti | cf8d7b1 | 2014-07-30 19:00:26 +0100 | [diff] [blame] | 21 |
|
| Nicholas Smith | 15a23ae | 2015-01-14 10:27:51 +0000 | [diff] [blame] | 22 | Current 1.8 Release
|
| 23 | ```xml
|
| Federico Tomassetti | cf8d7b1 | 2014-07-30 19:00:26 +0100 | [diff] [blame] | 24 | <dependency>
|
| Nicholas Smith | 26c753d | 2015-01-14 10:02:55 +0000 | [diff] [blame] | 25 | <groupId>com.github.javaparser</groupId>
|
| 26 | <artifactId>javaparser-core</artifactId>
|
| 27 | <version>2.0.0</version>
|
| Federico Tomassetti | cf8d7b1 | 2014-07-30 19:00:26 +0100 | [diff] [blame] | 28 | </dependency>
|
| Federico Tomassetti | 2051f04 | 2014-07-30 19:01:19 +0100 | [diff] [blame] | 29 | ```
|
| Federico Tomassetti | cf8d7b1 | 2014-07-30 19:00:26 +0100 | [diff] [blame] | 30 |
|
| Nicholas Smith | 15a23ae | 2015-01-14 10:27:51 +0000 | [diff] [blame] | 31 | Final 1.7 Release
|
| 32 | ```xml
|
| 33 | <dependency>
|
| 34 | <groupId>com.google.code.javaparser</groupId>
|
| 35 | <artifactId>javaparser</artifactId>
|
| 36 | <version>1.0.11</version>
|
| 37 | </dependency>
|
| 38 | ```
|
| 39 |
|
| Nicholas Smith | cd1296d | 2015-01-20 14:22:40 +0000 | [diff] [blame^] | 40 | ## How To Compile Sources
|
| Nicholas Smith | 15a23ae | 2015-01-14 10:27:51 +0000 | [diff] [blame] | 41 |
|
| Nicholas Smith | cd1296d | 2015-01-20 14:22:40 +0000 | [diff] [blame^] | 42 | If you have checkout the project from GitHub you can build the project with maven using:
|
| Federico Tomassetti | cf8d7b1 | 2014-07-30 19:00:26 +0100 | [diff] [blame] | 43 |
|
| Federico Tomassetti | 2051f04 | 2014-07-30 19:01:19 +0100 | [diff] [blame] | 44 | ```
|
| Federico Tomassetti | cf8d7b1 | 2014-07-30 19:00:26 +0100 | [diff] [blame] | 45 | mvn clean install
|
| Federico Tomassetti | 2051f04 | 2014-07-30 19:01:19 +0100 | [diff] [blame] | 46 | ```
|
| Federico Tomassetti | cf8d7b1 | 2014-07-30 19:00:26 +0100 | [diff] [blame] | 47 |
|
| Nicholas Smith | cd1296d | 2015-01-20 14:22:40 +0000 | [diff] [blame^] | 48 | If you checkout the sources and want to view the project in an IDE, it is best to at minimum to generate the additional source files. Otherwise you will get many complaints in the IDE
|
| 49 |
|
| 50 | ```
|
| 51 | mvn javacc:javacc
|
| 52 | ```
|
| 53 |
|
| 54 | ## Manual
|
| 55 |
|
| 56 | Examples of how to use the library can be found on the [Manual](https://github.com/javaparser/javaparser/wiki/Manual) page of the wiki
|
| 57 |
|
| Nicholas Smith | 26c753d | 2015-01-14 10:02:55 +0000 | [diff] [blame] | 58 | ## Troubleshooting
|
| 59 |
|
| Nicholas Smith | cd1296d | 2015-01-20 14:22:40 +0000 | [diff] [blame^] | 60 | In the first instance try the [wiki](https://github.com/javaparser/javaparser/wiki)
|
| Nicholas Smith | 26c753d | 2015-01-14 10:02:55 +0000 | [diff] [blame] | 61 |
|
| 62 | In the second instance please feel free to open an [issue](https://github.com/javaparser/javaparser/issues).
|
| Federico Tomassetti | cf8d7b1 | 2014-07-30 19:00:26 +0100 | [diff] [blame] | 63 |
|
| 64 | ## Javadoc
|
| 65 |
|
| Nicholas Smith | cd1296d | 2015-01-20 14:22:40 +0000 | [diff] [blame^] | 66 | The libraries javadoc can be found [here](http://javaparser.github.io/javaparser/javadoc-current/)
|
| Federico Tomassetti | cf8d7b1 | 2014-07-30 19:00:26 +0100 | [diff] [blame] | 67 |
|
| 68 | ## History
|
| 69 |
|
| Nicholas Smith | 26c753d | 2015-01-14 10:02:55 +0000 | [diff] [blame] | 70 | This parser is based on Sreenivasa Viswanadha's Java 1.5 parser.
|
| matozoid | 2d4deca | 2011-10-30 14:35:59 +0100 | [diff] [blame] | 71 |
|
| Nicholas Smith | 26c753d | 2015-01-14 10:02:55 +0000 | [diff] [blame] | 72 | The project was originally hosted at [Google Code](http://code.google.com/p/javaparser/), however support there dwindled.
|
| 73 |
|
| 74 | This repository aims to provide support for issues and add the new Java language features.
|
| 75 |
|
| 76 | ## Licence
|
| 77 |
|
| 78 | Offered under the GNU GENERAL PUBLIC LICENSE that can be found [here](https://github.com/javaparser/javaparser/blob/master/COPYING) |