简体   繁体   English

Bison(和Flex)编码约定

[英]Bison (and flex) coding conventions

What are coding conventions and guidelines you suggest for writing Bison (.y) and flex (.lex) files? 您建议编写Bison(.y)和flex(.lex)文件的编码约定和准则是什么?

Please address the length of the code sections and their style. 请说明代码段的长度及其样式。

Thanks, 谢谢,
Asaf 阿萨夫

PS, PS,
There's an old thread about it here , but I'm looking for a more detailed answer (and to have it on SO!). 有一个关于它的旧线这里 ,但是我正在寻找一个更详细的解答(并有它如此!)。

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 . Google Code SearchKoders是很好的资源。 Both support searching by a specific programming language; 两者都支持通过特定的编程语言进行搜索; however it appears that only Google has lex as a listed language. 但是,似乎只有Google将lex作为列出的语言。

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. 除此之外,我通常尝试在源代码中保留79或96列,以确保可以并排查看至少2个Windows值的代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM