/*******************************************************************\ Module: C++ Parser Author: Daniel Kroening, kroening@cs.cmu.edu \*******************************************************************/ /// \file /// C++ Parser #ifndef CPROVER_CPP_CPP_PARSER_H #define CPROVER_CPP_CPP_PARSER_H #include #include #include "cpp_parse_tree.h" #include "cpp_token_buffer.h" #include class cpp_parsert:public parsert { public: cpp_parse_treet parse_tree; virtual bool parse() override; explicit cpp_parsert(message_handlert &message_handler) : parsert(message_handler), mode(configt::ansi_ct::flavourt::ANSI), recognize_wchar_t(true), token_buffer(message_handler), asm_block_following(false), support_float16(std::nullopt) { } public: // internal state ansi_c_parsert::modet mode; // We can furthermore twiddle the recognition of various // keywords. This is honored in particular modes. bool recognize_wchar_t; cpp_token_buffert token_buffer; cpp_tokent ¤t_token() { return token_buffer.current_token(); } void add_location() { token_buffer.current_token().line_no=get_line_no()-1; token_buffer.current_token().filename = source_location().get_file(); } // scanner unsigned parenthesis_counter; bool asm_block_following; protected: std::optional support_float16; }; #endif // CPROVER_CPP_CPP_PARSER_H