Home GnuPG

Add an LR(1) parser generator to libphutil
473274f9a7dfUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Add an LR(1) parser generator to libphutil

Summary:
This is a rehash of D4301, but broadly I want to use the little Conduit grammar we have to actually enforce types, e.g. int, map<string, int>, etc.

This grammar ended up being more complex than I was able to handle with a hand-rolled recursive-descent parser, so I implemented an LR(1) parser generator a while ago. It seems to work properly, it's just kind of silly to do this in PHP.

I think this isn't that terrible, though, and we can kind of see if we go anywhere with it, and replace it with some simpler recursive-descent thing or something if it stops making any sense or is a terrible idea.

Test Plan: Ran unit tests, built a little type library on top of this (next revision).

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2039

Differential Revision: https://secure.phabricator.com/D6794

Details

Provenance
epriestley <git@epriestley.com>Authored on Aug 23 2013, 12:56 AM
Parents
rPHUTIL5d163efeabb0: Fix Phage unit test issue with ErrorTrap
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUTIL473274f9a7df: Add an LR(1) parser generator to libphutil (authored by epriestley <git@epriestley.com>).Aug 23 2013, 12:56 AM