The generated zassembly_backwards looks wrong?
#1509
|
preserve these functions generateed void Model::zassembly_backwards(struct zinstruction *z6zE1808, const_sail_string zargz3)
{
struct zinstruction z3zE31231;
CREATE(zinstruction)(&z3zE31231);
{
sail_match_failure("assembly_backwards");
/* unreachable after exit */
goto finish_match_24442;
}
case_24786: ;
{
sail_match_failure("assembly_backwards");
/* unreachable after exit */
goto finish_match_24442;
}
case_24785: ;
{
sail_match_failure("assembly_backwards");
/* unreachable after exit */
goto finish_match_24442;
}
case_24784: ;
{
sail_string zp0z3;
CREATE(sail_string)(&zp0z3);
COPY(sail_string)(&zp0z3, zargz3);
bool z3zE31573;
z3zE31573 = eq_string(zp0z3, "pause");
if (!(z3zE31573)) {
KILL(sail_string)(&zp0z3);
goto case_24783;
}
zPAUSE(&z3zE31231, UNIT);
KILL(sail_string)(&zp0z3);
goto finish_match_24442;
}
..."pause" is never reachable? I think the cases that really match failed should be at the end? or just don't generate them? |
Replies: 2 comments 3 replies
|
Is that really how it starts? Looks totally wrong - isn't it going to immediately always call |
|
Currently the parsing direction (from string to something) for string append patterns doesn't compile to anything. They are marked internally as non-executable and if you try to call them from any function reachable from the instruction semantics you'll get an error. In general they can't easily be compiled into straightforward C, as one needs some kind of backtracking parser to handle the nested cases. If we're to compile them we would essentially be creating our own parser generator. |
Currently the parsing direction (from string to something) for string append patterns doesn't compile to anything. They are marked internally as non-executable and if you try to call them from any function reachable from the instruction semantics you'll get an error.
In general they can't easily be compiled into straightforward C, as one needs some kind of backtracking parser to handle the nested cases. If we're to compile them we would essentially be creating our own parser generator.