CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ctoken.cpp
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: C Token
4
5Author: Daniel Kroening, dkr@amazon.com
6
7\*******************************************************************/
8
11
12#include "ctoken.h"
13
14#include <ostream>
15
16void ctokent::output(std::ostream &out) const
17{
18 switch(kind)
19 {
20 case END_OF_FILE:
21 out << "END_OF_FILE";
22 break;
23 case INT_LIT:
24 out << "INT";
25 break;
26 case CHAR_LIT:
27 out << "CHAR_LIT";
28 break;
29 case FLOAT_LIT:
30 out << "FLOAT_LIT";
31 break;
32 case STRING_LIT:
33 out << "STRING_LIT";
34 break;
35 case C_COMMENT:
36 out << "C_COMMENT";
37 break;
38 case CPP_COMMENT:
39 out << "CPP_COMMENT";
40 break;
41 case IDENTIFIER:
42 out << "IDENTIFIER";
43 break;
44 case OPERATOR:
45 out << "OPERATOR";
46 break;
47 case WS:
48 out << "WS";
49 break;
51 out << "PREPROCESSOR_DIRECTIVE";
52 break;
53 case SEPARATOR:
54 out << "SEPARATOR";
55 break;
56 case UNKNOWN:
57 out << "UNKNOWN";
58 break;
59 }
60
61 out << ' ' << text;
62}
63
64std::ostream &operator<<(std::ostream &out, const ctokent &t)
65{
66 t.output(out);
67 return out;
68}
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
void output(std::ostream &) const
Definition ctoken.cpp:16
kindt kind
Definition ctoken.h:37
std::string text
Definition ctoken.h:40
std::ostream & operator<<(std::ostream &out, const ctokent &t)
Definition ctoken.cpp:64
ctoken