Commit 072747ff authored by Chris Jewell's avatar Chris Jewell
Browse files

Swapped doc diagrams to graphviz.

parent c7a5b805
Pipeline #281 passed with stage
in 5 minutes and 3 seconds
......@@ -38,7 +38,7 @@ master_doc = 'index'
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.inheritance_diagram',
'sphinx_rtd_theme',
'sphinxcontrib.mermaid'
'sphinx.ext.graphviz'
]
# Add any paths that contain templates here, relative to this directory.
......@@ -64,3 +64,5 @@ pygments_style = 'sphinx'
html_static_path = []
nitpicky = True
graphviz_output_format = 'png'
......@@ -10,21 +10,41 @@ GEM parsing framework closely follows the source-to-source translation ideas out
in outlined in :ref:`Figure 1 <parsechain>`.
.. _parsechain:
.. mermaid::
.. graphviz::
:alt: GEM parse chain diagram
:align: center
:caption: Figure 1: The GEM parse chain showing the main stages of the source-to-source translation pipeline.
graph LR;
gemlang --> lex(Lexical<br />analysis);
lex --parse tree--> syntax(Syntactic<br />analysis);
syntax --AST--> semantic(Semantic<br />analysis);
semantic --AST--> code(Code<br />generator);
symboltable[Symbol<br />Table] --> semantic
symboltable --> code
code --> Python
Lark --> lex
Lark --> syntax
digraph parsechain {
rankdir = TD;
bgcolor = "#00000000";
node [fontcolor="gray20", color="gray20"];
{ node [shape=plaintext];
gemlang;
python [label="Python"];
}
{ node [shape=box,style="filled", fillcolor="#ececff", color="#e0e0fd"];
rank = same;
lex [label=<Lexical<br/>analysis>];
syntax [label=<Syntactic<br/>analysis>];
semantic [label=<Semantic<br/>analysis>];
code [label=<Code<br/>generator>];
}
{ node [shape=box];
rank = same;
symboltable [label=<Symbol<br/>table>];
lark [label="Lark"];
}
gemlang -> lex;
lex -> syntax [label="Parse tree", fontsize=12];
syntax -> semantic [label="AST", fontsize=12];
semantic -> code [label="AST", fontsize=12];
code -> python;
lark -> {lex,syntax};
symboltable -> {semantic, code};
}
Lexical and Syntactic Analysis
......
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