⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 antlr3defs.h

📁 这是一些ANTLR parser generator的grammar文件的例子
💻 H
📖 第 1 页 / 共 2 页
字号:
/** \file * Basic type and constant definitions for ANTLR3 Runtime. */#ifndef	_ANTLR3DEFS_H#define	_ANTLR3DEFS_H/* Following are for generated code, they are not referenced internally!!! */#if !defined(ANTLR3_HUGE) && !defined(ANTLR3_AVERAGE) && !defined(ANTLR3_SMALL)#define	ANTLR3_AVERAGE#endif#ifdef	ANTLR3_HUGE#ifndef	ANTLR3_SIZE_HINT#define	ANTLR3_SIZE_HINT    2049#endif#ifndef	ANTLR3_LIST_SIZE_HINT#define	ANTLR3_LIST_SIZE_HINT 127#endif#endif#ifdef	ANTLR3_AVERAGE#ifndef	ANTLR3_SIZE_HINT#define	ANTLR3_SIZE_HINT    1025#define	ANTLR3_LIST_SIZE_HINT 63#endif#endif#ifdef	ANTLR3_SMALL#ifndef	ANTLR3_SIZE_HINT#define	ANTLR3_SIZE_HINT    211#define	ANTLR3_LIST_SIZE_HINT 31#endif#endif/* Common definitions come first */#include    <antlr3errors.h>#define	ANTLR3_ENCODING_LATIN1	0#define ANTLR3_ENCODING_UCS2	1#define	ANTLR3_ENCODING_UTF8	2#define	ANTLR3_ENCODING_UTF32	3/* Work out what operating system/compiler this is. We just do this once * here and use an internal symbol after this. */#ifdef	_WIN64# ifndef	ANTLR3_WINDOWS#   define	ANTLR3_WINDOWS# endif# define	ANTLR3_WIN64# define	ANTLR3_USE_64BIT#else#ifdef	_WIN32# ifndef	ANTLR3_WINDOWS#  define	ANTLR3_WINDOWS# endif#define	ANTLR3_WIN32#endif#endif#ifdef	ANTLR3_WINDOWS #ifndef WIN32_LEAN_AND_MEAN#define	WIN32_LEAN_AND_MEAN#endif/* Allow VC 8 (vs2005) and above to use 'secure' versions of various functions such as sprintf */#ifndef	_CRT_SECURE_NO_DEPRECATE #define	_CRT_SECURE_NO_DEPRECATE #endif#include    <windows.h>#include	<stdlib.h>#include	<winsock.h>#include    <stdio.h>#include    <sys/types.h>#include    <sys/stat.h>#include    <stdarg.h>#define	ANTLR3_API  __declspec(dllexport)#define	ANTLR3_CDECL __cdecl#define ANTLR3_FASTCALL __fastcall#ifdef __cplusplusextern "C" {#endif#ifndef __MINGW32__// Standard Windows types//typedef	INT32	ANTLR3_CHAR,	*pANTLR3_CHAR;typedef	UINT32	ANTLR3_UCHAR,	*pANTLR3_UCHAR;typedef	INT8	ANTLR3_INT8,	*pANTLR3_INT8;typedef	INT16	ANTLR3_INT16,	*pANTLR3_INT16;typedef	INT32	ANTLR3_INT32,	*pANTLR3_INT32;typedef	INT64	ANTLR3_INT64,	*pANTLR3_INT64;typedef	UINT8	ANTLR3_UINT8,	*pANTLR3_UINT8;typedef	UINT16	ANTLR3_UINT16,	*pANTLR3_UINT16;typedef	UINT32	ANTLR3_UINT32,	*pANTLR3_UINT32;typedef	UINT64	ANTLR3_UINT64,	*pANTLR3_UINT64;typedef UINT64  ANTLR3_BITWORD, *pANTLR3_BITWORD;#else// Mingw uses stdint.h and fails to define standard Microsoft typedefs// such as UINT16, hence we must use stdint.h for Mingw.//#include <stdint.h>typedef int32_t		    ANTLR3_CHAR,    *pANTLR3_CHAR;typedef uint32_t	    ANTLR3_UCHAR,   *pANTLR3_UCHAR;typedef int8_t		    ANTLR3_INT8,    *pANTLR3_INT8;typedef int16_t		    ANTLR3_INT16,   *pANTLR3_INT16;typedef int32_t		    ANTLR3_INT32,   *pANTLR3_INT32;typedef int64_t		    ANTLR3_INT64,   *pANTLR3_INT64;typedef uint8_t	    	ANTLR3_UINT8,   *pANTLR3_UINT8;typedef uint16_t      	ANTLR3_UINT16,  *pANTLR3_UINT16;typedef uint32_t	    ANTLR3_UINT32,  *pANTLR3_UINT32;typedef uint64_t	    ANTLR3_UINT64,  *pANTLR3_UINT64;typedef uint64_t	    ANTLR3_BITWORD, *pANTLR3_BITWORD;#endiftypedef	UINT8	ANTLR3_BOOLEAN, *pANTLR3_BOOLEAN;#define	ANTLR3_UINT64_LIT(lit)	    lit##ULL#define	ANTLR3_INLINE	__inlinetypedef FILE *	    ANTLR3_FDSC;typedef	struct stat ANTLR3_FSTAT_STRUCT;#ifdef	ANTLR3_USE_64BIT#define	ANTLR3_FUNC_PTR(ptr)		(void *)((ANTLR3_UINT64)(ptr))#define ANTLR3_UINT64_CAST(ptr)		(ANTLR3_UINT64)(ptr))#define	ANTLR3_UINT32_CAST(ptr)		(ANTLR3_UINT32)((ANTLR3_UINT64)(ptr))typedef ANTLR3_INT64				ANTLR3_MARKER;			typedef ANTLR3_UINT64				ANTLR3_INTKEY;#else#define	ANTLR3_FUNC_PTR(ptr)		(void *)((ANTLR3_UINT32)(ptr))#define ANTLR3_UINT64_CAST(ptr)   (ANTLR3_UINT64)((ANTLR3_UINT32)(ptr))#define	ANTLR3_UINT32_CAST(ptr)	  (ANTLR3_UINT32)(ptr)typedef	ANTLR3_INT32				ANTLR3_MARKER;typedef ANTLR3_UINT32				ANTLR3_INTKEY;#endif#ifdef	ANTLR3_WIN32#endif#ifdef	ANTLR3_WIN64#endiftypedef	int				ANTLR3_SALENT;								// Type used for size of accept structuretypedef struct sockaddr_in	ANTLR3_SOCKADDRT, * pANTLR3_SOCKADDRT;	// Type used for socket address declarationtypedef struct sockaddr		ANTLR3_SOCKADDRC, * pANTLR3_SOCKADDRC;	// Type used for cast on accept()#define	ANTLR3_CLOSESOCKET	closesocket#ifdef __cplusplus}#endif/* Warnings that are over-zealous such as complaining about strdup, we * can turn off. *//* Don't complain about "deprecated" functions such as strdup */#pragma warning( disable : 4996 )#else/* Include configure generated header file */#include	<antlr3config.h>#include <stdio.h>#if HAVE_STDINT_H# include <stdint.h>#endif#if HAVE_SYS_TYPES_H# include <sys/types.h>#endif#if HAVE_SYS_STAT_H# include <sys/stat.h>#endif#if STDC_HEADERS# include   <stdlib.h># include   <stddef.h># include   <stdarg.h>#else# if HAVE_STDLIB_H#  include  <stdlib.h># endif# if HAVE_STDARG_H#  include  <stdarg.h># endif#endif#if HAVE_STRING_H# if !STDC_HEADERS && HAVE_MEMORY_H#  include <memory.h># endif# include <string.h>#endif#if HAVE_STRINGS_H# include <strings.h>#endif#if HAVE_INTTYPES_H# include <inttypes.h>#endif#if HAVE_UNISTD_H# include <unistd.h>#endif#ifdef HAVE_NETINET_IN_H#include	<netinet/in.h>#endif#ifdef HAVE_SOCKET_H# include	<socket.h>#else# if HAVE_SYS_SOCKET_H#  include	<sys/socket.h># endif#endif#ifdef HAVE_NETINET_TCP_H#include	<netinet/tcp.h>#endif#ifdef HAVE_ARPA_NAMESER_H#include <arpa/nameser.h> /* DNS HEADER struct */#endif#ifdef HAVE_NETDB_H#include <netdb.h>#endif#ifdef HAVE_SYS_RESOLVE_H#include	<sys/resolv.h>#endif#ifdef HAVE_RESOLVE_H#include	<resolv.h>#endif#ifdef	HAVE_MALLOC_H# include    <malloc.h>#else# ifdef	HAVE_SYS_MALLOC_H#  include    <sys/malloc.h># endif#endif#ifdef  HAVE_CTYPE_H# include   <ctype.h>#endif/* Some platforms define a macro, index() in string.h. AIX is * one of these for instance. We must get rid of that definition * as we use ->index all over the place. defining macros like this in system header * files is a really bad idea, but I doubt that IBM will listen to me ;-) */#ifdef	index#undef	index

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -