<p>I find myself drawn to the Parsing Expression Grammar formalism for describing domain specific languages, but so far the implementation code I've found has been written in languages like Java and Haskell that aren't web server friendly in the shared hosting environment that my organization has to live with.</p>

<p>Does anyone know of any PEG libraries or PackRat Parser Generators for Javascript or PHP? Of course code generators in any languages that can produce Javascript or PHP source code would do the trick.</p>

[{'answer_id': 79604, 'author': 'Allen', 'author_id': 6043, 'author_profile': 'https://Stackoverflow.com/users/6043', 'pm_score': 3, 'selected': False, 'text': '<p>There is in fact one for Javascript: OMeta. <a href="http://www.tinlizzie.org/ometa/" rel="nofollow noreferrer">http://www.tinlizzie.org/ometa/</a></p>\n\n<p>I also implemented a version of this in Python: <a href="http://github.com/python-parsley/parsley" rel="nofollow noreferrer">http://github.com/python-parsley/parsley</a></p>\n'}, {'answer_id': 79610, 'author': 'Joe Skora', 'author_id': 14057, 'author_profile': 'https://Stackoverflow.com/users/14057', 'pm_score': -1, 'selected': False, 'text': '<p><strong>Have you looked at <a href="http://www.antlr.org/" rel="nofollow noreferrer">ANTLR</a>?</strong>  It produces lexer and parser code, handles abstract syntax trees, lets you insert code the grammar to be injected into the lexer/parser code, and <strong>its available for a variety of languages!</strong></p>\n'}, {'answer_id': 236045, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>look at <a href="https://github.com/leblancmeneses/NPEG" rel="nofollow noreferrer">https://github.com/leblancmeneses/NPEG</a>  can easily be converted into php.\nParse tree is created with anonymous functions.</p>\n'}, {'answer_id': 1364204, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': '<p>There\'s also <a href="http://freecode.com/projects/kouprey" rel="nofollow noreferrer">Kouprey</a> for JavaScript, which is a very easy to use PEG generator/library.</p>\n'}, {'answer_id': 2476022, 'author': 'David Majda', 'author_id': 277736, 'author_profile': 'https://Stackoverflow.com/users/277736', 'pm_score': 4, 'selected': False, 'text': '<p>I have recently written <a href="http://pegjs.majda.cz/" rel="noreferrer">PEG.js</a>, PEG-based parser generator for JavaScript. It can be used from a command-line or you can try it from your browser.</p>\n'}, {'answer_id': 5318855, 'author': 'jcubic', 'author_id': 387194, 'author_profile': 'https://Stackoverflow.com/users/387194', 'pm_score': 2, 'selected': False, 'text': '<p>php PEG <a href="https://github.com/maetl/php-peg" rel="nofollow">https://github.com/maetl/php-peg</a></p>\n\n<p>This post is really old but I found it through google, and It should have been answered</p>\n'}, {'answer_id': 13337742, 'author': 'ento', 'author_id': 20226, 'author_profile': 'https://Stackoverflow.com/users/20226', 'pm_score': 2, 'selected': False, 'text': '<p><a href="http://languagejs.com/" rel="nofollow">Language.js</a>:</p>\n\n<blockquote>\n  <p>Language.js is an open source experimental new parser based on PEG (Parsing Expression Grammar), with the special addition of the "naughty OR" operator to handle errors in a unique new way. It makes use of memoization to achieve linear time parsing speed</p>\n</blockquote>\n'}]
['https://Stackoverflow.com/questions/79584', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/14706/']