Download
slide1 n.
Skip this Video
Loading SlideShow in 5 Seconds..
ASF+SDF PowerPoint Presentation

ASF+SDF

182 Vues Download Presentation
Télécharger la présentation

ASF+SDF

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. ASF+SDF • ASF+SDF • Goal: defining syntax and semantics of languages • SDF: Syntax Definition Formalism • goal to define: • lexical syntax: keywords, comments, constants, identifiers • context-free syntax: declarations, statements • modular and declarative • ASF: Algebraic Specification Formalism • goal to define: • static semantics: scope and type of variables • dynamic semantics: evaluation • syntax-directed transformations • modular and uses concrete syntax • traversal functions

  2. ASF+SDF Anatomy of an ASF+SDF module Name of this module; may be followed by parameters Names of modules imported by this module module ModuleName ImportSection* ExportOrHiddenSection* equations ConditionalEquation* Grammar elements that are visible from the outside (exports) or only inside the module (hiddens) imports, aliases, sorts, lexical syntax, context-free syntax, priorities, variables Unconditional: [tagId] L = R Conditional: [tagId] C1, C2, …, Cn ========== L = R

  3. Traversal functions in ASF+SDF • Many functions have the characteristic that they traverse the tree recursively and only do something interesting at a few nodes • Example: count the identifiers in a program • Using a recursive (inductive) definition: • # of equations is equal to number of syntax rules • think about Cobol or Java with hundreds of rules • Traversal functions automate recursion

  4. ASF+SDF Meta-Environment • IDE for ASF+SDF • syntax-directed editing of specifications • integrated access to the libraries • integrated compilation and testing/debugging of specifications • Open, robust and extendable architecture, based on third-party software and reusable components • Efficient and scalable technology