Hi all! > Le 26 oct. 2018 à 11:09, Victor Khomenko <[email protected]> a > écrit : > > Hi Akim, Rici, > > Re trailing return types: It’s a minor issue (in the context of bison > manual), let’s agree to disagree to avoid starting a full-blown religious > warfare.
There was no risk. We’re too old for this, we all know we’re just debating about taste, and we know we will probably never converge. Unless you realize you were wrong ;) > Re flex: The whole flex/bison interface is clunky, so no surprise people > invent tricks. Sure. But in the present case, it’s not even about Bison, it is strictly between the scanner and the files. > Some parser generators (ANTLR, JavaCC) solve this problem by integrating the > scanner and parser, which dramatically increases the usability. Absolutely. > Flex/bison are like racing cars, but most users don't drive racing cars. The > mundane things like having a few extra generated includes, a few extra > dependencies in the make file, an extra hour setting things up, make a lot of > difference. I think I agree, but I’m not really sure what you are saying here. If you think there are other things to change, please suggest! > Re AST: I used to think it’s relatively independent from parsing, and in my > code it is. Then you told me that AST should have location information and > special error nodes, which make them intertwined with parsing… Yes. But again, that’s just the first few weeks of a compiler construction course. When you type check, you do want to report the location of the errors. Not to mention debug info emitted by the compiler in the final object that is still able to point to source locations. The Bison manual is also not the place to explain what desugaring is. > Anyway, it was an idea for future development, maybe distant future. (BTW, > ANTLR has cool features related to ASTs.) ANTLR is way more modern than Bison, and more ambitious, no doubt about that. I don’t plan to provide AST traversals either :) Having a means to ask Bison to generate actions given some form of a generic pattern is a different topic. It makes a lot of sense, and some people have discussed about this on various occasions here. That would help to bind to some abstract factory for ASTs for instance, without forcing a specific AST format. The thing is… We need more hands on Bison.
