parse.h

来自「pascal的编译器 交作业没问题」· C头文件 代码 · 共 35 行

H
35
字号
#include "scan.h"

class Parse
{
public:
    Scan scan;                     //词法分析对象
	FILE *listing;
	TreeNode * syntaxTree;         //语法树跟节点
	int Error;
	int indentno;
public:
    Parse(){};
	void Init(FILE *source);
    void MyParse(void);             // 语法分析主函数
	TreeNode * stmt_sequence(void); //---------------->>
    TreeNode * statement(void);
    TreeNode * if_stmt(void);
    TreeNode * repeat_stmt(void);   
    TreeNode * assign_stmt(void);       //递归下降分析 
    TreeNode * read_stmt(void);         //非终结符对应
    TreeNode * write_stmt(void);        //的递归过程
    TreeNode * exp(void);           
    TreeNode * simple_exp(void);
	TreeNode * term(void);
	TreeNode * factor(void);        //<<-------------------
	void syntaxError(char * message);
    void match(TokenType expected);
    TreeNode * newStmtNode(StmtKind kind);
    TreeNode * newExpNode(ExpKind kind);
	char * Strcpy(char * s);
	void printTree( TreeNode * tree );
	void printToken( TokenType token, const char* tokenString );
	void printSpaces(void);
};

⌨️ 快捷键说明

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