id.h

来自「一个语言识别引擎」· C头文件 代码 · 共 25 行

H
25
字号
// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
#ifndef ID_H
#define ID_H

class ID {
public:
    long int x;
    ID() { x = -1; }
    ID(int nx) { x = nx; }
    bool operator == (const ID& alt) const {
        return x == alt.x;
    }
    long int hash() const {
        return x;
    }
    long int asInt() const {
        return x;
    }
    bool isValid() {
        return x!=-1;
    }
};

#endif

⌨️ 快捷键说明

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