views:

125

answers:

1

Hi,

What are coding conventions and guidelines you suggest for writing Bison (.y) and flex (.lex) files?

Please address the length of the code sections and their style.

Thanks,
Asaf

P.S.,
There's an old thread about it here, but I'm looking for a more detailed answer (and to have it on SO!).

A: 

For questions like this in general I would typically see what other people have done. Good resources for this are Google Code Search and Koders. Both support searching by a specific programming language; however it appears that only Google has lex as a listed language.

Other than that, I generally try to keep to either 79 or 96 columns in source code, to make sure I can view at least 2 windows-worth of code side by side.

Dave Rigby