PLUG code generation tool

Post on 12-Jan-2015

1.066 views 4 download

Tags:

description

IDL template based code generation tool

Transcript of PLUG code generation tool

PLUG PLUG Presentation Layer Universal GeneratorPresentation Layer Universal Generator

P&D/SSD/TCE/TFP/AST- 28/09/98P&D/SSD/TCE/TFP/AST- 28/09/98

A joint company of Thomson-CSF Airsys and Siemens

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/232

OVERVIEW

ATC requirements : Plug & Play (flexibility) Object Oriented Design to automatic code generation Compiler & Parser PLUG (Presentation Layer Universal Generator) through

applications : Stub generation : PATIO API Coder generation : Object Message Passing

Future

* PATIO : Platform for ATM Tools Integration to Pre-operation

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/233

ATC processus

AdjacentAir Traffic ControlCenter

AdjacentAir Traffic ControlCenter

AirportsAirports Flight Data Processing

Flight Data Processing

METEO DataMETEO DataRadar Data Processing

Radar Data Processing

transmetterReceiverHF/VHF

transmetterReceiverHF/VHF

Flight PlanFlight Plan

Radar Data

Radar Data

Tracks

Primary

and secondary RADAR

WAN

LAN

+

-

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/234

ATC centre Architecture

Radar Data ProcessingRadar Data

Processing

Flight PlanProcessingFlight Plan

Processing

SupervisoryControlSupervisory

Control

SimulatorSimulator

RecordingReplayRecording

Replay

ControlerWorkingPosition

ControlerWorkingPosition

Voice control and

communicationsVoice control

and communications

Radar FrontProcessingRadar Front

Processing

Dual LANFDDI

AFTN/CIDINATFM

ADJACENTFIR'S/TWR'S

MET Centres

RADAR

• Intercom• Priority• Public• RADIO A/G

ControlerWorkingPosition

ControlerWorkingPosition

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/235

PLUG : Presentation Layer Universal Generator

OSI layer 6 & 7 services Manages heterogeneous programming

languages and hardware Provides Plug & Play (flexibility)

=> Automatic code generation

=> Object Oriented Design

Application

Presentation

Session

ASN.1*

7

6

5

ASE* ASE ASE ASE

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/236

Object analogy

Implementation Interface

A driver doesn't care of engine's internal working.He only knows the interface

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/237

Specification Language

Network

Node A Node B

IRS (IDL)Struct message1

Item1 : short;

Item2 : long;

Item3 : char;

Item4 : Boolean;

Item4 : Struct data

Item1 : :char;

Item2 : long;

Item3 : char;

Item4 : Boolean

Item4 : char;

end struct data;

end struct message1

Communication Language

ProgrammingLanguage (C++)

ProgrammingLanguage (Ada)

Communication Object Design

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/238

Syntax and Language

Abstract Syntax : specification language : ASN.1, IDL, (ADA)

Working Syntax : programming language : ADA, C, C++

Transfert (concrete) Syntax : communication language : BER/PER, XDR, CDR, ASTERIX, ADEXP, ICAO

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/239

Compiler VS Parser

Abstract Syntax is independent of Transfert syntax :

Automatic code generation : Compilers

If no Abstract Syntax (AS = TS) : Manual code generation : Parsers

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2310

PLUG Compilers

ABSTRACT SYNTAX PLUG Ada RPC : API PLUG ASN.1 : ATN PLUG IDL : CORBA

Front End (FE)

TRANSFERT SYNTAX PLUG XDR : API PLUG BER/PER : ATN PLUG CDR : CORBA, ESIOP

Back End (BE)

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2311

PLUG Parsers

PLUG ASTERIX : Radar, Meteo, Categorie XX

PLUG ADEXP : Flight Plan, ATS, AIS, CFMU, IFPS,

OLDI PLUG ICAO :

Flight Plan, Meteo, Notam, ATS, OLDI

Tracks

Primary

and secondary RADAR

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2312

PLUG Compilers through applications

Distributed Object Design : API (IDL) PATIO UBSS based Ada RPC Stub generator

Message passing object design XDR Coder generator

Miscellanous Symbolic trace and debug functions Programming Language translator

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2313

PATIO API paradigm Software components Plug & Play

Vertical services, Frame work, Design Patterns

Business Middleware = OSI layers 7,5,6 = ORB Core services

Business APIs = OSI layer 7 ASEs = CORBA objects

Business Middleware is also called API layer because it exhibits only application APIs.

An API (as an ASE) is : A protocol and A logical interface (API = abstract syntax) : IRS

* IRS : Interface Requirements Specification.

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2314

API protocol

UBSS

API(SKELETON)

APPLI

UBSS

API(STUBS)

APPLI

ServerClient

API PROTOCOL

UNIX

LAN

UNIX

API

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2315

API : How it works

API protocol is equivalent to Sun RPC (Remote Procedure Call) with asynchronous events

Servers Publish service interface and clients subscribe to services Client invokes remote procedures executed by the server or

receives asynchronous event Each server exports interfaces. RPC encapsulates network access :

Send/Receive are hidden by Application functions call RPC protocol manages parameters passing between client to

server. XDR (External Data Representation) manages heterogeneous

programming language and hardware : Ada, C, C++.

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2316

RPC principle

Library

Main

Push

Pop

Unix process

Library

Main

Send

Receive

Unix process

Client Server

Marshalling

Unmarshalling

=>XDR

XDR

Unix process

S = A+ B

A, B, +

S

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2317

API : Ada distributed Package

Ada Package specificationc

Ada PackageImplementation

OperationsOperations

DATAand

Operations Implementation

DATAand

Operations Implementation

OperationsOperations

EmptyImplementation

Comms

EmptyImplementation

Comms

OperationsOperations

DATAand

Operations Implementation

DATAand

Operations Implementation

Client side Server side

=>

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2318

Heterogeneous Distributed System : Language or Hardware

Operations

DATAand

Operations Implementation

Operations

DATAand

Operations Implementation

Operations

DATAand

Operations Implementation

Operations

DATAand

Operations Implementation

Main API interface Operations

DATAand

Operations Implementation

Operations

DATAand

Operations Implementation

Operations

DATAand

Operations Implementation

Operations

DATAand

Operations Implementation

Ada ServerUnix Process

C ServerUnix Process

C++ ServerUnix Process

Ada or C or C++Client

Unix Process

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2319

API Programming model : Client Register;

Start Supervision API

Register with supervisor; Subscribe to supervision events

Program Main Loop

Wait next event

Case API

Supervision :

peek event from supervision :

process supervision events : Initialise, start, stop, kill

API1 :

peek event from API 1 :

process AP1 events : ............

API2 :

peek event from API 2 :

process AP2 events : ............

End loop

Stop event processing

Stop API1, API2

Stop supervision API

Unregister

Underlying code is the stub automatically generatedby PLUG.

Itallic code is written by applicationprogrammer.

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2320

Supervised

Initialised

Running

Initialise / Start Services & Subscribe

Start / Process Events

Kill / Unregister

Unsupervised

/ Start supervision, Register & Subscribe

Unregistered

/ RegisterEvent/Action

Frozen

Unfreeze / Process Events

Stop / Stop services

Kill / Stop Services & Unregister

Freeze / Don't process Events

Client state diagram

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2321

XDR

Stub Generator Coder Generator

C Ada

Ada API

C Ada

PLUG : Presentation Layer Universal Generator

(IDL)

(CDR)(IDL,C++)

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2322

PLUG Stub Generator

Register; Start Supervion API

Register with supervisor; Subscribe to supervision events

Program Main Loop

Wait next event

Case API

Supervision :

peek event from supervision :

process supervision events : Initialise, start, stop, kill

API1 :

peek event from API 1 :

process AP1 events : .

API2 :

peek event from API 2 :

process AP2 events : ............

API3 :

peek event from API 2 :

process AP2 events : ............

End loop

Stop event processing

Stop API1, API2

Stop supervision API

Unregister

• Program skeltons are automatically generated by PLUG.• Stub generation is template driven.• Templates are written with PLUG Template Description Language (TDL).

Template

All Technical Middelware details are hidden to the programmer : Registry, Supervision, Subscription.

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2323

PLUG Coder generator

IFF

XDR/C generatedencoding source files

Front End(lex/yacc)

Back End

XDR/ADA generatedencoding source files

Ada Grammar

(BNF)

grammar analyzegrammar analyze

XDR Templatesexpansion

XDR Templatesexpansion

XDR Templates

(TDL)

AdaAPI

Independant Format File

Independant Format File

Abstract Syntax Tree

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2324

Object message passing with PLUG

UBSS manages pipes not the semantic of transported messages

PLUG Coder are used to manage FIFO and CDC messages.

Ada type specification is used as Specification input file (AS)

IRS documents are replaced by Ada specification

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2325

Plug coder use : FIFO encode/decode

FIFOEnqueue Dequeue

Type AType BType Simple 1Type Simple 2

End Type BType CType Simple 1Type Simple 3Type D

Type Simple 3Type Simple 2

End Type DEnd Type C

End Type A

Type AType BType Simple 1Type Simple 2

End Type BType CType Simple 1Type Simple 3Type D

Type Simple 3Type Simple 2

End Type DEnd Type C

End Type A

Type Ada Type C

Ada

XDR

XDR

C

Call Back encoding routing

XDR buffer

ToolsUser Tools User

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2326

Plug coder use : CDC encode/decode

Ada

XDR

XDR

C

Type AType BType Simple 1Type Simple 2

End Type BType CType Simple 1Type Simple 3Type D

Type Simple 3Type Simple 2

End Type DEnd Type C

End Type A

Type AType BType Simple 1Type Simple 2

End Type BType CType Simple 1Type Simple 3Type D

Type Simple 3Type Simple 2

End Type DEnd Type C

End Type A

Type Ada Type CCall Back encoding routing

CDCCDC_write() CDC_read()

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2327

AdaCSCI

CCSCI

XDR

Ada Compiler C Compiler

XDR : How it works.

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2328

Coder : Structure Serialization

Struct Message Type 1

Field AField B

Field CField D

Field EField FField G

End struct Message type1

Ada or C structure

XDR Stream

XDR Convertor

Elementary types are : Int, Char, float, Boolean Field 1Field 2Field 3Field 4Field 5 Header

Type 1

A B

C D

E

F G

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2329

C/XDRCoder

(C)

Struct Message Type 1 Field A

Field BField C

Field DField E

Field FField GField H

Field IEnd struct Message Type1

C structure

Field 1Field 2Field 3Field 4Field 5Field 6Field 7Field 8Field 9

XDR StreamAda/XDRCoder(Ada)

Struct Message Type 1 Field A

Field BField C

Field DField E

Field FField GField H

Field IEnd struct Message Type1

Ada structure

InterfaceSpecification

Abstract Syntax

Transfert Syntax

Programming SyntaxProgramming Syntax

Object Message Passing Syntax

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2330

C/XDRCoder

Struct Message Type 1 Field A

Field BField C

Field DField E

Field FField GField H

Field IEnd struct Message Type1

C structure

Field 1Field 2Field 3Field 4Field 5Field 6Field 7Field 8Field 9

XDR StreamAda/XDR

Coder

Struct Message Type 1 Field A

Field BField C

Field DField E

Field FField GField H

Field IEnd struct Message Type1

Ada structure

InterfaceSpecification

C/XDRCoder

Generator

Ada to CTranslator

Ada/XDRCoder

Generator

Ada PackageSpecification

(With)

Code generation output

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2331

C/XDRCoder

Struct Message Type 1 Field A

Field BField C

Field DField E

Field FField GField H

Field IEnd struct Message Type1

C structure

Field 1Field 2Field 3Field 4Field 5Field 6Field 7Field 8Field 9

XDR StreamC/XDRCoder

Struct Message Type 1 Field A

Field BField C

Field DField E

Field FField GField H

Field IEnd struct Message Type1

C structure

C/XDRCoder

Struct Message Type 1 Field A

Field BField C

Field DField E

Field FField GField H

Field IEnd struct Message Type1

C structure

Field 1Field 2Field 3Field 4Field 5Field 6Field 7Field 8Field 9

XDR StreamAda/XDR

Coder

Struct Message Type 1 Field A

Field BField C

Field DField E

Field FField GField H

Field IEnd struct Message Type1

Ada structure

Ada/XDRCoder

Struct Message Type 1 Field A

Field BField C

Field DField E

Field FField GField H

Field IEnd struct Message Type1

Ada structure

Field 1Field 2Field 3Field 4Field 5Field 6Field 7Field 8Field 9

XDR StreamAda/XDR

Coder

Struct Message Type 1 Field A

Field BField C

Field DField E

Field FField GField H

Field IEnd struct Message Type1

Ada structure

Coder context

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2332

Plug other possible applications

Symbolic trace and debug functions Complex structure symbolic dump

Programming Language Translator Ada to C, Ada to C++

Off line and recording files management XDR standard file format

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2333

Sum Up

Object Oriented Design is mandatory to manage heterogeneous programming language and hardware to provide P&P.

Three kinds of services UBSS based Object Middleware : API Ada abstract syntax for Object Message Passing Handcrafted Parser for ATC specific Transfer

Syntax

E. F

UC

HS

plug

.ppt

P&D/SSD/TCE/TFP/AST - 04/10/2334

Future

IDL based ASTERIX compiler States chart based code generation for Object

dymanic ASE Skelton automatic generation Business Object Skelton automatic generation Ada/C++ translator