Parser for LWFGs