CCCC - C and C++ Code Counter
9999-git
CCCC Development version (post-3.1.4)
Main Page
Classes
Files
File List
File Members
cccc
cccc.h
Go to the documentation of this file.
1
/*
2
* cccc.h
3
* diagnostic and portability facilities for the cccc project
4
*/
5
6
#ifndef _CCCC_H__
7
#define _CCCC_H__
8
9
#ifdef _WIN32
10
#pragma warning (disable:4786 4503)
11
#endif
12
13
// I am trying to standardise on using the ANSI C++ names
14
// for the ANSI C header files, and bringing all of
15
// the includes of these libraries into this file.
16
// I have not yet attempted to purge includes for these
17
// files from the other source files.
18
#include <cassert>
19
#include <cmath>
20
#include <cstdio>
21
#include <cstring>
22
#include <cstdlib>
23
#include <cctype>
24
25
#include <string>
26
using
std::string;
27
#include <iostream>
28
#include <sstream>
29
#include <fstream>
30
using
std::ostream;
31
using
std::istream;
32
using
std::ifstream;
33
using
std::ofstream;
34
using
std::istringstream;
35
using
std::ostringstream;
36
using
std::stringstream;
37
using
std::endl;
38
using
std::cout;
39
using
std::cerr;
40
41
// debugging facilities
42
extern
int
DebugMask
;
43
enum
DebugFlags
{
44
LEXER
=0x01,
45
PARSER
=0x02,
46
COUNTER
=0x04,
47
MEMORY
=0x08,
48
EXTENT
=0x10,
49
DATABASE
=0x20
50
};
51
#define DbgMsg(DF,OS,X) if(DebugMask&DF) { OS << X ; }
52
53
// the global database to which stuff is added...
54
class
CCCC_Project
;
55
extern
CCCC_Project
*
prj
;
56
57
// a nasty global array of identifiers we want the lexer to ignore
58
#define SKIP_IDENTIFIERS_ARRAY_SIZE 256
59
extern
char
*
skip_identifiers
[
SKIP_IDENTIFIERS_ARRAY_SIZE
];
60
#if 0
61
#include "DLGLexer.h"
62
#endif
63
64
// These macros were used to cover differences between the way the
65
// old strstream classes were used in Win32 and GNU builds.
66
// The differences are no longer necessary.
67
#define MAKE_STRSTREAM(X) stringstream X;
68
#define CONVERT_STRSTREAM(X) (X)
69
#define RELEASE_STRSTREAM(X)
70
71
72
// The -gd option generates uncompilable code with a missing
73
// variable called zzTracePrevRuleName if the generated
74
// files cccc.cpp, java.cpp, ada.cpp don't include a version
75
// of AParser.h seen with zzTRACE_RULES defined.
76
// I'm not sure how this is supposed to work, but for the moment
77
// I am including it here which should make all three files OK.
78
// Note that this could break again if the header files shift around
79
// and AParser.h gets read before zzTRACE_RULES is defined.
80
// Another option is turning -gd off, but its the way we do the
81
// cccc -dp debug output which is very useful.
82
#include "
cccc_tok.h
"
83
#define zzTRACE_RULES
84
#include "AParser.h"
85
86
#endif
87
88
89
90
91
92
93
94
95
96
SKIP_IDENTIFIERS_ARRAY_SIZE
#define SKIP_IDENTIFIERS_ARRAY_SIZE
Definition:
cccc.h:58
CCCC_Project
Definition:
cccc_prj.h:45
DebugFlags
DebugFlags
Definition:
cccc.h:43
COUNTER
Definition:
cccc.h:46
prj
CCCC_Project * prj
Definition:
ccccmain.cc:49
DATABASE
Definition:
cccc.h:49
cccc_tok.h
MEMORY
Definition:
cccc.h:47
skip_identifiers
char * skip_identifiers[SKIP_IDENTIFIERS_ARRAY_SIZE]
Definition:
ccccmain.cc:53
EXTENT
Definition:
cccc.h:48
PARSER
Definition:
cccc.h:45
DebugMask
int DebugMask
Definition:
ccccmain.cc:50
LEXER
Definition:
cccc.h:44
Generated on Sat Sep 19 2015 16:02:27 for CCCC - C and C++ Code Counter by
1.8.10