ready to merge docs

This commit is contained in:
2024-08-11 08:37:17 +00:00
parent 9900d5aaf3
commit 22d18436fa
10 changed files with 346 additions and 38 deletions

View File

@ -13,13 +13,15 @@ class MXErrorListener : public antlr4::BaseErrorListener {
MXErrorListener() : no_problem(true) {}
void syntaxError(antlr4::Recognizer *recognizer, antlr4::Token *offendingSymbol, size_t line,
size_t charPositionInLine, const std::string &msg, std::exception_ptr e) override {
std::cout << "line " << line << ":" << charPositionInLine << " AT "
<< offendingSymbol->getText() << ": " << msg << std::endl;
std::cout << "line " << line << ":" << charPositionInLine << " AT " << offendingSymbol->getText() << ": " << msg
<< std::endl;
no_problem = false;
}
bool IsOk() { return no_problem; }
};
std::shared_ptr<ASTNodeBase> BuildAST(Visitor *visitor, antlr4::tree::ParseTree *tree) { ; }
std::shared_ptr<ASTNodeBase> BuildAST(Visitor *visitor, antlr4::tree::ParseTree *tree) {
return std::any_cast<std::shared_ptr<Program_ASTNode>>(visitor->visit(tree));
}
std::shared_ptr<ASTNodeBase> CheckAndDecorate(std::shared_ptr<ASTNodeBase> src) { ; }
void SemanticCheck(std::istream &fin, std::shared_ptr<ASTNodeBase> &ast_out) {