help-bison
[Top][All Lists]
Advanced

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

Re: bison info doc - precedence in recursive parsing


From: Akim Demaille
Subject: Re: bison info doc - precedence in recursive parsing
Date: Tue, 5 Feb 2019 18:56:06 +0100


> Le 5 févr. 2019 à 10:28, Hans Åberg <address@hidden> a écrit :
> 
> 
>> On 5 Feb 2019, at 07:18, Akim Demaille <address@hidden> 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)




reply via email to

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