This is Style.info, produced by Macaulay2, version 1.25.11

Style -- style sheets and images for the documentation
******************************************************

Description
===========

This package is primarily a repository for the style sheets and images used by
the html pages in the documentation.

It exports one method, see generateGrammar, for generating
grammar files used for syntax highlighting and/or auto-completion in Macaulay2
code editors and in the html documentation.

Version
=======

This documentation describes version 1.1 of Style.

Exports
=======

  * Functions and commands
      * generateGrammar -- generate a grammar file from
        a template
  * Methods
      * "generateGrammar(String,Function)" -- see generateGrammar,
        -- generate a grammar file from a template
      * "generateGrammar(String,String,Function)" -- see generateGrammar,
        -- generate a grammar file from a template

For the programmer
==================

The object Style, is a package (Macaulay2Doc),
defined in Style.m2, with auxiliary files in Style/.

-------------------------------------------------------------------------------

The source of this document is in Style.m2:122:0.

generateGrammar -- generate a grammar file from a template
**********************************************************

  * Usage:
        generateGrammar(template, outfile, demarkf)
        generateGrammar(outfile, demarkf)
  * Inputs:
      * template, a string (Macaulay2Doc), the filename of the
        template file;
      * outfile, a string (Macaulay2Doc), the filename of the
        output file;
      * demarkf, a function (Macaulay2Doc), how to demark a
        list of symbols;

Description
===========

This method generates a grammar file for use in syntax highlighting Macaulay2
code in a text editor or web browser.

The file template may contain any of the following special strings:

  * @M2BANNER@, for placing a banner mentioning that the resulting file was
    automatically generated.
  * @M2VERSION@, for the current version of Macaulay2.
  * @M2SYMBOLS@, for a list of all Macaulay2 symbols, e.g., for automatic
    completion.
  * @M2KEYWORDS@, for a list of Macaulay2 keywords.
  * @M2DATATYPES@, for a list of Macaulay2 types.
  * @M2FUNCTIONS@, for a list of Macaulay2 functions.
  * @M2CONSTANTS@, for a list of Macaulay2 symbols and packages.
  * @M2STRINGS@, for a regular expression that matches Macaulay2 strings.

The function demarkf indicates how the elements of each of the lists will be
demarked in the resulting file.   The file outfile will then be generated,
replacing each of these strings as indicated above.

+-----------------------------------------------------------------------------+
|i1 : outfile = temporaryFileName()                                           |
|                                                                             |
|o1 = /tmp/M2-144040-0/0                                                      |
+-----------------------------------------------------------------------------+
|i2 : template = outfile | ".in"                                              |
|                                                                             |
|o2 = /tmp/M2-144040-0/0.in                                                   |
+-----------------------------------------------------------------------------+
|i3 : template << "@M2BANNER@" << endl << endl;                               |
+-----------------------------------------------------------------------------+
|i4 : template << "This is an example file for the generateGrammar method!";  |
+-----------------------------------------------------------------------------+
|i5 : template << endl;                                                       |
+-----------------------------------------------------------------------------+
|i6 : template << "String regex: @M2STRINGS@" << endl;                        |
+-----------------------------------------------------------------------------+
|i7 : template << "List of keywords: {" << endl;                              |
+-----------------------------------------------------------------------------+
|i8 : template << "    @M2KEYWORDS@" << endl;                                 |
+-----------------------------------------------------------------------------+
|i9 : template << "}" << endl << close;                                       |
+-----------------------------------------------------------------------------+
|i10 : get template                                                           |
|                                                                             |
|o10 = @M2BANNER@                                                             |
|                                                                             |
|      This is an example file for the generateGrammar method!                |
|      String regex: @M2STRINGS@                                              |
|      List of keywords: {                                                    |
|          @M2KEYWORDS@                                                       |
|      }                                                                      |
+-----------------------------------------------------------------------------+
|i11 : generateGrammar(template, outfile, x -> demark(",\n    ", x))          |
| -- generating /tmp/M2-144040-0/0                                            |
+-----------------------------------------------------------------------------+
|i12 : get outfile                                                            |
|                                                                             |
|o12 = Auto-generated for Macaulay2-1.25.11. Do not modify this file manually.|
|                                                                             |
|      This is an example file for the generateGrammar method!                |
|      String regex: "///\\(/?/?[^/]\\|\\(//\\)*////[^/]\\)*\\(//\\)*///"     |
|      List of keywords: {                                                    |
|          SPACE,                                                             |
|          TEST,                                                              |
|          and,                                                               |
|          break,                                                             |
|          breakpoint,                                                        |
|          catch,                                                             |
|          continue,                                                          |
|          do,                                                                |
|          elapsedTime,                                                       |
|          elapsedTiming,                                                     |
|          else,                                                              |
|          for,                                                               |
|          from,                                                              |
|          global,                                                            |
|          if,                                                                |
|          in,                                                                |
|          list,                                                              |
|          local,                                                             |
|          new,                                                               |
|          not,                                                               |
|          of,                                                                |
|          or,                                                                |
|          profile,                                                           |
|          return,                                                            |
|          shield,                                                            |
|          step,                                                              |
|          symbol,                                                            |
|          then,                                                              |
|          threadLocal,                                                       |
|          threadVariable,                                                    |
|          throw,                                                             |
|          time,                                                              |
|          timing,                                                            |
|          to,                                                                |
|          try,                                                               |
|          when,                                                              |
|          while,                                                             |
|          xor                                                                |
|      }                                                                      |
+-----------------------------------------------------------------------------+

If template is omitted, then it defaults to currentFileDirectory | outfile |
".in".

Ways to use generateGrammar:
============================

  * "generateGrammar(String,Function)"
  * "generateGrammar(String,String,Function)"

For the programmer
==================

The object generateGrammar, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in Style.m2:182:0.