1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-us">
5 <meta http-equiv="Content-Language" content="en-us" />
6 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
7 <meta http-equiv="Content-Style-Type" content="text/css" />
8 <meta name="author" content="Ferruccio Guidi" />
9 <meta name="description" content="\lambda\delta home page: Open Symbolic Notation" />
10 <title>\lambda\delta home page: Open Symbolic Notation</title>
11 <link rel="stylesheet" type="text/css" href="http://lambdadelta.info/css/ld_web.css" />
12 <link rel="stylesheet" type="text/css" href="http://lambdadelta.info/css/lddl.css" />
13 <link rel="stylesheet" type="text/css" href="http://lambdadelta.info/css/xhtbl.css" />
14 <link rel="shortcut icon" href="http://lambdadelta.info/images/crux_16.ico" />
18 <a href="http://lambdadelta.info/osn/">
19 <img class="w3c" alt="[Open Symbolic Notation logo]" title="OSN: Open Symbolic Notation" src="http://lambdadelta.info/images/osn_label.png" />
22 <div class="head1">Open Symbolic Notation</div>
24 <img class="rule" alt="[Spacer]" title="\lambda\delta rainbow rule" src="http://lambdadelta.info/images/rainbow.png" />
26 <div xmlns:ld="http://lambdadelta.info/" class="text">
27 Open Symbolic Notation, abbreviated OSN,
28 is an easy and flexible data-interchange text format
29 intended for the lightweight representation of
30 generic abstract syntax trees in the domain of formal languages.
31 In order to meet these design goals, OSN pursues the following features.
33 <ul xmlns:ld="http://lambdadelta.info/">
36 <a href="https://en.wikipedia.org/wiki/S-expression">Symbolic expressions</a>
37 based on widely accepted syntactical conventions
38 provide for a <span class="emph ">lightweight</span> and <span class="emph ">generic</span> grammar,
39 which is both <span class="emph ">easy for machines to process</span>,
40 and <span class="emph ">easy for humans to understand</span>.
41 As a mean to support <span class="emph ">efficient</span> information processing,
42 OSN aims at an economic representation of data
43 contrary to <a href="http://www.w3.org/TR/2008/REC-xml-20081126/#sec-origin-goals">XML design goal 10</a>.
44 Compared to other data-interchange formats based on symbolic expressions,
45 like <a href="http://people.csail.mit.edu/rivest/Sexp.txt">canonical symbolic expressions</a>,
46 representing arbitrary data in binary format is a secondary concern in the design of OSN,
47 as well as the support for canonicalization.
48 Apparently, these features fall outside the scope of OSN,
49 which targets the data structures of <span class="emph ">formal languages</span>.
53 <ul xmlns:ld="http://lambdadelta.info/">
54 <li class="blue-mark">
56 Optionally <a href="https://en.wikipedia.org/wiki/Namespace">qualified</a> symbolic expressions
57 allow OSN texts to mix data from different domains preserving their own semantics
58 because name conflicts can be avoided.
59 As a consequence OSN documents are <span class="emph ">easy to extend</span> in that
60 domain-specific OSN applications can work as expected even if
61 data from different domains is added to the text they process.
65 <ul xmlns:ld="http://lambdadelta.info/">
66 <li class="green-mark">
68 The <a href="https://en.wikipedia.org/wiki/ASCII">US-ASCII</a> character set,
69 extended to <a href="http://www.utf-8.com/">UTF-8</a> in
70 free-form text strings for the convenience of human readers,
71 makes OSN documents <span class="emph ">easy to visualize and transport</span> over communication media.
72 OSN design aims at supporting <span class="emph ">application-independent</span> standard encodings.
76 <div xmlns:ld="http://lambdadelta.info/" class="head2dx" id="grammar">Grammar <img class="icon37" alt="[butterfly]" title="\lambda\delta butterfly" src="http://lambdadelta.info/images/b6.png" />
78 <div xmlns:ld="http://lambdadelta.info/" class="text">
79 An OSN text uses the <a href="http://www.utf-8.com/">UTF-8</a> character set
80 and contains the next seven tokens that we define in a very common EBNF variant.
81 Characters not starting a token are not allowed.
82 The ones in the range U+0021 ... U+007E are ! # $ % & * / ? @ \ ^ | ~
83 and are available for extensions of OSN.
85 <ul xmlns:ld="http://lambdadelta.info/">
87 This token can represent the identifiers and the numerical constants of most programming languages:
89 <span class="emph ebnf">symbol = 1 * symbol-char ; <br />symbol-char = '+' | '-' | '.' | '0' | ... | '9' | 'A' | ... | 'Z' | '_' | '`' | 'a' | ... | 'z' ; </span>
92 <ul xmlns:ld="http://lambdadelta.info/">
94 This token contains free-form text with commonly accepted escape sequences:
96 <span class="emph ebnf">string = '"' , * ( string-char | "'" | '\' escape ) , '"' ; <br />string-char = ( #0 | ... | #10FFFF ) - ( #0 | ... | #1F | "'" | '\' | '"' | #7F ) ; <br />escape = 1 * space | '"' | "'" | '(' | ')' | '0' | '\' | 'a' | 'b' | 'e' | 'f' | 'n' | 'r' | 't' | ( 'u' , 4 * 4 hex ) | 'v' | ( 'x' , 2 * 2 hex ) ; <br />space = #9 | ... | #D | #20 ; <br />hex = '0' | ... | '9' | 'A' | ... | 'F' | 'a' | ... | 'f' ; </span>
99 <ul xmlns:ld="http://lambdadelta.info/">
101 This token is a widely used alternative of the former token:
103 <span class="emph ebnf">string-alt = "'" , * ( string-char | '"' | '\' escape ) , "'" ; </span>
106 <ul xmlns:ld="http://lambdadelta.info/">
108 This token separates the qualifiers of a symbolic expression:
110 <span class="emph ebnf">sep = ':' ; </span>
113 <ul xmlns:ld="http://lambdadelta.info/">
115 This token starts a compound symbolic expression:
117 <span class="emph ebnf">open = '(' | '<' | '[' | '{' ; </span>
120 <ul xmlns:ld="http://lambdadelta.info/">
122 This token ends a compound symbolic expression:
124 <span class="emph ebnf">close = ')' | '>' | ']' | '}' ; </span>
127 <ul xmlns:ld="http://lambdadelta.info/">
129 This token is ignored and separates the other tokens:
131 <span class="emph ebnf">gap = space | ',' | ';' | '=' ; </span>
134 <div xmlns:ld="http://lambdadelta.info/" class="text">
135 The grammar of OSN is very liberal by design.
136 Spaces of the form <span class="emph ebnf">1 * gap </span> can appear between any pair of tokens.
138 <ul xmlns:ld="http://lambdadelta.info/">
142 <span class="emph ebnf">text = * q-expr ; </span>
145 <ul xmlns:ld="http://lambdadelta.info/">
147 A qualified symbolic expression:
149 <span class="emph ebnf">q-expr = * ( symbol , 1 * sep ) , expr ; </span>
152 <ul xmlns:ld="http://lambdadelta.info/">
154 An unqualified symbolic expression:
156 <span class="emph ebnf">expr = symbol | string | string-alt | ( open , text , close ) ; </span>
159 <div xmlns:ld="http://lambdadelta.info/" class="head2dx" id="semantics">Semantics <img class="icon37" alt="[butterfly]" title="\lambda\delta butterfly" src="http://lambdadelta.info/images/b1.png" />
161 <div xmlns:ld="http://lambdadelta.info/" class="text">
165 morover, the escape sequences \x <two hexadecimal digits> and \u <four hexadecimal digits>
166 allow to specify a character by its code point <newline/>
167 finally the escape sequences \( for U+0002 and \) for U+0003 are available
169 <div xmlns:ld="http://lambdadelta.info/" class="head2dx" id="implementation">Implementation <img class="icon37" alt="[butterfly]" title="\lambda\delta butterfly" src="http://lambdadelta.info/images/b5.png" />
171 <div xmlns:ld="http://lambdadelta.info/" class="text">
175 <img class="rule" alt="[Spacer]" title="\lambda\delta rainbow rule" src="http://lambdadelta.info/images/rainbow.png" />
177 <div xmlns:ld="http://lambdadelta.info/" class="spacer">
180 <div xmlns:ld="http://lambdadelta.info/" class="spacer">
181 <a href="http://validator.w3.org/check?uri=referer">
182 <img class="w3c" alt="[Valid XHTML 1.1]" title="Valid XHTML 1.1" src="http://www.w3.org/Icons/valid-xhtml11-blue" />
184 <a href="http://jigsaw.w3.org/css-validator/check/referer">
185 <img class="w3c" alt="[Valid CSS level 2]" title="Valid CSS level 2" src="http://www.w3.org/Icons/valid-css2-blue" />
187 <a href="http://www.w3.org/XML/">
188 <img class="w3c" alt="[Generated from XML via XSL]" title="Generated from XML via XSL" src="http://lambdadelta.info/images/xml_xsl2.png" />
190 <a href="http://www.w3.org/Graphics/PNG/">
191 <img class="w3c" alt="[PNG used here]" title="PNG used here" src="http://lambdadelta.info/images/PNGnow2.png" />
193 <a href="http://www.anybrowser.org/campaign/">
194 <img class="w3c" alt="[Viewable with any browser]" title="Viewable with any browser" src="http://www.anybrowser.org/campaign/bvgraphics/abtfile.png" />
197 <div xmlns:ld="http://lambdadelta.info/" class="spacer">
200 <div xmlns:ld="http://lambdadelta.info/" class="spacer">Last update: Wed, 05 Apr 2017 18:05:16 +0200</div>