Comments (5)
this kind of expression shouldn't be parsed to CastExpr
Original comment by [email protected]
on 1 Apr 2009 at 2:20
- Changed state: Accepted
from javaparser.
I see currently no way to do that easily in the parser without a complete
semantic
analysis. Tell me if I'm wrong. If you point me into the right direction I'm
willing
to do the needed coding to implement it correctly in javaparser.
Original comment by [email protected]
on 6 Apr 2009 at 5:55
from javaparser.
I haven't found a way to determine this kind of expression in the parser.
There is no syntax difference between
int a = (foo)+bar;
and
byte a = (byte)+bar;
where the second expression is indeed a CastExpr. Semantics should be used to
determine if it is a Cast or not. But, if the expression looks like this:
int a = (+foo)+bar;
the parser will recognize it as a simple BinaryExpr with parenthesis in the
left operand.
What I think you could do is add a specific semantic for this case in your
visitor.
It will isn't be a simple task, I will research a little more to check if there
is
any other solution, if I find anything I will reopen this issue.
Original comment by [email protected]
on 13 Apr 2009 at 12:39
- Changed state: Done
from javaparser.
I have found a way to solve this issue in the Java Language Specification. But
to
solve this I will need to make a lot of changes in the parser, I have starter
the
changes now.
Original comment by [email protected]
on 13 Apr 2009 at 12:56
- Changed state: Started
from javaparser.
Issue solved, released in 1.0.7.
thanks!
Original comment by [email protected]
on 13 Apr 2009 at 1:48
- Changed state: Fixed
from javaparser.
Related Issues (20)
- Declare as a deprecated code HOT 1
- comment miss, can not process consecutive comment
- Add support for outputting the AST as XML
- Fix warnings in generated code HOT 1
- IntegerLiteralExpr and StringLiteralExpr HOT 1
- Expression parsing HOT 1
- Comments on empty token
- Missing float literal expression implementation
- Wrong handling of generics in case of inner classes
- Wrong interpretation of Unicode number HOT 2
- method to get rawType
- Expose a way to create a new Parser instance.
- DumpVisitor is declared as final
- Annotation parameters parsing failed when having nested/reoccurring patterns HOT 4
- Type arguments for super field accesses HOT 1
- try with resources
- How to limit the length of code lines produced by javaparser
- Find Statement While, IF, Switch-Case
- IndexOutOfBoundsException when parsing nested comments HOT 2
- Variable Parse
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.