Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

644 lines
16 KiB

  1. //
  2. // Copyright (c) Microsoft Corporation 1995
  3. //
  4. // ast.h
  5. //
  6. // Header file for the abstract syntax tree.
  7. //
  8. // History:
  9. // 05-20-95 ScottH Created
  10. //
  11. #ifndef __AST_H__
  12. #define __AST_H__
  13. typedef struct tagASTEXEC * PASTEXEC;
  14. //
  15. // AST
  16. //
  17. typedef enum
  18. {
  19. AT_BASE,
  20. AT_MODULE_DECL,
  21. AT_PROC_DECL,
  22. AT_ENTER_STMT,
  23. AT_LEAVE_STMT,
  24. AT_ASSIGN_STMT,
  25. AT_HALT_STMT,
  26. AT_LABEL_STMT,
  27. AT_GOTO_STMT,
  28. AT_TRANSMIT_STMT,
  29. AT_WAITFOR_STMT,
  30. AT_DELAY_STMT,
  31. AT_SET_STMT,
  32. AT_WHILE_STMT,
  33. AT_IF_STMT,
  34. AT_INT_EXPR,
  35. AT_STRING_EXPR,
  36. AT_VAR_EXPR,
  37. AT_BOOL_EXPR,
  38. AT_UNOP_EXPR,
  39. AT_BINOP_EXPR,
  40. AT_GETIP_EXPR,
  41. } ASTTYPE;
  42. // Basic AST
  43. typedef struct tagAST
  44. {
  45. DWORD cbSize;
  46. ASTTYPE asttype;
  47. DWORD iLine;
  48. } AST; // Basic AST
  49. DECLARE_STANDARD_TYPES(AST);
  50. #define Ast_GetSize(p) (((PAST)(p))->cbSize)
  51. #define Ast_GetType(p) (((PAST)(p))->asttype)
  52. #define Ast_GetLine(p) (((PAST)(p))->iLine)
  53. #define Ast_SetSize(p, s) (((PAST)(p))->cbSize = (s))
  54. #define Ast_SetType(p, t) (((PAST)(p))->asttype = (t))
  55. #define Ast_SetLine(p, v) (((PAST)(p))->iLine = (v))
  56. RES PUBLIC Ast_New(LPVOID * ppv, ASTTYPE asttype, DWORD cbSize, DWORD iLine);
  57. void PUBLIC Ast_Delete(PAST this);
  58. RES PUBLIC Ast_Dup(PAST this, PAST * ppast);
  59. #ifdef DEBUG
  60. void PUBLIC Ast_Dump(PAST this);
  61. #else
  62. #define Ast_Dump(past)
  63. #endif
  64. // Decl
  65. typedef struct tagDECL
  66. {
  67. AST ast;
  68. PSYMTAB pst; // symbol table
  69. } DECL;
  70. DECLARE_STANDARD_TYPES(DECL);
  71. RES PUBLIC Decl_Delete(PDECL this);
  72. void CALLBACK Decl_DeletePAPtr(LPVOID pv, LPARAM lparam);
  73. // Proc Declaration
  74. typedef struct tagPROCDECL
  75. {
  76. DECL decl;
  77. LPSTR pszIdent;
  78. HPA hpaStmts;
  79. PSYMTAB pst;
  80. } PROCDECL;
  81. DECLARE_STANDARD_TYPES(PROCDECL);
  82. RES PUBLIC ProcDecl_New(PDECL * ppdecl, LPCSTR pszIdent, HPA hpa, PSYMTAB pst, DWORD iLine);
  83. #define ProcDecl_GetIdent(p) (((PPROCDECL)(p))->pszIdent)
  84. #define ProcDecl_GetSymtab(p) (((PPROCDECL)(p))->pst)
  85. // Module Declaration
  86. typedef struct tagMODULEDECL
  87. {
  88. DECL decl;
  89. HPA hpaProcs;
  90. PSYMTAB pst;
  91. } MODULEDECL;
  92. DECLARE_STANDARD_TYPES(MODULEDECL);
  93. RES PUBLIC ModuleDecl_New(PDECL * ppdecl, HPA hpa, PSYMTAB pst, DWORD iLine);
  94. RES PUBLIC ModuleDecl_Parse(PMODULEDECL * ppmoduledecl, PSCANNER pscanner, PSYMTAB pst);
  95. RES PUBLIC ModuleDecl_Typecheck(PMODULEDECL this, HSA hsaStxerr);
  96. RES PUBLIC ModuleDecl_Codegen(PMODULEDECL this, PASTEXEC pastexec);
  97. #define ModuleDecl_GetSymtab(p) (((PMODULEDECL)(p))->pst)
  98. // Expressions
  99. typedef struct tagEXPR
  100. {
  101. AST ast;
  102. DATATYPE dt;
  103. DWORD dwFlags; // EF_*
  104. EVALRES er; // Used when evaluated at runtime
  105. } EXPR;
  106. DECLARE_STANDARD_TYPES(EXPR);
  107. // Expression flags
  108. #define EF_DEFAULT 0x0000
  109. #define EF_DONE 0X0001
  110. #define EF_ALLOCATED 0x0002
  111. RES PUBLIC Expr_Eval(PEXPR this, PASTEXEC pastexec);
  112. RES PUBLIC Expr_Delete(PEXPR this);
  113. void CALLBACK Expr_DeletePAPtr(LPVOID pv, LPARAM lparam);
  114. #define Expr_GetDataType(p) (((PEXPR)(p))->dt)
  115. #define Expr_GetRes(p) (&((PEXPR)(p))->er)
  116. #define Expr_SetDataType(p, x) (((PEXPR)(p))->dt = (x))
  117. #define Expr_SetDone(p) SetFlag(((PEXPR)(p))->dwFlags, EF_DONE)
  118. #define Expr_SetRes(p, x) (Expr_SetDone(p),((PEXPR)(p))->er.dw = (ULONG_PTR)(x))
  119. // Integer Expression
  120. typedef struct tagINTEXPR
  121. {
  122. EXPR expr;
  123. int nVal; // signed value by design
  124. } INTEXPR;
  125. DECLARE_STANDARD_TYPES(INTEXPR);
  126. RES PUBLIC IntExpr_New(PEXPR * ppexpr, int nVal, DWORD iLine);
  127. #define IntExpr_GetVal(p) (((PINTEXPR)(p))->nVal)
  128. #define IntExpr_SetVal(p, n) (((PINTEXPR)(p))->nVal = (n))
  129. // String Expression
  130. typedef struct tagSTREXPR
  131. {
  132. EXPR expr;
  133. LPSTR psz;
  134. } STREXPR;
  135. DECLARE_STANDARD_TYPES(STREXPR);
  136. RES PUBLIC StrExpr_New(PEXPR * ppexpr, LPCSTR psz, DWORD iLine);
  137. #define StrExpr_GetStr(p) (((PSTREXPR)(p))->psz)
  138. #define StrExpr_SetStr(p, n) (((PINTEXPR)(p))->nVal = (n))
  139. // Bool Expression
  140. typedef struct tagBOOLEXPR
  141. {
  142. EXPR expr;
  143. BOOL bVal;
  144. } BOOLEXPR;
  145. DECLARE_STANDARD_TYPES(BOOLEXPR);
  146. RES PUBLIC BoolExpr_New(PEXPR * ppexpr, BOOL bVal, DWORD iLine);
  147. #define BoolExpr_GetVal(p) (((PBOOLEXPR)(p))->bVal)
  148. #define BoolExpr_SetVal(p, b) (((PBOOLEXPR)(p))->bVal = (b))
  149. // Variable Expression
  150. typedef struct tagVAREXPR
  151. {
  152. EXPR expr;
  153. LPSTR pszIdent;
  154. } VAREXPR;
  155. DECLARE_STANDARD_TYPES(VAREXPR);
  156. RES PUBLIC VarExpr_New(PEXPR * ppexpr, LPCSTR pszIdent, DWORD iLine);
  157. #define VarExpr_GetIdent(p) (((PVAREXPR)(p))->pszIdent)
  158. // Binary Operation Expression
  159. typedef enum
  160. {
  161. // WARNING: These types must match the order of their
  162. // corresponding SYM and OP values.
  163. BOT_OR,
  164. BOT_AND,
  165. BOT_LEQ,
  166. BOT_LT,
  167. BOT_GEQ,
  168. BOT_GT,
  169. BOT_NEQ,
  170. BOT_EQ,
  171. BOT_PLUS,
  172. BOT_MINUS,
  173. BOT_MULT,
  174. BOT_DIV,
  175. } BINOPTYPE;
  176. typedef struct tagBINOPEXPR
  177. {
  178. EXPR expr;
  179. BINOPTYPE binoptype;
  180. PEXPR pexpr1;
  181. PEXPR pexpr2;
  182. } BINOPEXPR;
  183. DECLARE_STANDARD_TYPES(BINOPEXPR);
  184. RES PUBLIC BinOpExpr_New(PEXPR * ppexpr, BINOPTYPE binoptype, PEXPR pexpr1, PEXPR pexpr2, DWORD iLine);
  185. #define BinOpExpr_GetType(p) (((PBINOPEXPR)(p))->binoptype)
  186. #define BinOpExpr_GetExpr1(p) (((PBINOPEXPR)(p))->pexpr1)
  187. #define BinOpExpr_GetExpr2(p) (((PBINOPEXPR)(p))->pexpr2)
  188. #define BinOpExpr_SetType(p, t) (((PBINOPEXPR)(p))->binoptype = (t))
  189. #define BinOpExpr_SetRes(p, x) (((PBINOPEXPR)(p))->er.dw = (DWORD)(x))
  190. // Unary Operation Expression
  191. typedef enum
  192. {
  193. UOT_NEG,
  194. UOT_NOT,
  195. UOT_GETIP,
  196. } UNOPTYPE;
  197. typedef struct tagUNOPEXPR
  198. {
  199. EXPR expr;
  200. UNOPTYPE unoptype;
  201. PEXPR pexpr;
  202. EVALRES er; // Used for UOT_GETIP on strings
  203. } UNOPEXPR;
  204. DECLARE_STANDARD_TYPES(UNOPEXPR);
  205. RES PUBLIC UnOpExpr_New(PEXPR * ppexpr, UNOPTYPE unoptype, PEXPR pexpr, DWORD iLine);
  206. #define UnOpExpr_GetType(p) (((PUNOPEXPR)(p))->unoptype)
  207. #define UnOpExpr_GetExpr(p) (((PUNOPEXPR)(p))->pexpr)
  208. #define UnOpExpr_SetType(p, t) (((PUNOPEXPR)(p))->unoptype = (t))
  209. #define UnOpExpr_SetRes(p, x) (((PUNOPEXPR)(p))->er.dw = (DWORD)(x))
  210. // Statements
  211. typedef struct tagSTMT
  212. {
  213. AST ast;
  214. } STMT;
  215. DECLARE_STANDARD_TYPES(STMT);
  216. RES PUBLIC Stmt_Delete(PSTMT this);
  217. void CALLBACK Stmt_DeletePAPtr(LPVOID pv, LPARAM lparam);
  218. RES PUBLIC Stmt_Exec(PSTMT this, PASTEXEC pastexec);
  219. // Enter Statement
  220. typedef struct tagENTERSTMT
  221. {
  222. STMT stmt;
  223. PSYMTAB pst;
  224. } ENTERSTMT;
  225. DECLARE_STANDARD_TYPES(ENTERSTMT);
  226. RES PUBLIC EnterStmt_New(PSTMT * ppstmt, PSYMTAB pst, DWORD iLine);
  227. #define EnterStmt_GetSymtab(p) (((PENTERSTMT)(p))->pst)
  228. // Leave Statement
  229. typedef struct tagLEAVESTMT
  230. {
  231. STMT stmt;
  232. } LEAVESTMT;
  233. DECLARE_STANDARD_TYPES(LEAVESTMT);
  234. RES PUBLIC LeaveStmt_New(PSTMT * ppstmt, DWORD iLine);
  235. // Halt Statement
  236. typedef struct tagHALTSTMT
  237. {
  238. STMT stmt;
  239. } HALTSTMT;
  240. DECLARE_STANDARD_TYPES(HALTSTMT);
  241. RES PUBLIC HaltStmt_New(PSTMT * ppstmt, DWORD iLine);
  242. // Assignment Statement
  243. typedef struct tagASSIGNSTMT
  244. {
  245. STMT stmt;
  246. LPSTR pszIdent;
  247. PEXPR pexpr;
  248. } ASSIGNSTMT;
  249. DECLARE_STANDARD_TYPES(ASSIGNSTMT);
  250. RES PUBLIC AssignStmt_New(PSTMT * ppstmt, LPCSTR pszIdent, PEXPR pexpr, DWORD iLine);
  251. #define AssignStmt_GetIdent(p) (((PASSIGNSTMT)(p))->pszIdent)
  252. #define AssignStmt_GetExpr(p) (((PASSIGNSTMT)(p))->pexpr)
  253. // While Statement
  254. typedef struct tagWHILESTMT
  255. {
  256. STMT stmt;
  257. PEXPR pexpr;
  258. HPA hpaStmts;
  259. char szTopLabel[MAX_BUF_KEYWORD];
  260. char szEndLabel[MAX_BUF_KEYWORD];
  261. } WHILESTMT;
  262. DECLARE_STANDARD_TYPES(WHILESTMT);
  263. RES PUBLIC WhileStmt_New(PSTMT * ppstmt, PEXPR pexpr, HPA hpaStmts, LPCSTR pszTopLabel, LPCSTR pszEndLabel, DWORD iLine);
  264. #define WhileStmt_GetExpr(p) (((PWHILESTMT)(p))->pexpr)
  265. #define WhileStmt_GetStmtBlock(p) (((PWHILESTMT)(p))->hpaStmts)
  266. #define WhileStmt_GetTopLabel(p) (((PWHILESTMT)(p))->szTopLabel)
  267. #define WhileStmt_GetEndLabel(p) (((PWHILESTMT)(p))->szEndLabel)
  268. // If Statement
  269. typedef struct tagIFSTMT
  270. {
  271. STMT stmt;
  272. PEXPR pexpr;
  273. HPA hpaStmts;
  274. char szElseLabel[MAX_BUF_KEYWORD];
  275. char szEndLabel[MAX_BUF_KEYWORD];
  276. } IFSTMT;
  277. DECLARE_STANDARD_TYPES(IFSTMT);
  278. RES PUBLIC IfStmt_New(PSTMT * ppstmt, PEXPR pexpr, HPA hpaStmts, LPCSTR pszElseLabel, LPCSTR pszEndLabel, DWORD iLine);
  279. #define IfStmt_GetExpr(p) (((PIFSTMT)(p))->pexpr)
  280. #define IfStmt_GetStmtBlock(p) (((PIFSTMT)(p))->hpaStmts)
  281. #define IfStmt_GetElseLabel(p) (((PIFSTMT)(p))->szElseLabel)
  282. #define IfStmt_GetEndLabel(p) (((PIFSTMT)(p))->szEndLabel)
  283. // Label Statement
  284. typedef struct tagLABELSTMT
  285. {
  286. STMT stmt;
  287. LPSTR psz;
  288. } LABELSTMT;
  289. DECLARE_STANDARD_TYPES(LABELSTMT);
  290. RES PUBLIC LabelStmt_New(PSTMT * ppstmt, LPCSTR psz, DWORD iLine);
  291. #define LabelStmt_GetIdent(p) (((PLABELSTMT)(p))->psz)
  292. // Goto Statement
  293. typedef struct tagGOTOSTMT
  294. {
  295. STMT stmt;
  296. LPSTR psz;
  297. } GOTOSTMT;
  298. DECLARE_STANDARD_TYPES(GOTOSTMT);
  299. RES PUBLIC GotoStmt_New(PSTMT * ppstmt, LPCSTR psz, DWORD iLine);
  300. #define GotoStmt_GetIdent(p) (((PGOTOSTMT)(p))->psz)
  301. // Delay Statement
  302. typedef struct tagDELAYSTMT
  303. {
  304. STMT stmt;
  305. PEXPR pexprSecs;
  306. } DELAYSTMT;
  307. DECLARE_STANDARD_TYPES(DELAYSTMT);
  308. RES PUBLIC DelayStmt_New(PSTMT * ppstmt, PEXPR pexprSecs, DWORD iLine);
  309. #define DelayStmt_GetExpr(p) (((PDELAYSTMT)(p))->pexprSecs)
  310. // WaitFor Statement
  311. typedef struct tagWAITCASE
  312. {
  313. PEXPR pexpr;
  314. LPSTR pszIdent; // label to jump to; may be NULL
  315. DWORD dwFlags; // WCF_*
  316. } WAITCASE;
  317. DECLARE_STANDARD_TYPES(WAITCASE);
  318. // Flags for WaitforStmt
  319. #define WCF_DEFAULT 0x0000
  320. #define WCF_MATCHCASE 0x0001
  321. RES PUBLIC Waitcase_Create(PHSA phsa);
  322. RES PUBLIC Waitcase_Add(HSA hsa, PEXPR pexpr, LPCSTR pszIdent, DWORD dwFlags);
  323. RES PUBLIC Waitcase_Destroy(HSA hsa);
  324. typedef struct tagWAITFORSTMT
  325. {
  326. STMT stmt;
  327. HSA hsa; // List of strings to wait for
  328. PEXPR pexprUntil; // Optional; may be NULL
  329. } WAITFORSTMT;
  330. DECLARE_STANDARD_TYPES(WAITFORSTMT);
  331. RES PUBLIC WaitforStmt_New(PSTMT * ppstmt, HSA hsa, PEXPR pexprUntil, DWORD iLine);
  332. #define WaitforStmt_GetCaseList(p) (((PWAITFORSTMT)(p))->hsa)
  333. #define WaitforStmt_GetUntilExpr(p) (((PWAITFORSTMT)(p))->pexprUntil)
  334. // Transmit Statement
  335. typedef struct tagTRANSMITSTMT
  336. {
  337. STMT stmt;
  338. PEXPR pexpr;
  339. DWORD dwFlags; // TSF_*
  340. } TRANSMITSTMT;
  341. DECLARE_STANDARD_TYPES(TRANSMITSTMT);
  342. // Flags for TransmitStmt
  343. #define TSF_DEFAULT 0x0000
  344. #define TSF_RAW 0x0001
  345. RES PUBLIC TransmitStmt_New(PSTMT * ppstmt, PEXPR pexpr, DWORD dwFlags, DWORD iLine);
  346. #define TransmitStmt_GetExpr(p) (((PTRANSMITSTMT)(p))->pexpr)
  347. #define TransmitStmt_GetFlags(p) (((PTRANSMITSTMT)(p))->dwFlags)
  348. // Set Statement
  349. typedef enum
  350. {
  351. ST_IPADDR,
  352. ST_PORT,
  353. ST_SCREEN,
  354. } SETTYPE;
  355. typedef struct tagSETSTMT
  356. {
  357. STMT stmt;
  358. SETTYPE settype;
  359. } SETSTMT;
  360. DECLARE_STANDARD_TYPES(SETSTMT);
  361. #define SetStmt_GetType(p) (((PSETSTMT)(p))->settype)
  362. #define SetStmt_SetType(p, t) (((PSETSTMT)(p))->settype = (t))
  363. // Set IP Statement
  364. typedef struct tagSETIPSTMT
  365. {
  366. SETSTMT setstmt;
  367. PEXPR pexpr;
  368. } SETIPSTMT;
  369. DECLARE_STANDARD_TYPES(SETIPSTMT);
  370. RES PUBLIC SetIPStmt_New(PSTMT * ppstmt, PEXPR pexpr, DWORD iLine);
  371. #define SetIPStmt_GetExpr(p) (((PSETIPSTMT)(p))->pexpr)
  372. // Set Port Statement
  373. typedef struct tagPORTSTATE
  374. {
  375. DWORD dwFlags; // SPF_*
  376. BYTE nDatabits;
  377. BYTE nParity; // 0-4: none, odd, even, mark, space
  378. BYTE nStopbits; // 0,1,2: 1 bit, 1.5 bits, 2 bits
  379. } PORTSTATE;
  380. DECLARE_STANDARD_TYPES(PORTSTATE);
  381. // Flags for PortState
  382. #define SPF_DATABITS 0x0001
  383. #define SPF_PARITY 0x0002
  384. #define SPF_STOPBITS 0x0004
  385. typedef struct tagSETPORTSTMT
  386. {
  387. SETSTMT setstmt;
  388. PORTSTATE portstate;
  389. } SETPORTSTMT;
  390. DECLARE_STANDARD_TYPES(SETPORTSTMT);
  391. RES PUBLIC SetPortStmt_New(PSTMT * ppstmt, PPORTSTATE pstate, DWORD iLine);
  392. #define SetPortStmt_GetFlags(p) (((PSETPORTSTMT)(p))->portstate.dwFlags)
  393. #define SetPortStmt_GetDatabits(p) (((PSETPORTSTMT)(p))->portstate.nDatabits)
  394. #define SetPortStmt_GetStopbits(p) (((PSETPORTSTMT)(p))->portstate.nStopbits)
  395. #define SetPortStmt_GetParity(p) (((PSETPORTSTMT)(p))->portstate.nParity)
  396. // Set Screen Statement
  397. typedef struct tagSCREENSET
  398. {
  399. DWORD dwFlags; // SPF_*
  400. BOOL fKBOn; // TRUE/FALSE: on, off
  401. } SCREENSET;
  402. DECLARE_STANDARD_TYPES(SCREENSET);
  403. // Flags for Screen settings
  404. #define SPF_KEYBRD 0x0001
  405. typedef struct tagSETSCREENSTMT
  406. {
  407. SETSTMT setstmt;
  408. SCREENSET screenset;
  409. } SETSCREENSTMT;
  410. DECLARE_STANDARD_TYPES(SETSCREENSTMT);
  411. RES PUBLIC SetScreenStmt_New(PSTMT * ppstmt, PSCREENSET pstate, DWORD iLine);
  412. #define SetScreenStmt_GetFlags(p) (((PSETSCREENSTMT)(p))->screenset.dwFlags)
  413. #define SetScreenStmt_GetKeybrd(p) (((PSETSCREENSTMT)(p))->screenset.fKBOn)
  414. //
  415. // AST execute block
  416. //
  417. #define MAX_BUF_IP (3+1+3+1+3+1+3 + 1)
  418. typedef struct tagASTEXEC
  419. {
  420. DWORD dwFlags;
  421. HWND hwnd;
  422. HANDLE hport;
  423. PSESS_CONFIGURATION_INFO psci;
  424. HANDLE hFindFmt;
  425. PSYMTAB pstSystem; // Allocated: system symbol table
  426. HPA hpaPcode;
  427. DWORD ipaCur; // current statement executing
  428. PSYMTAB pstCur; // symbol table for current frame
  429. PSTMT pstmtPending; // pending statement
  430. int cProcDepth; // call depth
  431. HSA hsaStxerr;
  432. char szIP[MAX_BUF_IP];
  433. int nIter; // scratch iterative value
  434. } ASTEXEC;
  435. DECLARE_STANDARD_TYPES(ASTEXEC);
  436. RES PUBLIC Astexec_Init(PASTEXEC this, HANDLE hport, PSESS_CONFIGURATION_INFO psci, HSA hsaStxerr);
  437. RES PUBLIC Astexec_Destroy(PASTEXEC this);
  438. RES PUBLIC Astexec_Add(PASTEXEC this, PSTMT pstmt);
  439. RES PUBLIC Astexec_InsertLabel(PASTEXEC this, LPCSTR pszIdent, PSYMTAB pst);
  440. RES PUBLIC Astexec_JumpToLabel(PASTEXEC this, LPCSTR pszIdent);
  441. void PUBLIC Astexec_SetError(PASTEXEC this, BOOL bSuccess, BOOL bFailure);
  442. RES PUBLIC Astexec_Next(PASTEXEC this);
  443. DWORD PUBLIC Astexec_GetCurLine(PASTEXEC this);
  444. void PUBLIC Astexec_SendString(PASTEXEC this, LPCSTR pszSend, BOOL bRaw);
  445. RES PUBLIC Astexec_SetIPAddr(PASTEXEC this, LPCSTR psz);
  446. RES PUBLIC Astexec_FindFormat(PASTEXEC this, LPDWORD piFound);
  447. RES PUBLIC Astexec_DestroyFindFormat(PASTEXEC this);
  448. // Flags for Astexec
  449. #define AEF_DONE 0x0001
  450. #define AEF_PAUSED 0x0002
  451. #define AEF_HALT 0x0004
  452. #define AEF_WAITUNTIL 0x0010
  453. #define AEF_STOPWAITING 0x0020
  454. #define Astexec_IsDone(this) IsFlagSet((this)->dwFlags, AEF_DONE)
  455. #define Astexec_IsReadPending(this) (NULL != (this)->pstmtPending)
  456. #define Astexec_IsPaused(this) IsFlagSet((this)->dwFlags, AEF_PAUSED)
  457. #define Astexec_IsHalted(this) IsFlagSet((this)->dwFlags, AEF_HALT)
  458. #define Astexec_IsWaitUntil(this) IsFlagSet((this)->dwFlags, AEF_WAITUNTIL)
  459. #define Astexec_GetIPAddr(this) ((this)->szIP)
  460. #define Astexec_GetPending(this) ((this)->pstmtPending)
  461. #define Astexec_ClearPause(this) ClearFlag((this)->dwFlags, AEF_PAUSED)
  462. #define Astexec_ClearWaitUntil(this) ClearFlag((this)->dwFlags, AEF_WAITUNTIL)
  463. #define Astexec_SetStopWaiting(this) SetFlag((this)->dwFlags, AEF_STOPWAITING)
  464. #define Astexec_SetIP(this, ipa) ((this)->ipaCur = (ipa))
  465. #define Astexec_SetHwnd(this, hwndT) ((this)->hwnd = hwndT)
  466. #define Astexec_SetPending(this, pstmt) ((this)->pstmtPending = (pstmt))
  467. #endif // __AST_H__