[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Implement %define lr.default_rules.

From: Joel E. Denny
Subject: Re: [PATCH] Implement %define lr.default_rules.
Date: Tue, 21 Apr 2009 06:28:59 -0400 (EDT)

On Mon, 20 Apr 2009, Joel E. Denny wrote:

> This is the first patch towards implementing IELR and canonical LR.  I 
> plan to push it to master and branch-2.5.


> I haven't pushed yet because I would really like to rename "default rule" 
> to "default reduction" throughout Bison first:

I may rename it later, but I'm not sure.

> From 9dc5b98ab1c766ae39bd31cd8c6fba1378f88f16 Mon Sep 17 00:00:00 2001
> From: Joel E. Denny <address@hidden>
> Date: Mon, 20 Apr 2009 00:55:50 -0400
> Subject: [PATCH] Implement %define lr.default_rules.
> Its value describes the states that are permitted to contain
> default rules: "all", "consistent", or "accepting".
> * src/reader.c (reader): Default lr.default_rules to "all".
> Check for a valid lr.default_rules value.
> * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
> is "accepting", then only mark the accepting state as
> consistent.
> (initialize_LA): Tell state_lookahead_tokens_count whether
> lr.default_rules is "accepting".
> * src/tables.c (action_row): If lr.default_rules is not "all",
> then disable default rules in inconsistent states.
> * src/print.c (print_reductions): Use this opportunity to
> perform some assertions about whether lr.default_rules was
> obeyed correctly.
> * tests/ (AT_TEST_TABLES_AND_PARSE): New macro that
> helps with checking the parser tables for a grammar.
> * tests/ (%define lr.default_rules invalid values): New
> test group.
> * tests/ (AT_TEST_LR_DEFAULT_RULES): New macro using
> (`no %define lr.default_rules'): New test group generated by
> (`%define lr.default_rules "all"'): Likewise.
> (`%define lr.default_rules "consistent"'): Likewise.
> (`%define lr.default_rules "accepting"'): Likewise.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]