I'm working on a simple C application and i had the idea of creating a DSL to define some behaviors of the application. The idea is to create a very clean language, similar to Ruby, but that is actually run in C. All the functions are defined in C, the DSL is just... well, an alias to "hide" the verbose syntax of C.
I know lex and yacc but i think they are overkill for what i'm trying to do. Isn't there something simpler? I thought about regular expressions, but i would feel dirty doing that. Maybe theres something better!
An example:
if a = b
myFunctionInC()
get 'mydata' then
puts 'Hello!'
Easily translates to:
if (a == b) {
myFunctionInC();
}
void get(string test)
{
printf('Hello! %s', test);
}