Comments (25)
+1 on this - I just started updating my codebase to using JDK8 and I have a maven-enforcer-plugin extension that's using the javaparser ( +1 works AWESOME ) and would love to see JDK8 support soon.
from javaparser.
+1
from javaparser.
+1
from javaparser.
Nobody is working on this, so pick it up if you like.
from javaparser.
Hi,
I have recently added Java 8 support to walkmod (check https://github.com/rpau/javalang). This open source project started from the Javaparser 1.6 grammar, so you feel free to add my grammar changes to Javaparser.
I have tested my Java 8 parser with expressions extracted from the JSR 335. So, it would be nice to test the parser with your Java 8 code before adding my changes to this project and publish an official version to Maven. My parser also passes your parsing (Java 7) tests.
from javaparser.
+1 will give it a shot on my JDK8 code and report back what I find...
from javaparser.
Hi,
Today I have read Java 8 allows to annotate create expressions, cast, implements and exceptions.
Check (http://docs.oracle.com/javase/tutorial/java/annotations/basics.html). I need to add the syntax into my Java8 grammar. I will notify you when the annotations are added (probably this weekend).
from javaparser.
@rpau In fact, this is any TypeReference that have to hold the annotations. (And not the expressions that contain TypeReferences.)
I'm quite sure the Checker Framework team (washington university) have already done that work on their fork of JavaParser for their initial experiments (almost one year and a half ago). Maybe you could get some stuff from them.
from javaparser.
Thanks @ptitjes for your help. Java 8 Annotations for any TypeReference added in my repo ( https://github.com/rpau/javalang). So, any comment is always welcome :)
from javaparser.
Well done! Hope this will go nicely into JavaParser!
from javaparser.
Any news? We are looking forward to have Java 8 support :D
from javaparser.
I've seen many Java 8 constructs in the code. Any information on when there will be a release that supports the Java 8 changes?
from javaparser.
I suggest we start a separate branch, in that branch I would insert as many examples as possible of code written in Java 8. Do you think it is a good plan?
Does someone knows where to find good examples of code written in Java 8? Perhaps a common set of files used for testing some compiler or tool...
from javaparser.
I wanted to take the source code from OpenJDK8 to test our Java8 compiler but it was released under GPL2. Maybe I should find something else
from javaparser.
I don't know javacc at all, but for what it's worth: I found a (presumably fully working) grammar file over at PMD: http://sourceforge.net/p/pmd/code/ci/master/tree/pmd-java/etc/grammar/Java.jjt
from javaparser.
Interesting, it could help. Our grammar is a bit different and it could require some effort to insert the lambda expressions into it. The problem is that they are rather ambiguos from a parser point of view. It si definitely going to be not trivial to implement... for now I started creating a class for this new AST node and adapt a bunch of visitors to consider it. Now we have to do the difficult part: updating the grammar.
from javaparser.
As I have commented before, in the javalang project we have an updated version of the javacc grammar of javaparser in the project. It can help. We can also have tests that include examples of the Java 8 specification (lambda amb type expressions) to validate the parsing.
from javaparser.
I started writing one test using JBehave (in my fork, branch java8). Probably it is easier to steal it from walkmod (given it is basically a fork of JavaParser)
from javaparser.
There is a fair bit of divergence from memory.
I had already had a go at it here: https://github.com/SmiddyPence/javaparser/tree/Milestone2
Feel free to lift the grammar and try the examples.
from javaparser.
oh, sorry Smiddy, I missed that. Anyway I did not go far at all so not very much duplicate effort :D
Have you already updated the grammar? Can you update on the status? Anything I could help with or is it everything already brilliantly solved :D ?
from javaparser.
P.S. one thing I started to do was updating references to "Java 1.5 parser" into "Java 1.8 parser", promoting the brand first of all!
from javaparser.
Brilliantly solved or maybe just discretely broken. I have just had a look at the differences again to refresh my memory. The javalang version handles comments differently and doesn't have the NameExpr
concept so I had to try and retain those from the original and merge in lambda and type expression changes.
I still need to put together some more tests, to it will take a while to put a pull request together. Or feel free to just lift the grammar out. There is also one Lambda test in the parsing_scenarios.story
file.
from javaparser.
Fire at will:
<dependency>
<groupId>com.github.javaparser</groupId>
<artifactId>javaparser-core</artifactId>
<version>2.0.0</version>
</dependency>
Lets have new issues for specific problems. Thanks
from javaparser.
Thanks!
I just integrated it and adjusted the package names. Will have a go at some Java 8 code next week.
from javaparser.
Working well in my project here so far. Tho I've not stressed much JDK8 code yet..
from javaparser.
Related Issues (20)
- IllegalStateException when removing all comments with LexicalPreservingPrinter HOT 2
- Add easy method to get the parsed information from java.lang.reflection HOT 2
- FieldAccessExpr does not print list of fields accesses of class HOT 4
- Access to the javaparser.org domain
- Getting error while calling calculateResolvedType() on scope in Java Parser HOT 9
- Method 'forEach' cannot be resolved in certain context HOT 5
- Regression in 3.25.9: `Cannot be 'abstract' and also 'private'.` for a `private` method in an interface HOT 2
- Processing nested classes and their methods HOT 9
- Find the first ancestor of a type? HOT 1
- Arrays as Variables HOT 1
- UnsolvedSymbolException ... cannot be resolved in context ... MethodCallExprContext HOT 2
- somtimes AssignExpr.target is wrong HOT 4
- Pattern matching for switch - JEP 441 HOT 2
- nameExpr.resolve().isField() resolves incorrectly in certain context HOT 2
- Strange error when trying to find erasure of generic type where one of two type parameters is an array HOT 2
- Unable to check equality of `ResolvedReferenceType` with a `LazyType`
- Regression from #602 HOT 6
- StackOverflowError with import static in circular dependencies HOT 1
- Question about switch statements and pattern representation HOT 4
- Children may be out of order after adding a statement HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javaparser.