Re: bison info doc - precedence in recursive parsing

Akim Demaille <[email protected]>
Newsgroups gmane.comp.parsers.bison.general
Message-ID <[email protected]>

> Le 5 févr. 2019 à 10:28, Hans Åberg <[email protected]> a écrit :
> 
> 
>> On 5 Feb 2019, at 07:18, Akim Demaille <[email protected]> wrote:
>> 
>> Yes, on "real life grammars", Dot fails to render anything.  And the result would probably be useless anyway.  This feature is very handy for small grammars, but when it gets too big, you'd better look at the HTML report (or text).
> 
> It only generates XML, it seems: for HTML, using xsltproc, a style sheet is required, and Bison does not seem to come with that.

Yes it does.  Have a look at the Makefiles of the examples.  For instance, that of lexcalc.

# This Makefile is designed to be simple and readable.  It does not
# aim at portability.  It requires GNU Make.

BASE = lexcalc
BISON = bison
FLEX = flex
XSLTPROC = xsltproc

all: $(BASE)

%.c %.h %.xml %.gv: %.y
	$(BISON) $(BISONFLAGS) --defines --xml --graph=$*.gv -o $*.c $<

%.c: %.l
	$(FLEX) $(FLEXFLAGS) -o$@ $<

scan.o: parse.h
lexcalc: parse.o scan.o
	$(CC) $(CFLAGS) -o $@ $^

run: $(BASE)
	@echo "Type arithmetic expressions.  Quit with ctrl-d."
	./$<

html: parse.html
%.html: %.xml
	$(XSLTPROC) $(XSLTPROCFLAGS) -o $@ $$($(BISON) --print-datadir)/xslt/xml2xhtml.xsl $<

CLEANFILES =						\
  $(BASE) *.o						\
  parse.[ch] parse.output parse.xml parse.html parse.gv	\
  scan.c
clean:
	rm -f $(CLEANFILES)


_______________________________________________
[email protected] https://lists.gnu.org/mailman/listinfo/help-bison
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.