codestate.h

来自「语法检查程序」· C头文件 代码 · 共 43 行

H
43
字号
/***************************************************************************/
/* NOTE:                                                                   */
/* This document is copyright (c) by Oz Solomon and Yonat Sharon, and is   */
/* bound by the MIT open source license.                                   */ 
/* See License.txt or visit www.opensource.org/licenses/mit-license.html   */
/***************************************************************************/

#ifndef CODE_STATE_H
#define CODE_STATE_H

#include "CodeParser.h"

#pragma warning (disable : 4786)
#include <map>

//
// this file contains definitions necessary for creating state maps
// for specific languages. A state map is simply a collection of
// interrealted CodeState objects,
//

class CodeState;

// CodeAction == member function of Context
typedef void (CodeParser::Context::*CodeAction)(CodeParser::Position);

struct CodeEffect { // defines what happens when a datum is processed
    CodeAction          action;
    const CodeState*    next;
    bool                markPosition;
};

class CodeState : public std::map<CodeParser::Datum, CodeEffect>
{
public:
#ifndef NDEBUG
    const char* itsName;
#endif // NDEBUG
};


#endif // CODE_STATE_H

⌨️ 快捷键说明

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