Re: [9fans] Config File parsing

2012-02-28 Thread erik quanstrom
On Tue Feb 28 11:53:17 EST 2012, ba...@bitblocks.com wrote: > I have almost always used a handwritten lexer as it seemed about the > same amount of work and the end result is much smaller and easier to > understand and lexers for different languages are not all that > different so once you've writt

Re: [9fans] Config File parsing

2012-02-28 Thread Bakul Shah
I have almost always used a handwritten lexer as it seemed about the same amount of work and the end result is much smaller and easier to understand and lexers for different languages are not all that different so once you've written one it is pretty easy to write another; and somehow lex or fle

Re: [9fans] Config File parsing

2012-02-28 Thread Aram Hăvărneanu
Nick LaForge wrote: > If you have "The Unix Programming Environment" handy, you will also > find a lucid tutorial of Lex and Yacc both (in the later chapters). A great complement to this great book is the yacc paper in tenth edition's manual. -- Aram Hăvărneanu

Re: [9fans] Config File parsing

2012-02-27 Thread Nick LaForge
Are you certain you want to use Lex? If no, you may like this fascinating and instructive lecture by Rob Pike, which solves a lexing problem using Golang: http://www.youtube.com/watch?v=HxaD_trXwRE If you have "The Unix Programming Environment" handy, you will also find a lucid tutorial of Lex an

Re: [9fans] Config File parsing

2012-02-27 Thread arnold
O'Reilly's "lex & yacc" is somewhat more user-friendly a reference than the dragon book, although the latter certainly has its value. :-) Arnold

Re: [9fans] Config File parsing

2012-02-27 Thread Jack Norton
On 2/27/2012 7:18 AM, erik quanstrom wrote: For this could someone please tell me how to write a lex and yacc program. you may wish to consult the dragon book. just google it. - erik FYI I just bought my copy on Amazon used for $3.48 USD ($3.99 shipping). It is a hardcopy in great sh

Re: [9fans] Config File parsing

2012-02-27 Thread erik quanstrom
> For this could someone please tell me how to write a lex and yacc > program. you may wish to consult the dragon book. just google it. - erik

[9fans] Config File parsing

2012-02-27 Thread Mohanasundaram VIT
global{ verb test rl0 rand (or) rand =0 [Two cases] } thread{ frac_value = (0.2,(0.1,0.5)) random_thread } OUTPUT should be this: If i give the above input to lex and yacc, based upon the checking of [ rand (or) rand=0 ] if it is "rand", then it should print as " ve