Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to interpret custom scripting language?

I was wondering what the easiest way to parse/interpret a custom language would be. Are there any libraries that could help me out?

I essentially want the end-user to be able to write scripts using a custom syntax that I design (the syntax will probably be similar to c++) and I would need my C++ protogram to interpret the script, much like how there is a C++ library for parsing LUA.

Are there any libraries/examples to help me, or will I just have to do manual tokenizing, parsing and interpreting?

like image 209
Brad Avatar asked Aug 12 '26 08:08

Brad


1 Answers

There are numerous frameworks to help, but remember that language design is not to be taken lightly - are you sure you're not better off just using Lua?

  • Boost-Spirit
  • ANTLR (in Java, but produces code for other languages)
  • Flex, Bison, Lemon
like image 200
Yann Ramin Avatar answered Aug 15 '26 00:08

Yann Ramin