CBMC
cscanner.h
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: C Scanner
4
5
Author: Daniel Kroening, dkr@amazon.com
6
7
\*******************************************************************/
8
11
12
#ifndef CPROVER_CRANGLER_CSCANNER_H
13
#define CPROVER_CRANGLER_CSCANNER_H
14
15
#include <iosfwd>
16
#include <vector>
17
18
#include "
ctoken.h
"
19
20
class
cscannert
21
{
22
public
:
23
explicit
cscannert
(std::istream &);
24
~cscannert
();
25
26
ctokent
operator()
();
27
28
std::istream &
in
;
29
std::size_t
line_number
= 1;
30
31
bool
return_WS_and_comments
=
false
;
32
33
void
set_token
(std::string text,
ctokent::kindt
kind)
34
{
35
token
.
line_number
=
line_number
;
36
token
.
text
= std::move(text);
37
token
.
kind
= kind;
38
}
39
40
std::vector<ctokent>
get_tokens
();
41
42
protected
:
43
ctokent
token
;
44
};
45
46
extern
cscannert
*
cscanner_ptr
;
47
48
#endif
// CPROVER_CRANGLER_CSCANNER_H
cscannert
Definition:
cscanner.h:21
cscannert::line_number
std::size_t line_number
Definition:
cscanner.h:29
cscannert::set_token
void set_token(std::string text, ctokent::kindt kind)
Definition:
cscanner.h:33
cscannert::~cscannert
~cscannert()
Definition:
cscanner.cpp:22
cscannert::in
std::istream & in
Definition:
cscanner.h:28
cscannert::return_WS_and_comments
bool return_WS_and_comments
Definition:
cscanner.h:31
cscannert::get_tokens
std::vector< ctokent > get_tokens()
Definition:
cscanner.cpp:41
cscannert::cscannert
cscannert(std::istream &)
Definition:
cscanner.cpp:17
cscannert::operator()
ctokent operator()()
Definition:
cscanner.cpp:27
cscannert::token
ctokent token
Definition:
cscanner.h:43
ctokent
Definition:
ctoken.h:19
ctokent::line_number
std::size_t line_number
Definition:
ctoken.h:42
ctokent::kind
kindt kind
Definition:
ctoken.h:37
ctokent::text
std::string text
Definition:
ctoken.h:40
ctokent::kindt
enum { END_OF_FILE, INT_LIT, CHAR_LIT, FLOAT_LIT, STRING_LIT, C_COMMENT, CPP_COMMENT, IDENTIFIER, OPERATOR, WS, SEPARATOR, PREPROCESSOR_DIRECTIVE, UNKNOWN } kindt
Definition:
ctoken.h:35
cscanner_ptr
cscannert * cscanner_ptr
Definition:
cscanner.cpp:11
ctoken.h
ctoken
src
crangler
cscanner.h
Generated by
1.9.1