7 std::vector<Struct> structs,
\r
8 std::vector<Function> funcs,
\r
9 std::vector<Variable> vars)
\r
11 // switch (s.type) {
\r
12 // case StmtType::Assign:
\r
13 // if (!checkVar(s._assign.))
\r
20 std::vector<Struct> structs,
\r
21 std::vector<Function> funcs,
\r
22 std::vector<Variable> vars)
\r
24 vars.insert(vars.end(), f.parameters.begin(), f.parameters.end());
\r
25 vars.insert(vars.end(), f.body.variables.begin(), f.body.variables.end());
\r
26 for (auto s : f.body.statements) {
\r
27 if (!checkStmt(s, structs, funcs, vars))
\r
33 bool checkProgram(const Program & p)
\r
35 for (auto f : p.functions) {
\r
36 if (!checkFunction(f, p.structs, p.functions, p.variables))
\r
39 for (auto s : p.structs) {
\r
40 std::vector<Variable> vars = p.variables;
\r
41 for (auto v : s.members)
\r
43 for (auto f : s.methods) {
\r
44 if (!checkFunction(f, p.structs, p.functions, vars))
\r