📄 parsetab.h
字号:
////////////////////////////////////////////////////////////////////////////////// parsetab.h -- Definitions exported by parsetab.cc which is created by// makeparse.// NB: All variables exported by parsetab.h begin with pt_.//#ifndef PARSETAB_H#define PARSETAB_H#include "scanner.h"// Required sizes for the following can be gleaned from statistics output// of FMQ#define MAX_PROD_SPACE 1000 // size of array for pt_productions#define MAX_SYM 250 // number of syms in grammar#define MAX_STRING 3000 // total length of all symbol names#define MAX_PROD 300 // number of productions in grammar#define MAX_INSERT_SPACE 2000 // size of array for insertion stringstypedef int prod_sindex_t; // 0..MAX_PROD_SPACEtypedef int prod_index_t; // 0..MAX_PRODstruct production_t { // one production in the grammar prod_sindex_t start; // pointer into production space prod_sindex_t length; // number of symbols in production};typedef short symbol_index_t; // 0..MAX_SYMtypedef short parse_action_t; // -MAX_PROD..MAX_PRODtypedef short insert_sindex_t; // 0..MAX_INSERT_SPACEstruct insert_string_t { insert_sindex_t first; insert_sindex_t last; short cost;};enum sparse_class_t { PARSE_TABLE, PREFIX_TABLE };struct sparse_table_t { sparse_table_t * next; symbol_index_t term; parse_action_t parse_action; // PARSE_TABLE insert_string_t insertion; // PREFIX_TABLE};typedef int string_index_t; // 0..MAX_STRINGstruct symbol_string_t { string_index_t start; string_index_t length;};extern int pt_num_productions, pt_num_symbols;extern production_t pt_productions[MAX_PROD + 1];// Indices into pt_prod_spaceextern int pt_prod_space[MAX_PROD_SPACE + 1];extern prod_sindex_t pt_prod_space_ptr;extern sparse_table_t * pt_table[MAX_SYM + 1];extern bool pt_epsilon_prod[MAX_PROD + 1];extern symbol_string_t pt_symbol_table[MAX_SYM + 1];// Variables for issue_error correction:extern int pt_num_terminals;extern int pt_infinity;// Ridiculously high correction costextern insert_string_t pt_cost_table[MAX_SYM + 1];extern int pt_delete_costs[MAX_MAJOR_TOKEN_NUM + 1];extern major_token_t pt_insert_space[MAX_INSERT_SPACE + 1];extern sparse_table_t * pt_prefix_table[MAX_SYM + 1];extern char pt_string_space[MAX_STRING + 1];#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -