Syntax Definition Formalism

Syntax Definition Formalism

The Syntax Definition Formalism (SDF for short) is a metasyntax used to define context-free grammars: that is, a formal way to describe formal languages. It can express the entire range of context-free grammars. Its current version is SDF2. A parser and parser generator for SDF specifications are provided as part of the free ASF+SDF Meta Environment. These operate using the SGLR (Scannerless GLR parser). An SDF parser outputs parse trees or, in the case of ambiguities, parse forests.

Contents

Overview

Features of SDF:

  • Supports the entire range of context-free languages
  • Allows modular syntax definitions (grammars can import subgrammars) which enables reuse
  • Supports annotations

Examples

The following example defines a simple Boolean expression syntax:

module basic/Booleans

exports
  sorts Boolean
  context-free start-symbols Boolean

context-free syntax
   "true"                      -> Boolean
   "false"                     -> Boolean
   lhs:Boolean "|" rhs:Boolean -> Boolean {left}         
   lhs:Boolean "&" rhs:Boolean -> Boolean {left}       
   "not" "(" Boolean ")"       -> Boolean           
   "(" Boolean ")"             -> Boolean

 context-free priorities
   Boolean "&" Boolean -> Boolean >
   Boolean "|" Boolean -> Boolean

Program analysis and transformation systems using SDF

See also

Further reading

External links


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Definition — For other uses, see Definition (disambiguation). A definition is a passage that explains the meaning of a term (a word, phrase or other set of symbols), or a type of thing. The term to be defined is the definiendum. A term may have many different …   Wikipedia

  • JavaScript syntax — This article is part of the JavaScript series. JavaScript JavaScript syntax JavaScript topics This box: view · …   Wikipedia

  • Antlr — Saltar a navegación, búsqueda ANTLR Apareció en: 1988 Desarrollador: Terence Parr y Colaboradores Última versión: 3.2 (23 09 2009) Influido por: PCCTS Sistema operativo: Linux …   Wikipedia Español

  • ANTLR — Desarrollador(es) Terence Parr y Colaboradores http://www.antlr.org Información general Apareció en 1988 Última versión estab …   Wikipedia Español

  • Stratego/XT — Infobox Software name = Stratego/XT caption = developer = latest release version = latest release date = latest preview version = latest preview date = operating system = Cross platform platform = genre = program transformation system license =… …   Wikipedia

  • ASF+SDF Meta Environment — Infobox Software name = ASF+SDF Meta Environment caption = developer = SEN1 [http://www.cwi.nl/htbin/sen1/twiki/bin/view/SEN1/] group at the CWI [http://www.cwi.nl] latest release version = 2.0.1 latest release date = 08 September 2008 latest… …   Wikipedia

  • ANTLR — Infobox Software name = ANTLR caption = author = Terence Parr and others developer = released = February 1992 latest release version = 3.1 latest release date = release date|2008|08|12 programming language = Java operating system = platform =… …   Wikipedia

  • SDF — may refer to: * Scouts de France * Seattle Debate Foundation, a non profit urban debate league in Seattle, Washington * Seoul Digital Forum, a major international conference held annually in Seoul, Korea, addressing innovation in the digital… …   Wikipedia

  • Lojban — la lojban. Pronunciation [la ˈloʒban] …   Wikipedia

  • HEBREW LITERATURE, MODERN — definition and scope beginnings periodization …   Encyclopedia of Judaism

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”