Doxygen
JavaCC.h
浏览该文件的文档.
1 /* Generated By:JavaCC: Do not edit this line. JavaCC.h Version 7.0 */
2 /* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
3 #ifndef JAVACC_JAVACC_H_
4 #define JAVACC_JAVACC_H_
5 
6 #include <string>
7 #include <memory>
8 #include <cassert>
9 #include <functional>
10 
11 #ifndef JAVACC_CHAR_TYPE
12 #define JAVACC_CHAR_TYPE char
13 #endif
14 
15 #ifndef JAVACC_STRING_TYPE
16 #define JAVACC_STRING_TYPE std::basic_string<JAVACC_CHAR_TYPE>
17 #endif
18 
19 #define JAVACC_SIMPLE_STRING std::basic_string<char>
20 
25 
26 // Abstraction on stream classes to read a block of data into a buffer.
27 class ReaderStream {
28 public:
29  // Read block of data into a buffer and return the actual number read.
30  virtual size_t read(JAVACC_CHAR_TYPE *buffer, int offset, size_t len) { return 0; }
31  virtual bool endOfInput() { return true; }
32  virtual ~ReaderStream() {}
33 };
34 
35 const JAVACC_CHAR_TYPE EMPTY[] = { 0 };
36 
37 #ifndef MAX
38 #define MAX(a,b) ((a)>=(b)?(a):(b))
39 #endif
40 #ifndef MIN
41 #define MIN(a,b) ((a)<=(b)?(a):(b))
42 #endif
43 
44 template<typename T>
45 struct JJEnter
46 {
47  JJEnter(T f_) : f{f_} {f();}
49  T f;
50 };
51 template<typename T>
52 struct JJExit
53 {
54  JJExit(T f_) : f{f_} {}
55  ~JJExit(){f();}
56  T f;
57 };
58 
59 #endif
60 /* JavaCC - OriginalChecksum=b719dd5e5f87efc5315d14df0b701850 (do not edit this line) */
JJExit
Definition: JavaCC.h:52
JJEnter
Definition: JavaCC.h:45
ReaderStream::read
virtual size_t read(JAVACC_CHAR_TYPE *buffer, int offset, size_t len)
Definition: JavaCC.h:30
ReaderStream::~ReaderStream
virtual ~ReaderStream()
Definition: JavaCC.h:32
JJSimpleString
JAVACC_SIMPLE_STRING JJSimpleString
Definition: JavaCC.h:24
JJChar
JAVACC_CHAR_TYPE JJChar
Definition: JavaCC.h:21
JAVACC_CHAR_TYPE
#define JAVACC_CHAR_TYPE
Definition: JavaCC.h:12
JJStringBuffer
JAVACC_STRING_TYPE JJStringBuffer
Definition: JavaCC.h:23
JJExit::~JJExit
~JJExit()
Definition: JavaCC.h:55
ReaderStream::endOfInput
virtual bool endOfInput()
Definition: JavaCC.h:31
JJEnter::JJEnter
JJEnter(T f_)
Definition: JavaCC.h:47
EMPTY
const JAVACC_CHAR_TYPE EMPTY[]
Definition: JavaCC.h:35
JJEnter::~JJEnter
~JJEnter()
Definition: JavaCC.h:48
JJString
JAVACC_STRING_TYPE JJString
Definition: JavaCC.h:22
JAVACC_STRING_TYPE
#define JAVACC_STRING_TYPE
Definition: JavaCC.h:16
JJExit::JJExit
JJExit(T f_)
Definition: JavaCC.h:54
JJExit::f
T f
Definition: JavaCC.h:56
JAVACC_SIMPLE_STRING
#define JAVACC_SIMPLE_STRING
Definition: JavaCC.h:19
JJEnter::f
T f
Definition: JavaCC.h:49
ReaderStream
Definition: JavaCC.h:27