Re: [dev] lex and yacc

2019-04-01 Thread sylvain . bertrand
On Sun, Mar 31, 2019 at 10:45:04PM -0700, Louis Santillan wrote: > There's options. Have you tried Lemon Parser [0] or miniyacc + qbe > [1][2]? ucpp [3] lexes/parses C-like languages with C pre-processing. > re2c [4] is a great lexer. Crockford prefers Pratt's Top-Down > Operator Precedence [5][

Re: [dev] lex and yacc

2019-03-31 Thread Louis Santillan
On Sun, Mar 10, 2019 at 6:48 AM wrote: > > On Sun, Mar 10, 2019 at 06:17:16AM +0100, Markus Wichmann wrote: > > Well, other people have made that point before: Why use a regex to > > identify a token when a simple loop will do? > > > > So for lexing, usually a simple token parser in C will do the

Re: [dev] lex and yacc

2019-03-11 Thread k0ga
> So for lexing, usually a simple token parser in C will do the job > better. And for parsing, you get the problem that yacc will create an > LALR parser, which is a bottom-up parser. Which may be faster but > doesn't allow for good error messages on faulty input ("error: expected > this, that, or

Re: [dev] lex and yacc

2019-03-10 Thread sylvain . bertrand
On Sun, Mar 10, 2019 at 06:17:16AM +0100, Markus Wichmann wrote: > Well, other people have made that point before: Why use a regex to > identify a token when a simple loop will do? > > So for lexing, usually a simple token parser in C will do the job > better. And for parsing, you get the problem

Re: [dev] lex and yacc

2019-03-09 Thread Markus Wichmann
On Sat, Mar 09, 2019 at 06:59:38PM +, sylvain.bertr...@gmail.com wrote: > Hi, > > I am coding a little/simple custom language parser, and I was wondering if > there > are "suckless" grade alternatives to flex and bison, anyone? But wait... > > That said and as of today, I still don't agree w

Re: [dev] lex and yacc

2019-03-09 Thread Hiltjo Posthuma
On Sat, Mar 09, 2019 at 06:59:38PM +, sylvain.bertr...@gmail.com wrote: > Hi, > > I am coding a little/simple custom language parser, and I was wondering if > there > are "suckless" grade alternatives to flex and bison, anyone? But wait... > > That said and as of today, I still don't agree w

[dev] lex and yacc

2019-03-09 Thread sylvain . bertrand
Hi, I am coding a little/simple custom language parser, and I was wondering if there are "suckless" grade alternatives to flex and bison, anyone? But wait... That said and as of today, I still don't agree with myself on the usefullness of lex/yacc in the first place. For instance, I am puzzled by