📄 treestk.h
字号:
/***** uno: treestk.h *****//* Copyright (c) 2000-2003 by Lucent Technologies - Bell Laboratories *//* All Rights Reserved. This software is for educational purposes only. *//* Permission is given to distribute this code provided that this intro- *//* ductory message is not removed and no monies are exchanged. *//* No guarantee is expressed or implied by the distribution of this code. *//* Software written by Gerard J. Holzmann based on the public domain *//* ANSI-C parser Ctree Version 0.14 from Shaun Flisakowski *//* Original version by Shawn Flisakowski, Apr 7, 1995 */#ifndef TREE_STK_H#define TREE_STK_H#include <stdio.h>#include "config.h"#include "heap.h"#include "tree.h"#include "symtab.h"BEGIN_HEADER#define YYBUFF_SIZE 4096/* Redefinition - original provided by flex/lex */#ifndef YY_BUFFER_STATE_DEFDtypedef struct yy_buffer_state *YY_BUFFER_STATE;#endif#define MX_NODE_1 max(sizeof(leafnode), sizeof(treenode))#define MX_NODE_2 max(sizeof(if_node), sizeof(for_node))#define MX_NODE_SZE max( MX_NODE_1 , MX_NODE_2 )typedef struct stk_item { treenode *parse_tree; /* Pointer to the parse tree */ Heap *node_heap; /* Allocated tree nodes */ char *filename; /* The name of the file */ FILE *yyin; /* A pointer to an open file */ int yylineno; /* Line number */ int yycolno; /* Column number */ int yynxtcol; /* next Column number */ YY_BUFFER_STATE yybuff; /* A buffer for the lexer */ struct stk_item *next; /* Ptr to next item in the stack */} Stk_Item;#define STK_ITEM_SZE (sizeof(Stk_Item))typedef struct treestk { Stk_Item *top; Stk_Item *bottom; context_t *contxt;} TreeStack;#define TREESTK_SZE (sizeof(TreeStack))TreeStack *new_treestk ARGS((void));void delete_treestk ARGS((TreeStack*));Stk_Item *new_stk_item ARGS((FILE*, char*));void delete_stk_item ARGS((Stk_Item*));void push ARGS((TreeStack*, Stk_Item*));void put_on_bottom ARGS((TreeStack*, Stk_Item*));Stk_Item *pop ARGS((TreeStack*));int is_empty ARGS((TreeStack*));Stk_Item *top_of_stack ARGS((TreeStack*));FILE *top_file ARGS((TreeStack*));char *top_filename ARGS((TreeStack*));void reset_position ARGS((TreeStack*));int tree_parse ARGS((TreeStack*, int parse_all));void handle_new_file ARGS((TreeStack*, FILE*, char*));int get_next_file ARGS((TreeStack*));void abort_file ARGS((TreeStack*)); #ifdef DEBUG void show_stack ARGS((TreeStack*));#endifEND_HEADER#endif /* TREE_STK_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -