Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Method for runtime expressions cpp?

Name: Anonymous 2012-01-29 21:55

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: Anonymous 2012-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: Anonymous 2012-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.

Name: Anonymous 2012-01-30 0:03

░░░░░░░░░░░░░░░▄░░░░░░░░░░░░░░░
░░░░░░░░░░░░░▄▀█░░░░░░░░░░░░░░░
░░░░░░░░░░░▄▀░░█░░░░░░░░░░░░░░░
░░░░░░░░░▄▀░░▄▀░░░░░░░░░░░░░░░░
░░░░░░░░█▄░▄▀░░░░░░░░▄█▄░░░░░░░
░░░░░░░░█░▀▄░░░░░░░▄▀░█░▀▄░░░░░
░░░░░░░░▀▄░░▀▄░░░▄▀░░▄▀▄░░▀▄░░░
░▄░░░░░░░░▀▄░░▀▄▀░░▄▀░░░▀▄░░▀▄░
░█▀▄░░░░░░░░▀▄▀█▀▄▀░░░░░░░▀▄░█░
░█░░▀▄░░░░░▄▀░░█░░▀▄░░░░░░░░▀█░
░░▀▄░░▀▄░▄▀░░▄▀░▀▄░░▀▄░░░░░░░░░
░░░░▀▄░░█░░▄▀░░░░░▀▄░▄█░░░░░░░░
░░░░░░▀▄█▄▀░░░░░░░░▄▀░█░░░░░░░░
░░░░░░░░▀░░░░░░░░▄▀░░▄▀░░░░░░░░
░░░░░░░░░░░░░░░▄▀░░▄▀░░░░░░░░░░
░░░░░░░░░░░░░░░█░▄▀░░░░░░░░░░░░
░░░░░░░░░░░░░░░█▀░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░█▄░█░█░▄▀▀▄░░█░░█░█▀▀░▀█▀░█░░░
░█░█▄░█░█░▄▄░░█▄▄█░█▄▄░░█░░█░░░
░█░░█░█░▀▄▄▀░░█░░█░█▄▄░▄█▄░█▄▄░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

Name: Anonymous 2012-01-30 4:12

javascript

Name: Anonymous 2012-01-30 6:02

The D Programming Language

Name: Anonymous 2012-01-30 23:10

>>3

lua

Name: Anonymous 2012-01-30 23:45

Io.

Don't change these.
Name: Email:
Entire Thread Thread List