The difference between comment and document about the parser
Guoxiong Li
lgxbslgx at gmail.com
Fri Jan 22 15:20:08 UTC 2021
Hi Jon,
Thank you for your comment. I am still confused by the following statement.
> The parser that is currently in the javac compiler is a hand-written LALR
parser.
Does it mean: the compiler of the main-line code was a LALR parser
previously?
Or it means: the compiler of the project `Compiler Grammar` is a LALR
parser?
On Fri, Jan 22, 2021 at 11:03 PM Jonathan Gibbons <
jonathan.gibbons at oracle.com> wrote:
> Hi,
>
> The compiler-grammar project is no longer under active development.
>
> I think the best solution is just to put a warning notice to that effect
> at the top of the project page.
>
> -- Jon
>
> On 1/22/21 12:49 AM, Guoxiong Li wrote:
> > Hi all,
> >
> > The comment at class
> > jdk.compiler/com.sun.tools.javac.parser.JavacParser states it as below.
> >
> > ```
> > /** The parser maps a token sequence into an abstract syntax
> > * tree. It operates by recursive descent, with code derived
> > * systematically from an LL(1) grammar. For efficiency reasons, an
> > * operator precedence scheme is used for parsing binary operation
> > * expressions.
> > ```
> >
> > And the document of the project `Compiler Grammar`[1] states it as below.
> >
> > > The parser that is currently in the javac compiler is a hand-written
> > LALR parser.
> >
> > We can see that one is LL(1) and another is LALR. I think the comment
> > may be right.
> > No matter which one is the right description, the difference is not
> > acceptable and need to be unified.
> >
> > What is your opinion? Any idea is appreciated.
> >
> > [1] http://openjdk.java.net/projects/compiler-grammar/
> > <http://openjdk.java.net/projects/compiler-grammar/>
> >
> > Best Regards.
> >
> > -- xiong
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20210122/2147cd7e/attachment-0001.htm>
More information about the compiler-dev
mailing list