MXP – EBNF – Version 1.0
Updated: 8/6-2003
Author:
Varmel

This is a small
MXP reference. This is a EBNF so it is a bit different than an usual BNF. Things between [] means that they are optional, and things between {} can be repeated zero or more times. The syntax (A|B|C) means that one may be chosen, either A, B, or C. The strings in bold are the terminals, and the other strings are nonterminals. Some of the nonterminals I have not declared in this BNF as their name should show what they are. A few of the terminals have parts of them underlined. Like the VAR one looks like <VAR name....> which means that you can also use <V name...>.


How do I read the EBNF?
To read a BNF isn't very difficult, once you begin to get used to it =). A BNF is built up of something called productions. A production has a nonterminal on its left side, and nonterminals/terminals on its right side. Usually the terminals are written in bold characters, but the nonterminals aren't. A nonterminal on the right side of a production refers to a production that contains that nonterminal on its left side. I'll show an example:

a ::= c d
d ::= e | f


The above rules can generate strings that begin with a 'c' and ends with either a 'e' or a 'f'. The '|' symbol should be read as 'or'. The 'a' is the start symbol. That is where we begin to “read” the BNF. An EBNF works like this BNF but with the additional rules above.

To sum this up:
1. “a ::= c d” is a production with the nonterminal 'a' on its left side, and the terminal 'c' and nonterminal 'd' on its right side.
2. Nonterminals on the right side of a production can be substituted by one of the definitions of that nonterminal. (Like we replaced 'd' in 'a' with 'e' but could also have chosen to use 'f').

Please note that there probably are errors in this EBNF. Use it at your own risk :-)

EBNF

Some notes:
1. The MXP protocol is case-insensitive.
2. Tags like <tagname A=”arg1” B=”arg2”> can also be used as <tagname “arg1” “arg2”>. Not that in the latter the order of the arguments are important. In the one where we provide the attribute name the order is not important.

stream ::= {[character] [line_tag] [tag]}

line_tag::= <ESC> [ tagnum z
tagnum ::= open_line_mode
        
| secure_line_mode
        
| locked_line_mode
        
| reset_mode
        
| temp_secure_mode
        
| lock_open_mode
        
| lock_secure_mode
        
| lock_locked_mode

tag     ::= formatting <--- Open tags
          | command
          | line_spacing
          | links
          | version_control
          | optional_tags
          | custom_element
          | custom_entities

formatting::= <BOLD>stream</BOLD>
            
| <ITALIC>stream</ITALIC>
            
| <UNDERLINE>stream</UNDERLINE>
            
| <STRIKEOUT>stream</STRIKEOUT>
            
| <COLOR FORE=foreground [BACK=background]>stream</COLOR>
            
| <HIGH>stream</HIGH>
            
| <FONT FACE=name [SIZE=fontsize] [COLOR=foreground] [BACK=background]>stream</FONT>

command ::=<!ELEMENT element-name [definition] [ATT=attribute_list] [TAG=tag] [FLAG=flags]
           [OPEN] [DELETE] [EMPTY]>
         
| <!ATTLIST element-name attribute_list>
         
| <!ENTITY name value [DESC=description] [PRIVATE] [PUBLISH] [DELETE] [ADD] [REMOVE]>
         | <VAR name [DESC=description] [PRIVATE] [PUBLISH] [DELETE] [ADD] [REMOVE]>value</VAR>
         
| <!-- text -->
attribute_list ::= 'name[=default_value] {name[=default_value]}'


line_spacing   ::= <NOBR> | <P> | <BR> | <SBR> | &nbsp;

links          ::= <a href=url [hint=hinttext] [expire=name]>stream</a>
                 
| <send [href=command][hint=hinttext][prompt][expire=name]>linktext</send>
                 
| <expire [name]>

version_control ::= <VERSION>
                  
| <SUPPORT>

optional_tags  ::= <H1>stream</H1>
                 
| <H2>stream</H2>
                 
| <H3>stream</H3>
                 
| <H4>stream</H4>
                 
| <H5>stream</H5>
                 
| <H6>stream</H6>
                 
| <HR> <--- Not implemented in zMUD?
                 | <SMALL>stream</SMALL>
                 
| <TT>stream</TT> <--- open tag
                 | <GAUGE entity_name [max=entity_name] [caption=caption] [color=color]>
                 
| <STAT entity_name [max=entity_name] [caption=caption]>
                 
| <FRAME name=frame_name [action=(open|close|redirect)] [title=title]
                   [internal [align=(left|right|bottom|top)]] [left=leftdata] [top=topdata] [width=widthdata]
                   [height=heightdata] scrolling=(yes|no) [floating]>
                 | <DEST frame_name [x=column] [y=line] [(eol|eof)]>text</DEST>
                 
| <RELOCATE hostname=host_name port=port_number>
                 | <USER>
                 
| <PASSWORD>
                 
| <IMAGE fname=filename url=url t=image_class [h=height] [w=width] [hspace=space]
                   [vspace=space] [align=(left|right|top|middle|bottom)] [ismap]>
                 | msp

msp            ::= <SOUND (filename|off) V=volume L=repeats P=priority T=type U=url>
                 
| <MUSIC (filename|off) V=volume L=repeats C=continue T=type U=url>

custom_element ::= <element_name {ATT=attribute}> stream </element_name>
custom_entities::=&name; <--- case sensitive

caption  ::= “real_text
title    ::= “real_text
caption  ::= “real_text
hinttext ::= “real_text



Regular expressions
character  
::= [a-z0-9]    (and all other characters supported by the mud/client)
color      ::= #[A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9] | colorname1
background ::= color
foreground ::= color

size       ::= [0-9]+
name       ::=
[a-z0-9]*

leftdata
   ::= -?[0-9]+% | -?[0-9]+c | -?[0-9]+
topdata
    ::= leftdata
widthdata
  ::= leftdata
heightdata 
::= leftdata



1The list of colornames can be found in the zMUD helpfile called colorname.

There have been 1748 visits to this page.