1 / 5

ASF+SDF

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

alessa
Download Presentation

ASF+SDF

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

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

More Related