We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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 there complete possible example of visitor or expression processor on C++? Not sure how to make this work.
#include <iostream> #include <antlr4-runtime.h> #include "ЧислаLexer.h" #include "ЧислаParser.h" #include "ЧислаVisitor.h" using namespace std; //using namespace antlr4; using namespace парсер; class ЧислаBaseVisitor : public ЧислаVisitor { public: virtual std::any visitAОбщееЧисло(ЧислаParser::AОбщееЧислоContext *ctx) override { return visitChildren(ctx); } virtual std::any visitЧислоРимское(ЧислаParser::ЧислоРимскоеContext *ctx) override { return visitChildren(ctx); } virtual std::any visitЧислоВремени(ЧислаParser::ЧислоВремениContext *ctx) override { return visitChildren(ctx); } virtual std::any visitЧисло(ЧислаParser::ЧислоContext *ctx) override { return visitChildren(ctx); } }; int main(int argc, const char* argv[]) { /* std::ifstream stream; stream.open("input.scene"); */ antlr4::ANTLRInputStream input( "0124646ABAB" /*"123.0b 010101001e12"*/); ЧислаLexer lexer(&input); antlr4::CommonTokenStream tokens(&lexer); tokens.fill(); ЧислаParser parser(&tokens); std::cout << "[] Парсер построен: " << parser.getBuildParseTree() << " " << parser.getSourceName() << std::endl; antlr4::tree::ParseTree *update_tree = parser.stored_definition(); //std::cout << tree->toStringTree(&parser) << std::endl; return 0; }
The text was updated successfully, but these errors were encountered:
4.12.1 version doesn't have https://github.com/GiuMaz/antlr4-cpp-example/blob/master/src/main.cpp
.input method or .expression or .expr.
Sorry, something went wrong.
No branches or pull requests
is there complete possible example of visitor or expression processor on C++? Not sure how to make this work.
The text was updated successfully, but these errors were encountered: