[Home]->[Documentation]->[Syntac Universal Parser]->[Other Grammars]->[Extended Backus-Naur form (EBNF)]->[Symbols]->[body_declaration]
|
ebnf::body_declaration
|
| body_declaration[parser_type & tree] ::= { std::string _path;/* }*/ 'include' lws filepath[_path] { std::ifstream _in(_path.c_str(), std::ios_base::binary | std::ios_base::in); if (!_in.is_open()) { for (syntac::code_store::string_vector::const_iterator _pathx = tree.include_path.begin(), _pathy = tree.include_path.end();/* _pathx != _pathy; ++ _pathx)*/ { std::string _filepath(* _pathx); _filepath.append(_path); _in.open(_filepath.c_str(), std::ios_base::binary | std::ios_base::in); if (_in.is_open()) { _path.assign(_filepath); break; } } } if (_in.is_open()) { if (_M_ParseMode == DependMode) { std::cout << ' ' << _path; } if (_M_verbose) { std::cerr << std::endl << "include: " << _path << " START" << std::endl; } std::ifstream _inc(_path.c_str(), std::ios_base::binary | std::ios_base::in); /* handle the defaults: */ bool _was_implicit_ws = tree.get_implicit_ws(); tree.set_implicit_ws(true); if (!syntac_file(_inc, tree, true, _path.c_str())) { std::cerr << get_last_error(); } tree.set_implicit_ws(_was_implicit_ws); if (_M_verbose) { std::cerr << std::endl << "include: " << _path << " COMPLETE" << std::endl; } } else { std::cerr << $file << ':' << $line << ": error: could not include: " << _path << std::endl; flag_error(); } } | 'entry[-_]?point' (lws entrypoint[tree])+ | 'implicit[-_]?whitespace' (lws label[_path])? { tree.set_implicit_ws(true); if (!_path.empty()) tree.set_implicit_ws_symbol(_path); } | 'explicit[-_]?whitespace' { tree.set_implicit_ws(false);/* }*/ | 'list[-_]?seperator' (lws label[_path])? { if (!_path.empty()) tree.set_list_symbol(_path); else tree.set_list_symbol("list_seperator"); } | 'case[-_]?sensitive' { tree.set_case_sensitive(true);/* }*/ | 'case[-_]?insensitive' { tree.set_case_sensitive(false);/* }*/ | 'encoding' lws ( '(binary|8-?bit|latin-?1|iso[ -_]?8859-?1)'i { tree.set_encoding(syntac::encoding_binary);/* } */ | '(ascii|text|7-?bit)'i { tree.set_encoding(syntac::encoding_ascii);/* }*/ | ('(utf-?8|unicode|31-?bit)'i { tree.set_encoding(syntac::encoding_utf8);/* })*/ ) | ('type' lws typedefinition[_path] (lws labeldef[tree, _path])* { if ($4.empty()) { tree.set_default_type(_path); } }) |
|
|
Page last modified on 26 Nov 2008 Products-Documentation-Download-Support-About Us-Contact-Sitemap
Please contact the webmaster with any questions or comments regarding this site.
All material Copyright © 2001-2011 Scarlet Line. Artwork by Anastasya Shepherd. All rights reserved.