Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is JavaCC able to generate a parser for C/C++? #1

Open
Symbolk opened this issue Sep 3, 2018 · 1 comment
Open

Is JavaCC able to generate a parser for C/C++? #1

Symbolk opened this issue Sep 3, 2018 · 1 comment

Comments

@Symbolk
Copy link

Symbolk commented Sep 3, 2018

Hi there,

I am currently reading code from both jFSTMerge and jsFSTMerge, both of which use JavaCC and BNF grammer to generate parsers. But I wonder whether it is capable of generating a parser for C/C++?

@AlbertoTrindade
Copy link
Owner

Hi @Symbolk,

It seems there are already available JavaCC grammars for C++, e.g: http://star.fbk.eu/Internal/CodeAnalysisPlatform/CppParser/.

However, to be able to use the FSTMerge framework, it's necessary to have the grammar in gCIDE format: http://ckaestne.github.io/CIDE/gcidegrammar.html. That's the grammar that is annotated to instruct how the semistructured merge will behave for certain elements.

A JavaCC grammar is automatically generated from the gCIDE one. But having a grammar already written in JavaCC, it should be pretty straightforward to "convert" it into gCIDE format, so you will be able to create a semistructured merge tool for C/C++.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants