Skip to content

Commit a7316de

Browse files
committed
Adding "engine" ebnf for plantuml
Add the plantuml "engine" EBNF (Extended Backus Naur Form) . The implementation in plantuml is a basic implementation and like written in the plantuml documentation: > EBNF allows for self description, so here it is! ``` @startebnf grammar = { rule }; rule = lhs , "=" (* definition *) , rhs , ";" (* termination *); lhs = identifier ; rhs = identifier | terminal | "[" , rhs (* optional *) , "]" | "{" , rhs (* repetition *), "}" | "(" , rhs (* grouping *) , ")" | "(*" , rhs (* comment *) , "*)" | "?" , rhs (* special sequence, aka notation *) , "?" | rhs , "|" (* alternation *) , rhs | rhs , "," (* concatenation *), rhs ; identifier = letter , { letter | digit | "_" } ; terminal = "'" , character , { character } , "'" | '"' , character , { character } , '"' ; character = letter | digit | symbol | "_" ; symbol = "[" | "]" | "{" | "}" | "(" | ")" | "<" | ">" | "'" | '"' | "=" | "|" | "." | "," | ";" ; digit = ? 0-9 ? ; letter = ? A-Z or a-z ? ; @endebnf ```
1 parent 949bd93 commit a7316de

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

addon/doxmlparser/doxmlparser/compound.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,7 @@ class DoxPlantumlEngine(str, Enum):
11191119
FLOW='flow'
11201120
BOARD='board'
11211121
GIT='git'
1122+
EBNF='ebnf'
11221123

11231124

11241125
class DoxProtectionKind(str, Enum):
@@ -23727,7 +23728,7 @@ def validate_DoxPlantumlEngine(self, value):
2372723728
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
2372823729
return False
2372923730
value = value
23730-
enumerations = ['uml', 'bpm', 'wire', 'dot', 'ditaa', 'salt', 'math', 'latex', 'gantt', 'mindmap', 'wbs', 'yaml', 'creole', 'json', 'flow', 'board', 'git']
23731+
enumerations = ['uml', 'bpm', 'wire', 'dot', 'ditaa', 'salt', 'math', 'latex', 'gantt', 'mindmap', 'wbs', 'yaml', 'creole', 'json', 'flow', 'board', 'git', 'ebnf']
2373123732
if value not in enumerations:
2373223733
lineno = self.gds_get_node_lineno_()
2373323734
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxPlantumlEngine' % {"value" : encode_str_2_3(value), "lineno": lineno} )

doc/commands.doc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3189,7 +3189,7 @@ class Receiver
31893189
Not all diagrams can be created with the PlantUML `@startuml` command but need another
31903190
PlantUML `@start...` command. This will look like `@start<engine>` where currently supported are
31913191
the following `<engine>`s: `uml`, `bpm`, `wire`, `dot`, `ditaa`, `salt`, `math`, `latex`,
3192-
`gantt`, `mindmap`, `wbs`, `yaml`, `creole`, `json`, `flow`, `board` and `git`.
3192+
`gantt`, `mindmap`, `wbs`, `yaml`, `creole`, `json`, `flow`, `board`, `git` and `ebnf`.
31933193
By default the `<engine>` is `uml`. The `<engine>` can be specified as an option.
31943194
Also the file to write the resulting image to can be specified by means of an option, see the
31953195
description of the first (optional) argument for details.

src/docnode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static const std::set<std::string> g_plantumlEngine {
5757
"uml", "bpm", "wire", "dot", "ditaa",
5858
"salt", "math", "latex", "gantt", "mindmap",
5959
"wbs", "yaml", "creole", "json", "flow",
60-
"board", "git"
60+
"board", "git", "ebnf"
6161
};
6262

6363
//---------------------------------------------------------------------------

templates/xml/compound.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,7 @@
10171017
<xsd:enumeration value="flow"/>
10181018
<xsd:enumeration value="board"/>
10191019
<xsd:enumeration value="git"/>
1020+
<xsd:enumeration value="ebnf"/>
10201021
</xsd:restriction>
10211022
</xsd:simpleType>
10221023

0 commit comments

Comments
 (0)