Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Skaldrom's Blog:
Want to create your own progranning language? Lexer & Parser in PHP!
Nov 02, 2007 @ 16:12:00

Skaldrom passed along a link to an article he's written up to show how to use one of the more powerful PEAR packages in a simple "Hello World" kind of script - the PHP_LexerGenerator and PHP_ParserGenerator packages.

Who doesn't dream about it: Your own programming language, because the syntax and the word are expression! A step continue to go to ascend and from the programming language user to the language creator! This is now possible in PHP, but unfortunately only with minimum documentation.

He provides an example of the Lexer/Generator in action - handling a simple mathematical operation. The execution code is first with the Lexer definition file and the code for the parser following. Lastly, he has included the code to make things work - passing the test string into his custom Lexer which is passed off to the Parser and a value returned.

tagged: lexter parser pear package generator example lexter parser pear package generator example

Link:

Skaldrom's Blog:
Want to create your own progranning language? Lexer & Parser in PHP!
Nov 02, 2007 @ 16:12:00

Skaldrom passed along a link to an article he's written up to show how to use one of the more powerful PEAR packages in a simple "Hello World" kind of script - the PHP_LexerGenerator and PHP_ParserGenerator packages.

Who doesn't dream about it: Your own programming language, because the syntax and the word are expression! A step continue to go to ascend and from the programming language user to the language creator! This is now possible in PHP, but unfortunately only with minimum documentation.

He provides an example of the Lexer/Generator in action - handling a simple mathematical operation. The execution code is first with the Lexer definition file and the code for the parser following. Lastly, he has included the code to make things work - passing the test string into his custom Lexer which is passed off to the Parser and a value returned.

tagged: lexter parser pear package generator example lexter parser pear package generator example

Link:


Trending Topics: