VDM to C - VDMTools The VDM to C Code Generator ver.1.0 How to contact CSK SYSTEMS CORPORATION http/www.csk.com/systems Web [email protected] General

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++ to C++ Code Generator ver.1.0 How to contact CSK SYSTEMS CORPORATION: http://www.csk.com/systems Web @ [email protected] General information The VDM++ 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++ 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++ Types - The Basics . . . . . . . . . . . 7 3.2 Files to be Implemented by the User . . . . . . . . . . . . . . . . 11 3.2.1 Definition of Offsets for Record Tags . . . . . . . . . . . . 12 3.2.2 Implementing Implicit Functions/Operations and Specifi- cation Statements . . . . . . . . . . . . . . . . . . . . . . . 13 3.2.3 Implementing the Main Program . . . . . . . . . . . . . . 14 3.2.4 Substituting Parts of the Generated C++ code . . . . . . 17 3.3 Compiling, Linking and Running the C++ code . . . . . . . . . . 18 4 Unsupported Constructs 20 5 Code Generating VDM Specifications - The Details 21 5.1 Code Generating Classes . . . . . . . . . . . . . . . . . . . . . . . 22 5.1.1 Object References in the VDM C++ Library . . . . . . . . 22 5.1.2 The Inheritance Structure of the Generated Code of Classes 23 5.1.3 The Structure of a Generated Class . . . . . . . . . . . . . 27 5.2 Code Generating Types . . . . . . . . . . . . . . . . . . . . . . . 28 5.2.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 5.2.2 Mapping VDM++ Types to C++ . . . . . . . . . . . . . . 30 5.2.3 Code Generating VDM++ Type Names . . . . . . . . . . 36 5.2.4 Invariants . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 5.3 Code Generating Function and Operation Definitions . . . . . . . 39 5.4 Code Generating Instance Variables . . . . . . . . . . . . . . . . . 42 5.5 Code Generating Value Definitions . . . . . . . . . . . . . . . . . 44 5.6 Code Generating Expressions and Statements . . . . . . . . . . . 45 5.7 Name Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . 46 5.8 Standard Library . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 A The libCG.a Library 47 A.1 cg.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 A.2 cg aux.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 i The VDM++ to C++ Code Generator B Handcoded C++ Files 50 B.1 DoSort userdef.h . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 B.2 ExplSort userdef.h . . . . . . . . . . . . . . . . . . . . . . . . . .....
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 / 64

VDM to C - VDMTools The VDM to C Code Generator ver.1.0 How to contact CSK SYSTEMS CORPORATION http/www.csk.com/systems Web [email protected] General

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