Re: [Tack-devel] Questions about LLgen
Moved to https://github.com/davidgiven/ack
Brought to you by:
dtrg
From: David G. <dg...@co...> - 2022-02-04 19:17:54
|
On Fri, 4 Feb 2022 at 19:30, Wild Pi <wi...@pr...> wrote: > Thank you for fixing the build error. Although make still fails with the > error below, LLgen is built successfully. I'm going to play with it. > I think the error you're getting is due to not having a full groff installation. I'm not a groff expert, sadly, and I don't know which distribution you're using, so can't advise there. However if you don't want to build the documentation then editing the makefile not to try and build and install it should be trivial. Going back to my second question. Have you built any OO language (C++/Java > etc.) parser with LLgen? Basically, I'd like to know how practical it is to > build a high quality parser for a full feature OO language. It'll be very > helpful if someone could share their experience. > So I've never used LLgen myself. There are a few references to it outside the ACK, but the ACK itself is (AFAIK) the only major user. It's used for C, Modula-2, Occam and Pascal, although note that the Occam compiler is for a very primitive dialect and isn't really useful. The C compilers are definitely production-quality as the ACK was sold commercially for a while. I know that it generates recursive descent compilers, so I can't use it for my own compiler projects which need to be table-based. I would imagine that if it can be used to describe C it could be used for an OO language like Java without much difficulty. Note that LLgen will only cover the gross syntax and not the type system, and you'll still need to have the lexer talk to the symbol table to deal with context insensitivity. (Look in lang/* for the ACK's front-end compilers. LLgen used .g files for its grammars. LLgen's own grammar is also defined in LLgen.) I would imagine that the biggest problem you'll encounter is that LLgen is extremely old, dating back to 1985! It does seem to generate ANSI C source, but the lack of users means that if you encounter any problems you're likely to be on your own, although I'll help if I can. It *appears* to be a pretty competent extended LL(1) parser generator with useful features such as parameterised rules and repeated tokens. There's a desk calculator in appendix B of the manual: http://tack.sourceforge.net/olddocs/LLgen.html The expression evaluator is probably of interest. But of course, there's nothing LLgen will do that you can't also do in other parser generators like bison or (my favourite) lemon. |