cprover
mini_c_parser.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Mini C Parser
4 
5 Author: 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 "cscanner.h"
16 
17 #include <iosfwd>
18 #include <vector>
19 
20 #include <util/optional.h>
21 
23 {
24  // could be C++20 std::span to avoid copying
25  using tokenst = std::vector<ctokent>;
26 
31 
32  void print(std::ostream &) const;
33  bool is_function() const;
34  bool has_body() const;
36 };
37 
38 using c_translation_unitt = std::vector<c_declarationt>;
39 
40 c_translation_unitt parse_c(std::istream &);
41 
42 std::ostream &operator<<(std::ostream &, const c_declarationt &);
43 
44 #endif // CPROVER_CRANGLER_MINI_C_PARSER_H
cscanner
std::ostream & operator<<(std::ostream &, const c_declarationt &)
c_translation_unitt parse_c(std::istream &)
std::vector< c_declarationt > c_translation_unitt
Definition: mini_c_parser.h:38
nonstd::optional< T > optionalt
Definition: optional.h:35
bool has_body() const
bool is_function() const
void print(std::ostream &) const
tokenst post_declarator
Definition: mini_c_parser.h:29
tokenst initializer
Definition: mini_c_parser.h:30
optionalt< ctokent > declared_identifier() const
tokenst declarator
Definition: mini_c_parser.h:28
tokenst pre_declarator
Definition: mini_c_parser.h:27
std::vector< ctokent > tokenst
Definition: mini_c_parser.h:25