Benutzer-Werkzeuge

Webseiten-Werkzeuge


ebnf:index

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
ebnf:index [2009/01/19 02:42] – Page moved and renamed from ebnf to ebnf:index Vincent Tscherterebnf:index [2025/09/06 10:14] (aktuell) Vincent Tscherter
Zeile 1: Zeile 1:
 +====== EBNF Parser & Syntax Diagram Renderer ======
 +The //EBNF Parser & Syntax Diagram Renderer// can be used stand-alone or as Dokuwiki-Plugin.
 +
 +===== Download and Install=====
 +  * https://www.dokuwiki.org/plugin:ebnf
 +  * Requirements: Make sure to have the [[http://www.php.net/manual/en/image.requirements.php|GD library]] ready :!:
 +===== How to use =====
 +
 +  <ebnf> "EBNF defined in itself" {
 +  syntax     = [ title ] "{" { production } "}" [ comment ].
 +  production = identifier "=" expression ( "." | ";" ) .
 +  expression = term { "|" term } .
 +  term       = factor { factor } .
 +  factor     = identifier
 +             | literal
 +             | "[" expression "]"
 +             | "(" expression ")"
 +             | "{" expression "}" .
 +  identifier = character { character } .
 +  title      = literal .
 +  comment    = literal .
 +  literal    = "'" character { character } "'"
 +             | '"' character { character } '"' .
 +  }</ebnf>
 +
 +
 +<ebnf> "EBNF defined in itself" {
 +  syntax     = [ title ] "{" { production } "}" [ comment ].
 +  production = identifier "=" expression ( "." | ";" ) .
 +  expression = term { "|" term } .
 +  term       = factor { factor } .
 +  factor     = identifier
 +             | literal
 +             | "[" expression "]"
 +             | "(" expression ")"
 +             | "{" expression "}" .
 +  identifier = character { character } .
 +  title      = literal .
 +  comment    = literal .
 +  literal    = "'" character { character } "'"
 +             | '"' character { character } '"' .
 +} </ebnf>
 +
 +The script is also available as stand-alone version under: ''your_dokuwiki/lib/plugins/ebnf/ebnf.php''
 +  .../ebnf.php?syntax="EBNF"{ hello = "Hello World". }"Some additional Comments"
 +Note: The stand-alone script supports also XML output
 +  .../ebnf.php?syntax={ hello = "EBNF Hello World in XML". }&format=xml
 +
 +===== Syntax =====
 +  * See examples: [[examples]]
 +  * [[wp>EBNF]]
 +  * [[wp>Wirth_syntax_notation]]
 +
 +===== Todo & Ideas =====
 +  * Ellipse ... for enumerations. E.g. ''digits'': 
 +    * temp hack in v0.2: ''function render_node($node, $lefttoright)''<code php> ...
 +    else {
 +      if ($text!="...")
 +       rr($im, UNIT, 0, $w-UNIT-1, $h-1, UNIT/2, $black);
 +      imagestring($im, FONT, 2*UNIT, ($h-imagefontheight(FONT))/2, 
 +        $text, $text!="..."?$blue:$black);
 +    } ...</code>
 +  * Other fonts
 +  * Configurable dimensions
 +  * escape-chars and or unicode in terminals
 +  * Adding //Regexp// beside terminal and identifiers
 +  * using a lightweight syntaxtree instead DOM
 +  * using some standard parsing mechanism
 +  * support for comments & special-sequences ''? ... ?''
 +  * http://www.cs.man.ac.uk/~pjj/bnf/ebnf.html
 +  * replace antialias function
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki