00001 /* -*- tcl -*-*/ 00002 /* Transform - Minimize the grammar, through the removal of the*/ 00003 /* unreachable and not useful nonterminals (and expressions).*/ 00004 00005 /* This package assumes to be used from within a PAGE plugin. It uses*/ 00006 /* the API commands listed below. These are identical across the major*/ 00007 /* types of PAGE plugins, allowing this package to be used in reader,*/ 00008 /* transform, and writer plugins. It cannot be used in a configuration*/ 00009 /* plugin, and this makes no sense either.*/ 00010 /* */ 00011 /* To ensure that our assumption is ok we require the relevant pseudo*/ 00012 /* package setup by the PAGE plugin management code.*/ 00013 /* */ 00014 /* -----------------+--*/ 00015 /* page_info | Reporting to the user.*/ 00016 /* page_warning |*/ 00017 /* page_error |*/ 00018 /* -----------------+--*/ 00019 /* page_log_error | Reporting of internals.*/ 00020 /* page_log_warning |*/ 00021 /* page_log_info |*/ 00022 /* -----------------+--*/ 00023 00024 /* ### ### ### ######### ######### #########*/ 00025 /* Requisites*/ 00026 00027 /* @mdgen NODEP: page::plugin*/ 00028 00029 package require page::plugin ; /* S.a. pseudo-package.*/ 00030 package require page::analysis::peg::reachable 00031 package require page::analysis::peg::realizable 00032 00033 namespace ::page::analysis::peg {} 00034 00035 /* ### ### ### ######### ######### #########*/ 00036 /* API*/ 00037 00038 ret ::page::analysis::peg::minimize (type t) { 00039 page_info {[PEG Minimization]} 00040 page_log_info ..Reachability ; ::page::analysis::peg::reachable::remove! 00041 page_log_info ..Realizability ; ::page::analysis::peg::realizable::remove! 00042 00043 page_log_info Ok 00044 return 00045 } 00046 00047 /* ### ### ### ######### ######### #########*/ 00048 /* Ready*/ 00049 00050 package provide page::analysis::peg::minimize 0.1 00051 00052