reader.js
function invokeInitDialectFunctions(dialect, lexer, options) {
  var initfnkey = "__init";
  if(dialect[initfnkey]) {
    dialect[initfnkey](lexer, dialect, options);
  }
  if(dialect.lextab[initfnkey]) {
    dialect.lextab[initfnkey](lexer, dialect, options);
  }
  if(dialect.readtab[initfnkey]) {
    dialect.readtab[initfnkey](lexer, dialect, options);
  }
  if(dialect.gentab[initfnkey]) {
    dialect.gentab[initfnkey](lexer, dialect, options);
  }
}
function invokeInitDialectFunctions(dialect, lexer, options) {
  var initfnkey = "__init";
  if(dialect[initfnkey]) {
    dialect[initfnkey](lexer, dialect, options);
  }
  if(dialect.lextab[initfnkey]) {
    dialect.lextab[initfnkey](lexer, dialect, options);
  }
  if(dialect.readtab[initfnkey]) {
    dialect.readtab[initfnkey](lexer, dialect, options);
  }
  if(dialect.gentab[initfnkey]) {
    dialect.gentab[initfnkey](lexer, dialect, options);
  }
}
function invokeInitDialectFunctions ( dialect , lexer , options ) { var initfnkey = "__init" ; if ( dialect [ initfnkey ] ) { dialect [ initfnkey ] ( lexer , dialect , options ) ; } if ( dialect . lextab [ initfnkey ] ) { dialect . lextab [ initfnkey ] ( lexer , dialect , options ) ; } if ( dialect . readtab [ initfnkey ] ) { dialect . readtab [ initfnkey ] ( lexer , dialect , options ) ; } if ( dialect . gentab [ initfnkey ] ) { dialect . gentab [ initfnkey ] ( lexer , dialect , options ) ; } }
Init dialect functions can optionally be used to initialize things
at the time a dialect is "used".

They can be placed on the dialect, it's lextab, readtab, or gentab,
under a key named "__init" (note we use two underscores).

They receive as arguments the lexer, the dialect, and the overall
options (as passed to "read_from_source".
Init dialect functions can optionally be used to initialize things at the time a dialect is used .