From 664b749399e89b55d7e9acdf27334c4ab94b9427 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Fri, 21 Jan 2022 22:57:24 -0600 Subject: [PATCH] hx509: Fix sel-gram.y shift/reduce conflicts AND and OR are now binary operators, left-associative, with AND having higher precedence than OR. The not operator is now higher-precedence than the AND and OR operators. --- lib/hx509/Makefile.am | 2 +- lib/hx509/sel-gram.y | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/hx509/Makefile.am b/lib/hx509/Makefile.am index e32da3b93..470047758 100644 --- a/lib/hx509/Makefile.am +++ b/lib/hx509/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = \ hx509_err.c \ hx509_err.h -AM_YFLAGS = -d +AM_YFLAGS = -o sel-gram.c dist_libhx509_la_SOURCES = \ ca.c \ diff --git a/lib/hx509/sel-gram.y b/lib/hx509/sel-gram.y index 7e9d4f26d..0de0831bc 100644 --- a/lib/hx509/sel-gram.y +++ b/lib/hx509/sel-gram.y @@ -78,6 +78,10 @@ %token STRING %token IDENTIFIER +%precedence '!' +%left kw_AND +%left kw_OR + %start start %%