Hey I'm looking for a light and portable lib or something that'll let me parse simple expressions at runtime with a syntax similar to c++. I need loops and conditionals, but no advanced object manip and stuff. Example:
for(i=0; i < 20; i++) { if(i < 12) { V[i] = A*B; } else { V[i] = 0; } }
I've looked at v8, lua (though syntax is bonkers). I feel like both are also overkill. Any suggestions?
Name:
Anonymous2012-01-29 21:56
Why the fuck would anyone ever want to parse syntax like that? It's like parsing straight english and compiling the result. Jesus.
Name:
Anonymous2012-01-29 22:14
Its definitely a weird use case. I'm working on this parser that takes a bytestream from a device and converts it to a meaningful value. The expression to convert the data isn't definitive though -- it varies between between devices by make and model so I can't hardcode all the interpretations and forget about it.
I need people who aren't programmers to be able to add interpretations without compiling in an easy manner so they can support their device with minimal effort.