minic.h

来自「压缩包里面的都是精致的基本C语言小程序」· C头文件 代码 · 共 69 行

H
69
字号
#ifndef MINIC_H#define MINIC_H#include "../lib/linkedList.h"#include "../lib/set.h"#include "../lib/str.h"typedef struct exp *exp;typedef struct stm *stm;typedef struct prog *prog;struct exp{  enum {ADD, SUB, TIMES, ID, NUM} kind;  union  {    struct    {      exp e1;      exp e2;    } binop;        str id;    int i;  } u;};struct stm{  enum {ASSIGN, PRINT} kind;  union  {    struct    {      str id;      exp e;    } a;    exp print;  } u;};struct prog{  linkedList stms;};exp miniCNewExpAdd (exp e1, exp e2);exp miniCNewExpSub (exp e1, exp e2);exp miniCNewExpTimes (exp e1, exp e2);exp miniCNewExpId (str id);exp miniCNewExpNum (int i);stm miniCNewStmAssign (str id, exp e);stm miniCNewStmPrint (exp e);prog miniCNewProg (linkedList stms);void miniCPrettyPrintExp (exp e);void miniCPrettyPrintStm (stm s);void miniCPrettyPrintProg (prog p);str miniCToStringExp (exp e);str miniCToStringStm (stm s);str miniCToStringProg (prog p);set miniCSetOfNum (exp e);#endif

⌨️ 快捷键说明

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