...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Style Guide | ![]() |
![]() |
![]() |
![]() |
At some point, especially when there are lots of semantic actions attached to various points, the grammar tends to be quite difficult to follow. In order to keep an easy-to-read, consistent en aesthetically pleasing look to the Spirit code, the following coding styleguide is advised.
This coding style is adapted and extended from the ANTLR/PCCTS style (Terrence Parr) and Boost coding guidelines (David Abrahams and Nathan Myers) and is the combined work of Joel de Guzman, Chris Uzdavinis and Hartmut Kaiser.
program = program_heading [heading_action] >> block [block_action] >> '.' | another_sequence >> etc ;
program_heading = as_lower_d["program"] >> identifier >> '(' >> file_identifier >> *( ',' >> file_identifier ) >> ')' >> ';' ;
identifier = nocase [ lexeme [ alpha >> *(alnum | '_') [id_action] ] ] ;
block = *( label_declaration_part | constant_definition_part | type_definition_part | variable_declaration_part | procedure_and_function_declaration_part ) >> statement_part ;
![]() |
![]() |
![]() |
Copyright © 2001-2003 Joel de Guzman
Copyright © 2001-2002 Hartmut Kaiser
Copyright © 2001-2002 Chris Uzdavinis
Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)