?? errors.h
字號:
////////////////////////////////////////////////////////////////
//
// S C R I P T H E R M
// A SCRIPTABLE THERMOMETER
//
// entry of the National Semiconductor COP8FLASH Design Contest
// submitted by Alberto Ricci Bitti (C) 2001
// a.riccibitti@ra.nettuno.it
//
//--------------------------------------------------------------
// FOR A BETTER VIEW SET TAB SIZE=4, INDENT SIZE=4
//--------------------------------------------------------------
// FILE : errors.h
// PURPOSE: prints error message and aborts current task
// using a setjmp
// See also the #defines in error.h
//
////////////////////////////////////////////////////////////////
#ifndef ERRORS_INCLUDED
#define ERRORS_INCLUDED
#include <setjmp.h>
// error messages
//ensure that strings match the type_error enumeration
#define error_messages_initilializer { \
"Syntax error", \
"Unbalanced parens", \
"No expression present", \
"Not a variable/procedure", \
"Expected: THEN", \
"Program too complex", \
"Repeat/Ifs unbalanced" \
"Too many variables/procedures" \
};
typedef enum {
SYNTAX_ERROR, UNBALANCED_PARENS, NO_EXPRESSION, EXPECTED_NAME,
EXPECTED_THEN, NESTING_TOO_DEEP, NESTING_UNBALANCED, TOO_MANY_NAMES,
} type_error;
#define error_occurred() setjmp( error_mark )
//issues the specified error if the condition is not met
#define ensure( condition, error ) { if (!(condition)) syntax_error(error); }
extern void syntax_error(type_error error);
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -