Homec4science

Add an LR(1) parser generator to libphutil

Authored by epriestley <git@epriestley.com> on Aug 23 2013, 00:56.

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

Committed
epriestley <git@epriestley.com>Aug 23 2013, 00:56
Pushed
aubortMar 17 2017, 12:03
Parents
rPHU5d163efeabb0: Fix Phage unit test issue with ErrorTrap
Branches
Unknown
Tags
Unknown

Event Timeline

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