VDM-SL to C++ - CSKSYSTEMSCORPORATION VDMTools The VDM-SL...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CSKSYSTEMSCORPORATION VDMTools The VDM-SL to C++ Code Generator ver.1.0 How to contact CSK SYSTEMS CORPORATION: http://www.csk.com/systems Web @ VDM.SP@csk.com General information The VDM-SL to C++ Code Generator 1.0 Revised for VDMTools v8.2 c COPYRIGHT 2009 by CSK SYSTEMS CORPORATION The software described in this document is furnished under a license agreement. The software may be used or copied only under the terms of the license agreement. This document is subject to change without notice The VDM-SL to C++ Code Generator Contents 1 Introduction 1 2 Invoking the Code Generator 1 2.1 Requirements for Generating Code . . . . . . . . . . . . . . . . . 2 2.2 Using the Graphical Interface . . . . . . . . . . . . . . . . . . . . 2 2.3 Using the Command Line Interface . . . . . . . . . . . . . . . . . 5 2.4 Generated C++ Files . . . . . . . . . . . . . . . . . . . . . . . . . 6 3 Interfacing the Generated Code 7 3.1 Code Generating VDM-SL Types - The Basics . . . . . . . . . . . 7 3.2 Files to be Implemented by the User . . . . . . . . . . . . . . . . 10 3.2.1 Definition of Offsets for Record Tags . . . . . . . . . . . . 12 3.2.2 Implementing Implicit Functions/Operations and Specifi- cation Statements . . . . . . . . . . . . . . . . . . . . . . . 12 3.2.3 Implementing the Main Program . . . . . . . . . . . . . . 13 3.2.4 Substituting Parts of the Generated C++ code . . . . . . 16 3.3 Compiling, Linking and Running the C++ code . . . . . . . . . . 17 4 Unsupported Constructs 19 5 Code Generating VDM Specifications - The Details 21 5.1 Code Generating Types . . . . . . . . . . . . . . . . . . . . . . . 21 5.1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 5.1.2 Mapping VDM-SL Types to C++ . . . . . . . . . . . . . . 24 5.1.3 Code Generating VDM-SL Type Names . . . . . . . . . . 28 5.1.4 Invariants . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 5.2 Code Generating Function and Operation Definitions . . . . . . . 31 5.3 Code Generating Value and State Definitions . . . . . . . . . . . . 32 5.4 Code Generating Value Definitions . . . . . . . . . . . . . . . . . 33 5.5 Code Generating Expressions and Statements . . . . . . . . . . . 35 5.6 Name Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.7 Standard Library . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 A The libCG.a Library 37 A.1 cg.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 A.2 cg aux.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 B Handcoded C++ Files 39 B.1 DefaultMod userdef.h . . . . . . . . . . . . . . . . . . . . . . . . . 39 B.2 DefaultMod userimpl.cc . . . . . . . . . . . . . . . . . . . . . . . 39 i The VDM-SL to C++ Code Generator B.3 sort ex.cc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 C Makefiles 43 C.1 Makefile for Unix Platform . . . . . . . . . . . . . . . . . . . . . . 43 C.2 Makefile for Windows Platform . . . . . . . . . . . . . . . . . . . 45 ii The VDM-SL to C++ Code Generator...
View Full Document

This note was uploaded on 03/31/2010 for the course CAS 707 taught by Professor Ridhakhedri during the Spring '10 term at McMaster University.

Page1 / 51

VDM-SL to C++ - CSKSYSTEMSCORPORATION VDMTools The VDM-SL...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online