diff options
Diffstat (limited to 'host/commands/emugen/EntryPoint.cpp')
-rw-r--r-- | host/commands/emugen/EntryPoint.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/host/commands/emugen/EntryPoint.cpp b/host/commands/emugen/EntryPoint.cpp index 20ba8f2f7..6aecac16c 100644 --- a/host/commands/emugen/EntryPoint.cpp +++ b/host/commands/emugen/EntryPoint.cpp @@ -81,6 +81,7 @@ bool EntryPoint::parse(unsigned int lc, const std::string & str) std::string(""), Var::POINTER_OUT, std::string(""), + std::string(""), std::string("")); // function name @@ -117,7 +118,7 @@ bool EntryPoint::parse(unsigned int lc, const std::string & str) varname = oss.str(); } - m_vars.push_back(Var(varname, v, std::string(""), Var::POINTER_IN, "", "")); + m_vars.push_back(Var(varname, v, std::string(""), Var::POINTER_IN, "", "", "")); } pos = last + 1; } @@ -307,6 +308,23 @@ int EntryPoint::setAttribute(const std::string &line, size_t lc) // set the size expression into var pos = last; v->setPackExpression(line.substr(pos)); + } else if (token == "custom_unpack") { + pos = last; + std::string varname = getNextToken(line, pos, &last, WHITESPACE); + + if (varname.size() == 0) { + fprintf(stderr, "ERROR: %u: Missing variable name in 'custom_unpack' attribute\n", (unsigned int)lc); + return -1; + } + Var * v = var(varname); + if (v == NULL) { + fprintf(stderr, "ERROR: %u: variable %s is not a parameter of %s\n", + (unsigned int)lc, varname.c_str(), name().c_str()); + return -2; + } + // set the size expression into var + pos = last; + v->setUnpackExpression(line.substr(pos)); } else if (token == "custom_write") { pos = last; std::string varname = getNextToken(line, pos, &last, WHITESPACE); |