|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
D.gnu - lexer for flex
Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8Bit I have written a flex lexer for d - source attached please point out any bugs (bison parser to follow when written) C 2002/6/11 Jun 11 2002
"C.R.Chafer" <blackmarlin nospam.asean-mail.com> wrote in message news:ae5bmk$2u97$1 digitaldaemon.com...Content-Transfer-Encoding: 8Bit I have written a flex lexer for d - source attached please point out any bugs (bison parser to follow when written) Jun 11 2002
Why not just use lexer.c and parse.c more or less directly? Jun 11 2002
Walter wrote:Why not just use lexer.c and parse.c more or less directly? Jun 12 2002
"Walter" <walter digitalmars.com> wrote in message news:ae60k2$iq5$1 digitaldaemon.com...Why not just use lexer.c and parse.c more or less directly? Jun 12 2002
"Martin M. Pedersen" wrote:It seems you have started what I did too :-) However, I ran into problems with the declaration grammar. The problem is that bison does not do N look-ahead that seems to be required by the D grammar - at least if "parse.c" is to be translated more or less directly. The problem is the Parse::is...() methods in "parse.c" that makes the grammar LALR(N). I have not figured out any way to solve this problem. Another problem is that you cannot easily destinguish type names from other names as in C. If you find your way around these problems, I would very much like to hear about it. I stopped for these reasons. Jul 09 2004
I'm not expert in the parsing department, but I used ANTLR = (http://www.antlr.org/) which is a LL(k) parser generator, outputing = Java, C# or C++. Maybe they could be nudged into generating D code as = well ? Regards, Nicolas Lehuen "Erik de Castro Lopo" <nospam mega-nerd.com> a =E9crit dans le message = de news:40EF24E3.B5BE2EB5 mega-nerd.com..."Martin M. Pedersen" wrote:=20 It seems you have started what I did too :-) However, I ran into = Oct 01 2004
Nicolas Lehuen wrote:I'm not expert in the parsing department, but I used ANTLR (http://www.antlr.org/) which is a LL(k) parser generator, outputing Java, C# or C++. Maybe they could be nudged into generating D code as well ? Regards, Nicolas Lehuen "Erik de Castro Lopo" <nospam mega-nerd.com> a écrit dans le message de news:40EF24E3.B5BE2EB5 mega-nerd.com..."Martin M. Pedersen" wrote:It seems you have started what I did too :-) However, I ran into problems with the declaration grammar. The problem is that bison does not do N look-ahead that seems to be required by the D grammar - at least if "parse.c" is to be translated more or less directly. The problem is the Parse::is...() methods in "parse.c" that makes the grammar LALR(N). I have not figured out any way to solve this problem. Another problem is that you cannot easily destinguish type names from other names as in C. If you find your way around these problems, I would very much like to hear about it. I stopped for these reasons. Oct 02 2004
|