I guess you are referring to compiled and interpreted code. Compiled code is translated to CPU instructions where as interpreted code like PHP, HTML, CSS, and JavaScript are translated to instructions in whatever language they were programmed in. For PHP it's C. For HTML, CSS, and JavaScript it depends on the language of the browser.
For more information:
https://en.wikipedia.org/wiki/Abstract_syntax_tree
You can create your own programming language using a BNF generator:
https://en.wikipedia.org/wiki/Extended_Backus–Naur_Form
Some libraries provide a working lexer:
https://github.com/doctrine/lexer/blob/master/lib/Doctrine/Common/Lexer/AbstractLexer.php