Say I want to write a small compiler in C which generates PHP bytecode from a custom language of choice (typoscript). How would I do that? Does PHP offer an API? Or would I need to hack parts of the default PHP compiler?
Edit: On a more general note, instead of writing a parser in PHP, could I write it in C and produce PHP opcode (so it would be compatible with other PHP code)?
Edit 2: This could be done as an extension to PHP, so I will look into that.