#ifndef SLEELA_SEMANTIC_H #define SLEELA_SEMANTIC_H #include "ast.h" #include "version.h" #include #include namespace sleela { struct SemanticResult { std::vector errors; std::vector warnings; // A method was called on a String while the java.lang.String method // library (class JavaStringMethods) was not loaded; the driver loads it // and re-runs analysis. bool needsStringMethods = false; bool ok() const { return errors.empty(); } }; // Preserve the original two-argument symbol for existing callers and objects. SemanticResult analyzeSemantics(const Program& program, const SyntaxVersion& syntax = SyntaxVersion{1,0}); // Library/SST validation may opt out of the executable-entry-point requirement. SemanticResult analyzeSemantics(const Program& program, const SyntaxVersion& syntax, bool requireMain); } #endif