Open Bug 559547 Opened 14 years ago Updated 2 years ago

[HTML5] The Java to C++ translation should preserve /* ... */ comments appearing where statements can appear

Categories

(Core :: DOM: HTML Parser, defect, P4)

defect

Tracking

()

People

(Reporter: hsivonen, Unassigned)

Details

The translator loses all comments. Since preserving all non-JavaDoc comments is too hard, the Java grammar of the javaparser library used by the translator should be hacked to treat /* ... */ as a statement type when such a comment appears where statements are allowed. These pseudo-statements could then be translated to C++ comments.
Priority: P3 → P4

Hi, I'd like to work on this. Can you point me to the javaparser library so I can take a look?

Flags: needinfo?(hsivonen)

javaparser is the javaparser-1.0.6 branch from https://github.com/javaparser/javaparser . It's an ancient branch, but updating isn't worth the trouble.

The repo for the HTML parser and the translator is https://hg.mozilla.org/projects/htmlparser/

See https://searchfox.org/mozilla-central/source/parser/html/java/README.txt for the in-tree instructions. Once you've let the makefile download the things it downloads, it probably makes sense to set up analogous build and run rules in a Java IDE such as Eclipse instead of using the makefile.

Flags: needinfo?(hsivonen)

I've downloaded the source codes and run the make files. I've also located what I think is the parser for block comments. I'll take a look and start working on modifying the parser and translator.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.