

Integrate ANTLR 4 into a C ++ application
source link: https://www.codesd.com/item/integrate-antlr-4-into-a-c-application.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Integrate ANTLR 4 into a C ++ application
Recently I picked up a copy of The Definitive ANTLR 4 Reference
and since I am sophisticated when it comes to working with grammars and languages I wanted to work on my DSL I once have written using yacc
and bison
. The general idea is to write a translator (with included validation for type safety(1)) which translates the DSL to JavaScript during runtime which is then executed by v8.
Although ANTLR was designed for inclusion in Java applications I would like to stay with native C++. Can ANTLR 4 produce such a C parser/lexer(2) which I can include using a C++-style wrapper? And how to do so?
(1) The book has some good examples which I will use as a template.
(2) I am not sure but I think that I read somewhere that ANTLR doesn't support output in C++, am I right?
ANTLR v3 has various different targets, most notably Java (of course), C, C#, JavaScript and Python. For a full list, see: http://www.antlr.org/wiki/display/ANTLR3/Code+Generation+Targets
ANTLR v4, however, only has a Java target at this moment.
Related Articles
Integrate a widget into an angular application using a directive
How do I integrate Google Maps into a web application?
How can I integrate Oracle BI into an existing application?
How do I integrate an assembly into a console application without ILMerge?
Google Drive API - Can I integrate Google Docs into my web application?
The client refuses and ldquo; scripts & rdquo; in the environment. How to integrate a * .ps1 into a C # application?
Integrate the jetty into the java application and export it as a jar
How do I integrate this control into my Eclipse application?
How do I integrate a browser into my tk application?
How to integrate Google Ads into an Android application?
How do I integrate Perl Interpreter into a C ++ application doing DLL?
Can you integrate Flash (SWF) into Eclipse-RCP applications
how to integrate flash games into Windows Forms Application.net compact framework under Windows Mobile 6
Is it possible to integrate an iBook into an iOS application?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK