util.h
来自「tiny编译器++」· C头文件 代码 · 共 47 行
H
47 行
/****************************************************/
/* File: util.h */
/* Utility functions for the TINY compiler */
/* Compiler Construction: Principles and Practice */
/* Kenneth C. Louden */
/****************************************************/
#ifndef _UTIL_H_
#define _UTIL_H_
/* Procedure printToken prints a token
* and its lexeme to the listing file
*/
void printToken(TokenType, const char*);
/* Function newProgNode creates a new declaration
* node for syntax tree construction
*/
TreeNode * newProgNode(void);
/* Function newDeclNode creates a new declaration
* node for syntax tree construction
*/
TreeNode * newDeclNode(DeclKind);
/* Function newStmtNode creates a new statement
* node for syntax tree construction
*/
TreeNode * newStmtNode(StmtKind);
/* Function newExpNode creates a new expression
* node for syntax tree construction
*/
TreeNode * newExpNode(ExpKind);
/* Function copyString allocates and makes a new
* copy of an existing string
*/
char * copyString(char *);
/* procedure printTree prints a syntax tree to the
* listing file using indentation to indicate subtrees
*/
void printTree(TreeNode *);
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?