templates.cpp.JavaCC.h.template Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ph-javacc-maven-plugin Show documentation
Show all versions of ph-javacc-maven-plugin Show documentation
Maven 3 Plugin for processing JavaCC grammar files.
\#ifndef __JAVACC_H
\#define __JAVACC_H
\#include
\#include
\#include
\#include
\#ifndef JAVACC_CHAR_TYPE
\#define JAVACC_CHAR_TYPE char
\#endif
\#ifndef JAVACC_STRING_TYPE
\#define JAVACC_STRING_TYPE std::basic_string
\#endif
\#define JAVACC_SIMPLE_STRING std::basic_string
typedef JAVACC_STRING_TYPE StringBuffer;
typedef JAVACC_STRING_TYPE String;
// Abstraction on stream classes to read a block of data into a buffer.
class ReaderStream {
public:
// Read block of data into a buffer and return the actual number read.
virtual size_t read(JAVACC_CHAR_TYPE *bufptr, int offset, size_t len) {
return 0;
}
virtual bool endOfInput() { return true; }
virtual ~ReaderStream() {}
};
const JAVACC_CHAR_TYPE EMPTY[] = { 0 };
\#ifndef MAX
\#define MAX(a,b) (a>=b?a:b)
\#endif
\#ifndef MAX
\#define MIN(a,b) (a<=b?a:b)
\#endif
\#endif