CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
mini_c_parser.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Mini C Parser
4
5Author: Daniel Kroening, dkr@amazon.com
6
7\*******************************************************************/
8
11
12#ifndef CPROVER_CRANGLER_MINI_C_PARSER_H
13#define CPROVER_CRANGLER_MINI_C_PARSER_H
14
15#include "ctoken.h"
16
17#include <iosfwd>
18#include <optional>
19#include <vector>
20
22{
23 // could be C++20 std::span to avoid copying
24 using tokenst = std::vector<ctokent>;
25
30
31 void print(std::ostream &) const;
32 bool is_function() const;
33 bool has_body() const;
34 std::optional<ctokent> declared_identifier() const;
35};
36
37using c_translation_unitt = std::vector<c_declarationt>;
38
39c_translation_unitt parse_c(std::istream &);
40
41std::ostream &operator<<(std::ostream &, const c_declarationt &);
42
43#endif // CPROVER_CRANGLER_MINI_C_PARSER_H
ctoken
c_translation_unitt parse_c(std::istream &)
std::ostream & operator<<(std::ostream &, const c_declarationt &)
std::vector< c_declarationt > c_translation_unitt
bool has_body() const
std::optional< ctokent > declared_identifier() const
bool is_function() const
void print(std::ostream &) const
tokenst post_declarator
tokenst initializer
tokenst pre_declarator
std::vector< ctokent > tokenst