diff options
author | Karel Kočí <cynerd@email.cz> | 2016-10-26 12:12:57 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2016-10-26 12:12:57 +0200 |
commit | d9494c07ad3a89a2435b0a6306dc634cf5a346e5 (patch) | |
tree | 581d51059f6dfe4f2a55888c6c74b229920852d0 | |
parent | bbfae8426156de76783ca73f3a11e0e4bcb24650 (diff) | |
download | geml-d9494c07ad3a89a2435b0a6306dc634cf5a346e5.tar.gz geml-d9494c07ad3a89a2435b0a6306dc634cf5a346e5.tar.bz2 geml-d9494c07ad3a89a2435b0a6306dc634cf5a346e5.zip |
Add parser states graph
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 9 | ||||
-rw-r--r-- | docs/evaluation.md | 1 | ||||
-rw-r--r-- | docs/parser-states.dot | 35 |
4 files changed, 44 insertions, 2 deletions
@@ -10,3 +10,4 @@ geml *.y.c *.y.h *.gperf.h +*.dot.png @@ -87,18 +87,23 @@ distclean:: clean @echo " CLEAN configuration" $(Q)$(RM) $(O)/.config +docs/%.dot.png: docs/%.dot + @echo " DOT $@" + $(Q)dot -Tpng -O $< + .PHONY: docs -docs: +docs: docs/parser-states.dot.png @echo " DOC $@" $(Q)mkdocs build .PHONY: serve-docs -serve-docs: +serve-docs: docs/parser-states.dot.png $(Q)mkdocs serve .PHONY: clean-docs clean-docs: @echo " CLEAN docs" + $(Q)$(RM) docs/parser-states.dot.png $(Q)$(RM) -r site ifeq (,$(filter clean distclean help docs serve-docs clean-docs \ diff --git a/docs/evaluation.md b/docs/evaluation.md index 04d8854..055e4ec 100644 --- a/docs/evaluation.md +++ b/docs/evaluation.md @@ -1,2 +1,3 @@ Evaluation process ================== +[Parser states](parser-states.dot.png) diff --git a/docs/parser-states.dot b/docs/parser-states.dot new file mode 100644 index 0000000..16d714f --- /dev/null +++ b/docs/parser-states.dot @@ -0,0 +1,35 @@ +digraph ParserStates { +label="Parser states"; + +init [label="Init"]; +disabled [label="Parser disabled"]; +error [label="Error"]; + +init -> disabled [label="If _EVAEN is not empty"]; +init -> Parser [label="If _EVAEN is empty"]; +Parser -> disabled [label="_EVADI located"]; +disabled -> Parser [label="_EVAEN located"]; + +Parser { +nomacro [label="No macro"]; +macro_start [label="Macro/command start"]; +macro [label="Macro/command located"]; +args [label="Arguments"]; +expansion [label="Macro/command expansion (Secondary parser)"]; + +Parser -> nomacro [style="dotted"]; +expansion -> Parser [style="dotted"]; +nomacro -> macro_start [label="_INIT located"]; +macro_start -> macro [label="_MACR matches text after _INIT"]; +macro_start -> error [label="else"]; +macro -> args [label="_ARGST matches after _MACR"]; +args -> args [label="_ARGSE localted"]; +args -> macro_start [label="_INIT located"]; +args -> expansion [label="_ARGEN located"]; +macro -> expansion [label="else"]; +expansion -> args [label="If some macro arguments are still opened"]; +expansion -> nomacro [label="If last opened macro argument was closed"]; + +} + +} |