Commit b59ef7d4 authored by Chris Jewell's avatar Chris Jewell
Browse files

Doc changes

parent 760b022a
Pipeline #241 canceled with stage
in 3 minutes and 40 seconds
......@@ -81,17 +81,17 @@ To illustrate our description of semantic analysis, it is useful to consider a G
Semantic analysis currently consists of 3 stages which are executed sequentially:
1. Symbol Declaration (:class:`ParseDeclarations <gem.gemlang.symbol\_resolve.ParseDeclarations>`)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:class:`ParseDeclarations <gem.gemlang.symbol_resolve>` In this stage, a symbol table is built containing builtin GEM symbols as well as symbols declared in the GEM program.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In this stage, a symbol table is built containing builtin GEM symbols as well as symbols declared in the GEM program.
Since gemlang is implicitly typed, symbols representing variables are declared when they are first assigned.
In the :ref:`example <gemprog>` code, symbols `mu`, `beta`, `S`, `I`, and `epi` are pushed into the symbol table on
their first assignment (lines 1, 2, 4, 5, 8 respectively).
In GEM, symbols are represented by the :class:`Symbol <gem.gemlang.symbol.Symbol>` class hierarchy. Symbol tables are represented
by the `gem.gemlang.symbol.Scope` class hierarchy, which is essentially a wrapper around a Python `dict` object storing
*name: symbol* pairs. Symbols can also have scopes themselves, representing declarations such as that for `SIModel` in
the :ref:`example <gemprog>` code. The symbol hierarchy for the :ref:`example <gemprog>` is shown in :ref:`Figure 2
<symtab>`.
In GEM, symbols are represented by the :class:`Symbol <gem.gemlang.symbol.Symbol>` class hierarchy. Symbol tables are
represented by the :class:`Scope <gem.gemlang.symbol.Scope>` class hierarchy, which is essentially a wrapper around a
Python `dict` object storing *name: symbol* pairs. Symbols can also have scopes themselves, representing declarations
such as that for `SIModel` in the :ref:`example <gemprog>` code. The symbol hierarchy for the
:ref:`example <gemprog>` is shown in :ref:`Figure 2 <symtab>`.
**Notes**
......
......@@ -20,7 +20,7 @@ gem.gemlang.ast\_walker module
:show-inheritance:
gem.gemlang.model\_generator module
----------------------------------
-----------------------------------
.. automodule:: gem.gemlang.model_generator
:members:
......
......@@ -35,7 +35,7 @@ class CodeGenerator(ASTWalker):
"""Walks an AST, rewriting it as Outputter objects.
:param symtab: a fully populated symbol table
:returns: an ModelGenerator object
:returns: a CodeGenerator object
"""
# pylint: disable=invalid-name,missing-docstring
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment