first.h

来自「编译原理中的First集与 Follow集生成程序」· C头文件 代码 · 共 55 行

H
55
字号
/*
 *	file:  first.h
 */
#if _MSC_VER >1200  /* msvc6 or later */
#pragma once
#endif

#ifndef __FIRST_H_
#define __FIRST_H_

#include "types.h"
#include "Parse.h"

class First:public Parse
{

public:
    First(Lex &L,Cmd &C):Parse(L,C)
    {

    }


public:
    //求序列begin~end的first集
        array get_First(const array::iterator &begin,
                    const array::iterator &end);

    //求序列v的first集.
    inline
        array get_First(array &v);

    //求文法中token的first集.
    inline
        array get_First(const sint32 token);

    //求文法中token的follow集.
    inline
        array & get_Follow(const sint32 token);
    void        print_First();      //打印first集
    void        print_Follow();     //打印follow集
    void        print_Version(string version);

public://private:  // function
    Void        crt_First();  //Create First Set.
    Void        crt_Follow(); //Create Follow Set.
    biarray first_set;
    biarray follow_set;

protected: //
    inline Void
        unique(array &v);
};

#endif /* __FIRST_H_ */

⌨️ 快捷键说明

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