librelist archives

« back to archive

Jison for PHP

Jison for PHP

From:
Robert Plummer
Date:
2011-05-14 @ 20:29
Hey Guys,
I've showed Zach this and wanted to share it with you guys and find out
where to go with it.  I've created a php-version of the jison output for a
spreadsheet formula parser:

jison: https://jquerysheet.googlecode.com/svn/trunk/parser.jison
js: https://jquerysheet.googlecode.com/svn/trunk/parser.js
php(alpha): https://jquerysheet.googlecode.com/svn/trunk/parser.php

What I want to accomplish is a method to export a php version of the same
parser, and wanted to run it by you guys.  The reason is that having a
server side to do some parsing would be very advantageous in many cases.
 What I thought about doing was creating a simple way to inject this files
with php, so I thought, a good method would be to be possibly have an
alternative or php version of the equivalent javascript.

For instance:

e
: e '<=' e
{$$ = ($1 * 1) <= ($3 * 1);}|PHP::{$S = ($1 * 1) <= ($3 * 1);}

Or something like that.  Be kind, this is just a thought.  So rather than
bring in php fully (into the parsing and everything), we trust the user to
create php code that can be parsed.  Se we have an equivalent in php, or
a unified javascript & php parser.  What do you guys think?

Robert Plummer