1[comment {-*- tcl -*- doctools manpage}] 2[manpage_begin docidx_lang_syntax n 1.0] 3[copyright {2007-2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>}] 4[moddesc {Documentation tools}] 5[titledesc {docidx language syntax}] 6[category {Documentation tools}] 7[description] 8[para] 9 10This document contains the formal specification of the syntax of the 11docidx markup language, version 1 in Backus-Naur-Form. This document 12is intended to be a reference, complementing the 13[term {docidx language command reference}]. 14 15A beginner should read the much more informally written 16[term {docidx language introduction}] first before trying to 17understand either this document or the command reference. 18 19 20[section Fundamentals] 21 22In the broadest terms possible the [term {docidx markup language}] is 23like SGML and similar languages. A document written in this language 24consists primarily of markup commands, with text embedded into it at 25some places. 26 27[para] 28 29Each markup command is a just Tcl command surrounded by a matching 30pair of [const [lb]] and [const [rb]]. Which commands are available, 31and their arguments, i.e. syntax is specified in the 32[term {docidx language command reference}]. 33 34[para] 35 36In this document we specify first the lexeme, and then the syntax, 37i.e. how we can mix text and markup commands with each other. 38 39[section {Lexical definitions}] 40 41In the syntax rules listed in the next section 42 43[list_begin enumerated] 44[enum] 45<TEXT> stands for all text except markup commands. 46 47[enum] 48Any XXX stands for the markup command [lb]xxx[rb] including its 49arguments. Each markup command is a Tcl command surrounded by a 50matching pair of [const [lb]] and [const [rb]]. Inside of these 51delimiters the usual rules for a Tcl command apply with regard to word 52quotation, nested commands, continuation lines, etc. 53 54[enum] 55<WHITE> stands for all text consisting only of spaces, newlines, 56tabulators and the [cmd comment] markup command. 57[list_end] 58 59[section Syntax] 60 61The rules listed here specify only the syntax of docidx documents. The 62lexical level of the language was covered in the previous section. 63 64[para] 65 66Regarding the syntax of the (E)BNF itself 67 68[list_begin enumerated] 69[enum] 70The construct { X } stands for zero or more occurrences of X. 71[enum] 72The construct [lb] X [rb] stands for zero or one occurrence of X. 73[list_end] 74 75The syntax: 76 77[example { 78index = defs 79 INDEX_BEGIN 80 [ contents ] 81 INDEX_END 82 { <WHITE> } 83 84defs = { INCLUDE | VSET | <WHITE> } 85contents = keyword { keyword } 86 87keyword = defs KEY ref { ref } 88ref = MANPAGE | URL | defs 89}] 90 91At last a rule we were unable to capture in the EBNF syntax, as it is 92about the arguments of the markup commands, something which is not 93modeled here. 94 95[list_begin enumerated] 96[enum] 97 98The arguments of all markup commands have to be plain text, and/or text 99markup commands, i.e. one of 100 101[list_begin enumerated] 102[enum][cmd lb], 103[enum][cmd rb], or 104[enum][cmd vset] (1-argument form). 105[list_end] 106 107[list_end] 108 109 110[section {BUGS, IDEAS, FEEDBACK}] 111 112This document, will undoubtedly contain bugs and other problems. 113 114Please report such in the category [emph doctools] of the 115[uri {http://sourceforge.net/tracker/?group_id=12883} {Tcllib SF Trackers}]. 116 117Please also report any ideas for enhancements you may have. 118 119[see_also docidx_intro] 120[see_also docidx_lang_intro] 121[see_also docidx_lang_cmdref] 122[see_also docidx_lang_faq] 123[keywords markup {semantic markup}] 124[keywords {docidx markup} {docidx language}] 125[keywords {docidx syntax} {docidx commands}] 126[manpage_end] 127