radeco
radeco copied to clipboard
Default VM implementation
With the current esil-rs implementation, I find myself using the following pattern quite regularly.
// Initializations
let mut p = Parser::init(None);
while let Some(ref opinfo) = self.instruction_source.next() {
let esil = opinfo.esil.as_ref().unwrap()
while let Some(token) = p.parse::<_, Tokenizer>(esil) {
let result = {
// Do some operations with tokens returned.
}
p.push(result);
}
}
It would be nice to have a default Evaluator / Consumer / VM implementation that would do this for us, while allowing us to customize it for the needed operation.
how do you want to handle customops