| Nicholas Smith | 646793d | 2015-01-20 14:53:07 +0000 | [diff] [blame] | 1 | ## Java Parser and Abstract Syntax Tree
|
| matozoid | 2cab70d | 2013-09-16 13:31:33 +0200 | [diff] [blame] | 2 |
|
| Danny van Bruggen | 3ad0750 | 2017-03-23 15:24:33 +0100 | [diff] [blame] | 3 | This package contains a Java 1.0 - Java 9 Parser with AST generation and visitor support.
|
| Nicholas Smith | cd1296d | 2015-01-20 14:22:40 +0000 | [diff] [blame] | 4 |
|
| Danny van Bruggen | 5e6d729 | 2017-07-16 22:19:10 +0200 | [diff] [blame] | 5 | Our main site is at [JavaParser.org](http://javaparser.org)
|
| matozoid | 2d4deca | 2011-10-30 14:35:59 +0100 | [diff] [blame] | 6 |
|
| Nicholas Smith | d7c5113 | 2015-09-02 13:14:42 +0100 | [diff] [blame] | 7 | [](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.javaparser%22%20AND%20a%3A%22javaparser-core%22)
|
| Nicholas Smith | 2b77f43 | 2015-02-23 11:01:28 +0000 | [diff] [blame] | 8 | [](https://travis-ci.org/javaparser/javaparser)
|
| Nicholas Smith | cc80fc1 | 2015-08-17 15:15:26 +0100 | [diff] [blame] | 9 | [](https://coveralls.io/github/javaparser/javaparser?branch=master)
|
| Nicholas Smith | d6a8098 | 2015-08-17 15:25:32 +0100 | [diff] [blame] | 10 | [](https://gitter.im/javaparser/javaparser?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
| Nicholas Smith | cc80fc1 | 2015-08-17 15:15:26 +0100 | [diff] [blame] | 11 |
|
| Nicholas Smith | cd1296d | 2015-01-20 14:22:40 +0000 | [diff] [blame] | 12 | ## Dependency Management
|
| 13 |
|
| matozoid | 3c137e9 | 2016-04-06 19:37:37 +0200 | [diff] [blame] | 14 | The project binaries are available in Maven Central. Just add the following to your maven configuration or tailor to your own dependency management system.
|
| Federico Tomassetti | cf8d7b1 | 2014-07-30 19:00:26 +0100 | [diff] [blame] | 15 |
|
| Danny van Bruggen | eb24896 | 2017-01-11 15:00:00 +0100 | [diff] [blame] | 16 | [Please refer to the Migration Guide when upgrading from 2.5.1](https://github.com/javaparser/javaparser/wiki/Migration-Guide)
|
| Parth Mehrotra | 112f459 | 2017-07-10 13:47:53 -0400 | [diff] [blame] | 17 |
|
| 18 | For Maven:
|
| 19 |
|
| Danny van Bruggen | 1188750 | 2016-12-05 19:27:34 +0100 | [diff] [blame] | 20 | ```xml
|
| 21 | <dependency>
|
| 22 | <groupId>com.github.javaparser</groupId>
|
| 23 | <artifactId>javaparser-core</artifactId>
|
| Danny van Bruggen | b20badc | 2017-08-20 23:08:26 +0200 | [diff] [blame] | 24 | <version>3.3.2</version>
|
| Danny van Bruggen | 3588d26 | 2017-02-19 23:00:47 +0100 | [diff] [blame] | 25 | </dependency>
|
| 26 | ```
|
| 27 |
|
| Parth Mehrotra | 112f459 | 2017-07-10 13:47:53 -0400 | [diff] [blame] | 28 | For Gradle:
|
| 29 |
|
| 30 | ```
|
| Danny van Bruggen | b20badc | 2017-08-20 23:08:26 +0200 | [diff] [blame] | 31 | compile 'com.github.javaparser:javaparser-core:3.3.2'
|
| Parth Mehrotra | 112f459 | 2017-07-10 13:47:53 -0400 | [diff] [blame] | 32 | ```
|
| 33 |
|
| Nicholas Smith | cd1296d | 2015-01-20 14:22:40 +0000 | [diff] [blame] | 34 | ## How To Compile Sources
|
| Nicholas Smith | 15a23ae | 2015-01-14 10:27:51 +0000 | [diff] [blame] | 35 |
|
| Danny van Bruggen | d67b506 | 2017-04-16 15:07:23 +0200 | [diff] [blame] | 36 | If you checked out the project from GitHub you can build the project with maven using:
|
| Federico Tomassetti | cf8d7b1 | 2014-07-30 19:00:26 +0100 | [diff] [blame] | 37 |
|
| Federico Tomassetti | 2051f04 | 2014-07-30 19:01:19 +0100 | [diff] [blame] | 38 | ```
|
| Federico Tomassetti | cf8d7b1 | 2014-07-30 19:00:26 +0100 | [diff] [blame] | 39 | mvn clean install
|
| Federico Tomassetti | 2051f04 | 2014-07-30 19:01:19 +0100 | [diff] [blame] | 40 | ```
|
| Federico Tomassetti | cf8d7b1 | 2014-07-30 19:00:26 +0100 | [diff] [blame] | 41 |
|
| Danny van Bruggen | 1188750 | 2016-12-05 19:27:34 +0100 | [diff] [blame] | 42 | If you checkout the sources and want to view the project in an IDE, it is best to first generate some of the source files; otherwise you will get many compilation complaints in the IDE. (mvn clean install already does this for you.)
|
| Nicholas Smith | cd1296d | 2015-01-20 14:22:40 +0000 | [diff] [blame] | 43 |
|
| 44 | ```
|
| 45 | mvn javacc:javacc
|
| 46 | ```
|
| 47 |
|
| Danny van Bruggen | 45f8318 | 2017-07-10 20:15:11 +0200 | [diff] [blame] | 48 | If you modify the code of the AST nodes, specifically if you add or remove fields or node classes,
|
| Danny van Bruggen | 969b7f6 | 2017-07-10 21:03:41 +0200 | [diff] [blame] | 49 | the code generators will update a lot of code for you.
|
| Danny van Bruggen | 45f8318 | 2017-07-10 20:15:11 +0200 | [diff] [blame] | 50 | The `run_metamodel_generator.sh` script will rebuild the metamodel,
|
| 51 | which is used by the code generators which are run by `run_core_generators.sh`
|
| 52 | Make sure that `javaparser-core` at least compiles before you run these.
|
| 53 |
|
| Nicholas Smith | cd1296d | 2015-01-20 14:22:40 +0000 | [diff] [blame] | 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 |
|
| Danny van Bruggen | 1188750 | 2016-12-05 19:27:34 +0100 | [diff] [blame] | 60 | First try the [wiki](https://github.com/javaparser/javaparser/wiki).
|
| Nicholas Smith | 26c753d | 2015-01-14 10:02:55 +0000 | [diff] [blame] | 61 |
|
| Danny van Bruggen | 1188750 | 2016-12-05 19:27:34 +0100 | [diff] [blame] | 62 | Didn't find an answer? Try [searching for existing issues](https://github.com/javaparser/javaparser/issues?utf8=%E2%9C%93&q=is%3Aissue%20)
|
| 63 |
|
| 64 | Still nothing? [Open an issue](https://github.com/javaparser/javaparser/issues/new) or [come chat on Gitter](https://gitter.im/javaparser/javaparser)
|
| Federico Tomassetti | cf8d7b1 | 2014-07-30 19:00:26 +0100 | [diff] [blame] | 65 |
|
| 66 | ## Javadoc
|
| 67 |
|
| Nicholas Smith | c86a9ff | 2015-08-12 13:20:26 +0100 | [diff] [blame] | 68 | The libraries javadoc can be found [here](http://www.javadoc.io/doc/com.github.javaparser/javaparser-core/)
|
| Federico Tomassetti | cf8d7b1 | 2014-07-30 19:00:26 +0100 | [diff] [blame] | 69 |
|
| Didier Villevalois | d5e8843 | 2015-03-16 14:23:45 +0100 | [diff] [blame] | 70 | ## License
|
| Nicholas Smith | 26c753d | 2015-01-14 10:02:55 +0000 | [diff] [blame] | 71 |
|
| Federico Tomassetti | 2c7ba12 | 2015-08-12 08:06:33 +0200 | [diff] [blame] | 72 | JavaParser 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 Tomassetti | ee6a48a | 2015-07-25 14:42:17 +0200 | [diff] [blame] | 73 |
|
| 74 | For details about the LGPL License please refer to [LICENSE.LGPL](ttps://github.com/javaparser/javaparser/blob/master/LICENSE.LGPL).
|
| 75 |
|
| 76 | For details about the Apache License please refer to [LICENSE.APACHE](ttps://github.com/javaparser/javaparser/blob/master/LICENSE.APACHE).
|