fbpx
Wikipedia

Syntax Definition Formalism

The Syntax Definition Formalism (SDF) 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 SDF3.[1] 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.

Overview edit

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 edit

The following example defines a simple Boolean expression syntax in SDF2:

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 edit

  • ASF+SDF Meta Environment provides SDF
  • RascalMPL
  • Spoofax/IMP [1]
  • Stratego/XT
  • Strafunski

See also edit

References edit

  1. ^ sleconf.org

Further reading edit

  • A Quick Introduction to SDF, Visser, J. & Scheerder, J. (2000) CWI
  • The Syntax Definition Formalism SDF, Mark van den Brand, Paul Klint, Jurgen Vinju (2007) CWI

External links edit

  • Grammar Deployment Kit
  • SdfMetz computes metrics for SDF grammars
  • Download SDF from the ASF+SDF Meta Environment homepage


syntax, definition, formalism, metasyntax, used, define, context, free, grammars, that, formal, describe, formal, languages, express, entire, range, context, free, grammars, current, version, sdf3, parser, parser, generator, specifications, provided, part, fre. The Syntax Definition Formalism SDF 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 SDF3 1 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 1 Overview 2 Examples 3 Program analysis and transformation systems using SDF 4 See also 5 References 6 Further reading 7 External linksOverview editFeatures of SDF Supports the entire range of context free languages Allows modular syntax definitions grammars can import subgrammars which enables reuse Supports annotationsExamples editThe following example defines a simple Boolean expression syntax in SDF2 module basic Booleans exports sorts Boolean context free start symbols Boolean context free syntax true gt Boolean false gt Boolean lhs Boolean rhs Boolean gt Boolean left lhs Boolean amp rhs Boolean gt Boolean left not Boolean gt Boolean Boolean gt Boolean context free priorities Boolean amp Boolean gt Boolean gt Boolean Boolean gt BooleanProgram analysis and transformation systems using SDF editASF SDF Meta Environment provides SDF RascalMPL Spoofax IMP 1 Stratego XT StrafunskiSee also editGNU bison ANTLRReferences edit sleconf orgFurther reading editA Quick Introduction to SDF Visser J amp Scheerder J 2000 CWI The Syntax Definition Formalism SDF Mark van den Brand Paul Klint Jurgen Vinju 2007 CWIExternal links editGrammar Deployment Kit SdfMetz computes metrics for SDF grammars Download SDF from the ASF SDF Meta Environment homepage nbsp This computer science article is a stub You can help Wikipedia by expanding it vte Retrieved from https en wikipedia org w index php title Syntax Definition Formalism amp oldid 955733351, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.