pike.git / lib / modules / Parser.pmod / LR.pmod / module.pmod

version» Context lines:

pike.git/lib/modules/Parser.pmod/LR.pmod/module.pmod:1:   /* -  * $Id: module.pmod,v 1.7 2002/05/24 14:36:28 grubba Exp $ +  * $Id: module.pmod,v 1.8 2002/05/24 15:35:15 grubba Exp $    *    * A BNF-grammar in Pike.    * Compiles to a LALR(1) state-machine.    *    * Henrik Grubbström 1996-11-24    */      #pike __REAL_VERSION__      /*! LALR(1) parser generator
pike.git/lib/modules/Parser.pmod/LR.pmod/module.pmod:173:    //! Verbosity level    //!    //! @int    //! @value -1    //! Just errors.    //! @value 0    //! Errors and warnings.    //! @value 1    //! Also notices.    //! @endint -  optional int verbose=1; +  optional int(-1..1) verbose = 1;       static constant severity_kind = ([ NOTICE:"Notice",    WARNING:"Warning",    ERROR:"Error" ]);       void report(SeverityLevel level, string subsystem, string msg,    mixed ... args)    {    if (level > -verbose) {    werror("%s: %s: "+msg+"\n",    severity_kind[level], subsystem, @args);    }    } -  +  +  //! Create a new error handler. +  //! +  //! @param verbosity +  //! Level of verbosity. +  //! +  //! @seealso +  //! @[verbose] +  static void create(int(-1..1)|void verbosity) +  { +  if (!zero_type(verbosity)) { +  verbose = verbosity;    } -  +  } + }      //! This object implements an LALR(1) parser and compiler.   //!   //! Normal use of this object would be:   //!   //! @pre{   //! set_error_handler   //! {add_rule, set_priority, set_associativity}*   //! set_symbol_to_string   //! compile