superClass support for c++ #4434
Unanswered
marekdaniluk
asked this question in
Q&A
Replies: 1 comment 1 reply
-
You're going to have to add to the lexer .g4 file, just after the options clause, Make sure to use a build process for generating the parser for the Cpp target automatically via the tool (CMake, Make, etc). You don't want to get in the habit of running the Antlr tool by hand. I noticed that the YarnSpinner.Compiler.csproj references the Antlr4.Runtime.Standard but does not include build support, e.g., Antlr4BuildTasks. This means that someone manually runs the Antlr4 Tool by hand, which can lead to problems if not done correctly. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm trying to create a cpp version of YarnSpinner.Compiler/YarnSpinnerLexer.g4, a branching dialog system designed in C Sharp. It uses antlr under the hood, so I tried it out in my C++ project.
I generated the source files using the
-Dlanguage=Cpp
option. YarnSpinner in the lexer script uses thesuperClass
option which generates an incorrectYarnSpinnerLexer.h
file. The problem is, that the YarnSpinnerLexer class inherits from another class not added by#include
.I am currently editing the generated header and adding a line with the appropriate include, but this solution seems inadequate. I wonder if there is a recommended way to solve similar problems for C++ runtime?
Beta Was this translation helpful? Give feedback.
All reactions