Skip to content

Commit

Permalink
Addresses review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
domna committed Dec 18, 2023
1 parent eac0657 commit 73314b6
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,20 @@ There is a set of base classes for describing a dispersion.
``A`` and ``B`` are repeated parameters in the formula above.

:ref:`NXdispersion_table`
This describes a tabular dispersion where the dielectric function is an array versus wavelength or energy.
This describes a tabular dispersion where the permittivity is an array versus wavelength or energy.

Formula Grammar
---------------

Below you find a grammar to which the formula should adhere and which can be used to parse and
evaluate the dispersion function. The terms ``single_param_name`` and ``param_name`` should be
filled with the respective single and repeated params from the stored data.
The grammer is written in the `EBNF <https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form>`_ dialect
of `Lark <https://github.com/lark-parser/lark>`_, which is a parsing toolkit for python.
It is easily translatable to general EBNF and other parser generator dialects.
`Here <https://github.com/PyEllips/formula-dispersion>`_ is a reference implementation in Rust/Python with a
`grammar <https://github.com/PyEllips/formula-dispersion/blob/main/src/formula_parser.lalrpop>`_
written in `lalrpop <https://github.com/lalrpop/lalrpop>`_.

.. code-block::
Expand Down

0 comments on commit 73314b6

Please sign in to comment.