Giter Site home page Giter Site logo

Possible error in Java.g4 about grammars-v4 HOT 3 CLOSED

antlr avatar antlr commented on July 17, 2024
Possible error in Java.g4

from grammars-v4.

Comments (3)

lanyjie avatar lanyjie commented on July 17, 2024

Another rule never used: "packageOrTypeName".

from grammars-v4.

parrt avatar parrt commented on July 17, 2024

Well, that could should parse but i removed typeName. It cannot
distinguish a.b.c w/o type info so it just matches like this in expr:

|   expression '.' 'this'

On Sun, Dec 1, 2013 at 12:38 AM, lanyjie [email protected] wrote:

I found that the rule "typeName" was never used anywhere in the grammar.
Therefore, it would be impossible to parse a statement like this:

java.lang.Object x = 1; //auto-boxing?

BTW, when antlr parse this, what's the depth of look ahead? because at
syntax level, it can't distinguish a qualified name from a chained
attribute access when "java.lang.Object" is parsed. So only when reached
'x' does it know what it is.


Reply to this email directly or view it on GitHubhttps://github.com//issues/31
.

Dictation in use. Please excuse homophones, malapropisms, and nonsense.

from grammars-v4.

parrt avatar parrt commented on July 17, 2024

rm'd packageOrTypeName.

from grammars-v4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.