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

📄 bwbasic.h

📁 这是一个简易的basic语言解释器, 可供我们学习和改进.
💻 H
📖 第 1 页 / 共 4 页
字号:
/***************************************************************        bwbasic.h       Header File                        for Bywater BASIC Interpreter                        Copyright (c) 1993, Ted A. Campbell                        Bywater Software                        email: tcamp@delphi.com        Copyright and Permissions Information:        All U.S. and international rights are claimed by the author,        Ted A. Campbell.	This software is released under the terms of the GNU General	Public License (GPL), which is distributed with this software	in the file "COPYING".  The GPL specifies the terms under	which users may copy and use the software in this distribution.	A separate license is available for commercial distribution,	for information on which you should contact the author.***************************************************************//*---------------------------------------------------------------*//* NOTE: Modifications marked "JBV" were made by Jon B. Volkoff, *//* 11/1995 (eidetics@cerf.net).                                  *//*---------------------------------------------------------------*/#ifndef TRUE#define TRUE    -1#define FALSE   0#endif/***************************************************************	bwbasic.h	Part I: Definitions***************************************************************//* Version number */#define VERSION         "2.20"          /* Current version number *//***************************************************************	bwbasic.h:	Part I-A: Define Major Hardware Implementation			Gone is the simplicity of earlier versions.			You must specify one and only one of the			following hardware implementations as TRUE.			IMP_TTY is the default implementation.			It is the most minimal, but the most			universal hardware implementation.			If you pick IMP_TTY then check the settings			in bwx_tty.h for your system.***************************************************************/#define IMP_TTY         TRUE     /* simple TTY-style interface using stdio */#define IMP_IQC         FALSE    /* IBM PC, Microsoft QuickC Compiler */#define ALLOW_RENUM     TRUE     /* Added by JBV */#if IMP_TTY#include "bwx_tty.h"#endif#if IMP_IQC#include "bwx_iqc.h"#endif/***************************************************************	bwbasic.h:	Part I-B: Define Compiler Implementation			You also need to give some information about			your C compiler.  If your compiler is ANSI-			compatible, don't worry about these.  But			if your compiler is "stock," you might			want to indicate which of the following			sets of features it has or dosn't have.***************************************************************/#ifdef MSDOS#define HAVE_RAISE TRUE#define HAVE_STRING TRUE#define HAVE_STDLIB TRUE#endif#ifdef __STDC__#define	HAVE_SIGNAL	TRUE#else#define	HAVE_SIGNAL	TRUE	/* Compiler supports signal() */#endif#ifdef __STDC__#define	HAVE_LONGJUMP	TRUE#else#define	HAVE_LONGJUMP	TRUE	/* Compiler supports setjmp() and longjmp() */#endif/* configure sets this */#ifndef HAVE_RAISE#define HAVE_RAISE	FALSE	/* Compiler supports raise() */#endif/* configure sets this */#ifndef HAVE_STRING#define	HAVE_STRING	FALSE	/* Compiler has <string.h> header */#endif/* configure sets this */#ifndef HAVE_STDLIB#define HAVE_STDLIB	FALSE	/* Compiler has <stdlib.h> header */#endif/* configure sets this (section added by JBV) */#ifndef HAVE_UNISTD#define HAVE_UNISTD	FALSE	/* Compiler has <unistd.h> header */#endif#ifdef __STDC__#define HAVE_SYSTYPES	TRUE#else#define HAVE_SYSTYPES	TRUE	/* Compiler has <sys/types.h> header */#endif#ifdef __STDC__#define HAVE_SYSSTAT	TRUE#else#define HAVE_SYSSTAT	TRUE	/* Compiler has <sys/stat.h> header */#endif/***************************************************************	bwbasic.h:	Part I-C: Define Program Configuration			You must specify one and only one of the			following progrm configurations as TRUE.			If you specify CFG_CUSTOM, then you will			need to fill out the custom section below.***************************************************************/#define	CFG_ANSIMINIMAL	FALSE   /* Conforms to ANSI Minimal BASIC standard X3.60-1978 */#define CFG_COMMON      FALSE   /* Small implementation with commands and functions common to GWBASIC (tm) and ANSI full BASIC */#define CFG_MSTYPE      FALSE   /* Configuration similar to Microsoft line-oriented BASICs */#define	CFG_ANSIFULL	FALSE	/* Conforms to ANSI Full BASIC standard X3.113-1987 */#define CFG_CUSTOM      TRUE    /* Custom Configuration specified below *//***************************************************************	bwbasic.h:	Part I-D: Define Custom Program Configuration			If you specified CFG_CUSTOM above, then			you will need to fill out this section.***************************************************************/#if CFG_CUSTOM#define COMMAND_SHELL   TRUE		/* allow command shell processing */#define PROFILE         TRUE            /* interpret profile at beginning */#define NUMBER_DOUBLE	TRUE		/* define BASIC number as double: default is float*/#define MULTISEG_LINES  TRUE            /* allow multi-segment lines delimited by ':' */#define PARACT		FALSE		/* Implement PARallen ACTion (Multi-tasking) interpreter */#define INTERACTIVE	TRUE		/* interactive programming environment and related commands */#define COMMON_CMDS	TRUE		/* commands common to ANSI full BASIC and GWBASIC */#if UNIX_CMDS#define UNIX_CMDS	TRUE 		/* implement Unix-style directory commands  */#endif#define STRUCT_CMDS     TRUE           /* commands for structured programming required by full ANSI BASIC */#define MS_CMDS         TRUE            /* commands specific to Microsoft GWBASIC (tm) */#define MS_FUNCS        TRUE            /* Microsoft-specific functions and commands */#define	COMMON_FUNCS	TRUE		/* functions common to GWBASIC and ANSI full BASIC */#define ANSI_FUNCS	TRUE		/* functions required by ANSI full BASIC */#endif					/* end of CFG_CUSTOM *//***************************************************************	bwbasic.h:	Part I-E: Define Natural Language for Messages			One and only one of the following must be			defined as TRUE.  Note that the language			definitions themselves are in file bwb_mes.h.			If none is specified, then ENGLISH will be			taken as the default.***************************************************************/#define STD_ENGLISH     TRUE            /* standard English */#define POL_ENGLISH     FALSE		/* polite English messages */#define IMP_ENGLISH	FALSE		/* impolite English messages */#define LATIN		FALSE		/* Latin language messages */#define STD_RUSSIAN	FALSE		/* Russian language messages */#define STD_GERMAN      FALSE           /* German language messages */#define ESPERANTO       FALSE           /* Esperanto messages *//***************************************************************	bwbasic.h:	Part I-F: Define Debugging Options			You can specify debugging options here.			Defining DEBUG true provides some useful commands:			CMDS, VARS, FNCS***************************************************************/#define DEBUG           FALSE  	/* current debugging */#define PROG_ERRORS     FALSE  	/* identify serious programming errors */					/* and print extensive error messages */					/* This will override messages defined in */					/* bwb_mes.h, and almost all messages will be in English */#define CHECK_RECURSION FALSE		/* check for recursion violation in expression parser */#define INTENSIVE_DEBUG FALSE           /* old debugging; might be useful later */#define REDIRECT_STDERR FALSE           /* Redirect stderr to file ERRFILE */#define TEST_BSTRING    FALSE           /* test bstring integrity */#ifdef __STDC__#define ANSI_C          TRUE            /* FALSE to test and debug non-ANSI-C version					   with ANSI C compiler (watch out) */#endif/***************************************************************	bwbasic.h:	This ends the section of definitions that			users of bwBASIC will normally need to			specify. The following are internally defined.			Note that you may need to set up the default			FILES command and the default editor below.			See Part I-G***************************************************************/#if CFG_ANSIMINIMAL#define COMMAND_SHELL   FALSE		/* allow command shell processing */#define PROFILE		FALSE		/* interpret profile at beginning */#define NUMBER_DOUBLE	FALSE		/* define BASIC number as double: default is float*/#define MULTISEG_LINES	FALSE		/* allow multi-segment lines delimited by ':' */#define PARACT		FALSE		/* Implement PARallen ACTion (Multi-tasking) interpreter */#define INTERACTIVE	TRUE		/* interactive programming environment and related commands */#define COMMON_CMDS	FALSE		/* commands common to ANSI full BASIC and GWBASIC */#if UNIX_CMDS#define UNIX_CMDS	FALSE 		/* implement Unix-style directory commands  */#endif#define STRUCT_CMDS	FALSE		/* commands for structured programming required by full ANSI BASIC */#define MS_CMDS	FALSE		/* commands specific to Microsoft GWBASIC (tm) */#define MS_FUNCS	FALSE		/* Microsoft-specific functions and commands */#define	COMMON_FUNCS	FALSE		/* functions common to GWBASIC and ANSI full BASIC */#define ANSI_FUNCS	FALSE		/* functions required by ANSI full BASIC */#endif					/* end of CFG_ANSIMINIMAL */#if CFG_COMMON#define COMMAND_SHELL   FALSE		/* allow command shell processing */#define PROFILE		FALSE		/* interpret profile at beginning */#define NUMBER_DOUBLE	FALSE		/* define BASIC number as double: default is float*/#define MULTISEG_LINES	FALSE		/* allow multi-segment lines delimited by ':' */#define PARACT		FALSE		/* Implement PARallen ACTion (Multi-tasking) interpreter */#define INTERACTIVE	TRUE		/* interactive programming environment and related commands */#define COMMON_CMDS	TRUE		/* commands common to ANSI full BASIC and GWBASIC */#if UNIX_CMDS#define UNIX_CMDS	FALSE 		/* implement Unix-style directory commands  */#endif#define STRUCT_CMDS	FALSE		/* commands for structured programming required by full ANSI BASIC */#define MS_CMDS	FALSE		/* commands specific to Microsoft GWBASIC (tm) */#define MS_FUNCS	FALSE		/* Microsoft-specific functions and commands */#define	COMMON_FUNCS	TRUE		/* functions common to GWBASIC and ANSI full BASIC */#define ANSI_FUNCS	FALSE		/* functions required by ANSI full BASIC */#endif					/* end of CFG_COMMON */#if CFG_ANSIFULL#define COMMAND_SHELL   TRUE		/* allow command shell processing */#define PROFILE		TRUE		/* interpret profile at beginning */#define NUMBER_DOUBLE	FALSE		/* define BASIC number as double: default is float*/#define MULTISEG_LINES	FALSE		/* allow multi-segment lines delimited by ':' */#define PARACT		TRUE		/* Implement PARallen ACTion (Multi-tasking) interpreter */#define INTERACTIVE	TRUE		/* interactive programming environment and related commands */#define COMMON_CMDS	TRUE		/* commands common to ANSI full BASIC and GWBASIC */#if UNIX_CMDS#define UNIX_CMDS	FALSE 		/* implement Unix-style directory commands  */#endif#define STRUCT_CMDS	TRUE		/* commands for structured programming required by full ANSI BASIC */#define MS_CMDS	FALSE		/* commands specific to Microsoft GWBASIC (tm) */#define MS_FUNCS	FALSE		/* Microsoft-specific functions and commands */#define	COMMON_FUNCS	TRUE		/* functions common to GWBASIC and ANSI full BASIC */#define ANSI_FUNCS	TRUE		/* functions required by ANSI full BASIC */#endif					/* end of CFG_ANSIFULL */#if CFG_MSTYPE#define COMMAND_SHELL   FALSE		/* allow command shell processing */#define PROFILE		FALSE		/* interpret profile at beginning */#define NUMBER_DOUBLE	FALSE		/* define BASIC number as double: default is float*/#define MULTISEG_LINES	TRUE		/* allow multi-segment lines delimited by ':' */#define PARACT		FALSE		/* Implement PARallen ACTion (Multi-tasking) interpreter */#define INTERACTIVE	TRUE		/* interactive programming environment and related commands */#define COMMON_CMDS	TRUE		/* commands common to ANSI full BASIC and GWBASIC */#define STRUCT_CMDS	FALSE		/* commands for structured programming required by full ANSI BASIC */#define MS_CMDS	TRUE		/* commands specific to Microsoft GWBASIC (tm) */#define MS_FUNCS	TRUE		/* Microsoft-specific functions and commands */#define	COMMON_FUNCS	TRUE		/* functions common to GWBASIC and ANSI full BASIC */#define ANSI_FUNCS	FALSE		/* functions required by ANSI full BASIC */#endif                                  /* end of CFG_MSTYPE *//* inclusions and definitions necessary if C compiler is not ANSI compliant */#if HAVE_STRING#include <string.h>#else#include <strings.h>#endif#if HAVE_STDLIB#include <stdlib.h>#endif/* Section added by JBV */#if HAVE_UNISTD#include <unistd.h>#endif#if HAVE_SYSTYPES#include <sys/types.h>#endif#if HAVE_STDLIB				/* if neither ANSI */#else#if HAVE_SYSTYPES			/* nor SYSTYPES */#else#define size_t	unsigned int		/* then define these */#define time_t 	long #endif#endif/* define number of commands */#define CMDS_CORE       22              /* number of core commands defined */#if UNIX_CMDS#define CMDS_DIR	5#else#define CMDS_DIR	0#endif#if COMMON_CMDS#define CMDS_COMMON	25 /* Was 24 (JBV) */#else#define CMDS_COMMON	0#endif#if STRUCT_CMDS#define CMDS_STC	10#else#define CMDS_STC	0#endif#if INTERACTIVE#define CMDS_INT	8#else#define CMDS_INT	0#endif#if MS_CMDS

⌨️ 快捷键说明

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