7 std::vector<Struct> structs,
\r
8 std::vector<Function> funcs,
\r
9 std::vector<Variable> vars)
\r
16 std::vector<Struct> structs,
\r
17 std::vector<Function> funcs,
\r
18 std::vector<Variable> vars)
\r
20 vars.insert(vars.end(), f.parameters.begin(), f.parameters.end());
\r
21 vars.insert(vars.end(), f.body.variables.begin(), f.body.variables.end());
\r
22 for (auto s : f.body.statements)
\r
24 if (!checkStmt(s, structs, funcs, vars))
\r
30 bool checkProgram(const Program & p)
\r
32 for (auto f : p.functions)
\r
34 if (!checkFunction(f, p.structs, p.functions, p.variables))
\r
37 for (auto s : p.structs)
\r
39 std::vector<Variable> vars = p.variables;
\r
40 for (auto v : s.members)
\r
42 for (auto f : s.methods)
\r
44 if (!checkFunction(f, p.structs, p.functions, vars))
\r