ebnf:index
Inhaltsverzeichnis
EBNF Parser & Syntax Diagram Renderer
The EBNF Parser & Syntax Diagram Renderer can be used stand-alone or as Dokuwiki-Plugin.
Download and Install
- Requirements: Make sure to have the 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>
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: EBNF Examples
Todo & Ideas
- Ellipse … for enumerations. E.g.
digits:- temp hack in v0.2:
function render_node($node, $lefttoright)... 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); } ...
- 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
? … ? - replace antialias function
ebnf/index.txt · Zuletzt geändert: von Vincent Tscherter
