Commit 04a80fcd authored by Benoit Perrot's avatar Benoit Perrot
Browse files

Make unlimited registers optional.

parent 0bd00a44
2003-07-29 Benot Perrot <benoit@lrde.epita.fr>
* dev/mipsy-scanner-gen.py,
* src/parse/libparse.hh, src/parse/libparse.cc,
* src/parse/parse-tasks.hh, src/parse/parse-tasks.cc:
Make unlimited registers optional.
2003-07-29 Benot Perrot <benoit@lrde.epita.fr>
* src/task/task_register.hh (parse_args): Do not search beyond
......
......@@ -4,6 +4,7 @@ New in 0.3:
* Make option engine support incomplete options.
* --check-callee-save: check that callee save registers are preserved
across a call.
* --unlimited-regs: authorize unlimited registers.
New in 0.2, 2003-07-11:
* Extend supported instruction set and syntax.
......
......@@ -85,10 +85,10 @@ label [a-zA-Z_][a-zA-Z_0-9]*
\")\" return RPAREN;
\",\" return COMMA;
\"+\" return EXP_ADD;
\"-\" return EXP_SUB;
\"*\" return EXP_MUL;
\"/\" return EXP_DIV;
\"+\" return EXP_ADD;
\"-\" return EXP_SUB;
\"*\" return EXP_MUL;
\"/\" return EXP_DIV;
\".text\" return DIR_TEXT;
\".data\" return DIR_DATA;
......@@ -138,13 +138,12 @@ print """
}
\"$x\"{dec_int} {
// if (!unlimited_regs_p)
// {
// std::cerr << *yylloc
// << \": unlimited registers not allowed \"
// << \"(use --FIXME to enable it)\" << std::endl;
// exit_set (exit_scan);
// }
if (!parse::unlimited_regs_p)
{
std::cerr << *yylloc
<< \": unlimited registers prohibited\" << std::endl;
exit_set (exit_scan);
}
yylval->reg = new Register(Register::unlimited, atoi(yytext +2));
return REGISTER;
}
......
......@@ -29,6 +29,9 @@ namespace parse
int trace_scan_p = 0;
int trace_parse_p = 0;
// Authorize unlimited registers.
bool unlimited_regs_p = false;
// Parse a MIPS asm file, return the corresponding abstract syntax.
::inst::Program*
parse (const std::string &fname)
......
......@@ -33,6 +33,8 @@ namespace parse
extern int trace_scan_p;
extern int trace_parse_p;
extern bool unlimited_regs_p;
} // namespace parse
#endif // !PARSE_LIBPARSE_HH
......@@ -36,6 +36,12 @@ namespace parse
trace_scan_p = true;
}
void
unlimited_regs ()
{
unlimited_regs_p = true;
}
void
trace_parse ()
{
......
......@@ -34,11 +34,14 @@ namespace parse
TASK_DECLARE ("trace-scan", "Trace the scanning",
trace_scan, "");
TASK_DECLARE ("unlimited-regs", "Authorize unlimited registers",
unlimited_regs, "");
TASK_DECLARE ("trace-parse", "Trace the parse",
trace_parse, "");
TASK_DECLARE ("parse", "Parse a file",
parse, "");
} // namespace tasks
} // namespace parse
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment