Commit b0dadb4c authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Initial commit - DMT with setup.py install script

parents
(C) Semantix Information Technologies.
Semantix Information Technologies is licensing the code of the
Data Modelling Tools (DMT) in the following dual-license mode:
Commercial Developer License:
The DMT Commercial Developer License is the suggested version
to use for the development of proprietary and/or commercial software.
This version is for developers/companies who do not want to comply
with the terms of the GNU Lesser General Public License version 2.1.
GNU LGPL v. 2.1:
This version of DMT is the one to use for the development of
applications, when you are willing to comply with the terms of the-
GNU Lesser General Public License version 2.1.
Note that in both cases, there are no charges (royalties) for the
generated code.
To purchase a commercial developer license (covering the entire
DMT toolchain), please contact Semantix at: dmt@semantix.gr
TASTE Data Modelling Technologies
- commonPy - Base API for parsing ASN.1
- asn2aadlPlus - Convert ASN.1 modules to AADL
- asn2dataModel - A mappers, convert ASN.1 for use in "any" language (Simulink, C, Ada, Python...)
- aadl2glueC - B mappers, generate runtime code for converting data from/to ASN.1 in various languages
This diff is collapsed.
This diff is collapsed.
// $ANTLR 2.7.7 (20120126): aadl.g -> AadlParserTokenTypes.txt$
AadlParser // output token vocab name
PACKAGE="package"=4
END="end"=5
SEMI=6
PUBLIC="public"=7
PRIVATE="private"=8
IDENT=9
DOUBLECOLON=10
NONE="none"=11
THREAD="thread"=12
EXTENDS="extends"=13
GROUP="group"=14
PROCESS="process"=15
SYSTEM="system"=16
SUBPROGRAM="subprogram"=17
DATA="data"=18
PROCESSOR="processor"=19
MEMORY="memory"=20
BUS="bus"=21
DEVICE="device"=22
DOT=23
IMPL="implementation"=24
FEATURES="features"=25
COLON=26
REFINED="refined"=27
TO="to"=28
PROVIDES="provides"=29
REQUIRES="requires"=30
REFINES="refines"=31
TYPE="type"=32
SUBCOMPONENTS="subcomponents"=33
ANNEX="annex"=34
ANNEX_TEXT=35
PROPERTY="property"=36
SET="set"=37
IS="is"=38
BOOLEAN="aadlboolean"=39
STRING="aadlstring"=40
ENUMERATION="enumeration"=41
LPAREN=42
COMMA=43
RPAREN=44
UNITS="units"=45
ASSIGN=46
STAR=47
REAL="aadlreal"=48
INTEGER="aadlinteger"=49
DOTDOT=50
PLUS=51
MINUS=52
NUMERIC_LIT=53
RANGE="range"=54
OF="of"=55
CLASSIFIER="classifier"=56
REFERENCE="reference"=57
CONNECTIONS="connections"=58
SERVER="server"=59
ACCESS="access"=60
INHERIT="inherit"=61
APPLIES="applies"=62
ALL="all"=63
MODE="mode"=64
PORT="port"=65
EVENT="event"=66
FLOW="flow"=67
PARAMETER="parameter"=68
LIST="list"=69
CONSTANT="constant"=70
DELTA="delta"=71
PROPERTIES="properties"=72
LCURLY=73
RCURLY=74
ASSIGNPLUS=75
VALUE="value"=76
IN="in"=77
BINDING="binding"=78
OR="or"=79
AND="and"=80
TRUE="true"=81
FALSE="false"=82
NOT=83
STRING_LITERAL=84
CALLS="calls"=85
MODES="modes"=86
INITIAL="initial"=87
LTRANS=88
RTRANS=89
ARROW=90
OUT="out"=91
INVERSE="inverse"=92
DARROW=93
FLOWS="flows"=94
SOURCE="source"=95
SINK="sink"=96
PATH="path"=97
AADLSPEC=98
NOTT="not"=99
TRANSITIONS="transitions"=100
HASH=101
DIGIT=102
EXPONENT=103
INT_EXPONENT=104
EXTENDED_DIGIT=105
BASED_INTEGER=106
BASE=107
ESC=108
HEX_DIGIT=109
WS=110
SL_COMMENT=111
all: makeParser runTest
makeParser: AadlParser.py
AadlParser.py: aadl.g
rm -f AadlLexer.py AadlParser.py
runantlr -o . aadl.g || { echo You need to apt-get install antlr ; exit 1 ; }
runTest:
./antlr.main.py < PierreToyExampleSystem.aadl
PACKAGE Functional_view
PUBLIC
SUBPROGRAM Dispatcher
FEATURES
TC : IN PARAMETER DataTypes::T_TC;
END Dispatcher;
SUBPROGRAM IMPLEMENTATION Dispatcher.AADL
CALLS {
TC_Parser : SUBPROGRAM TC_Parser.AADL;
Tc_1 : SUBPROGRAM TC.POS;
Tc_2 : SUBPROGRAM TC.PRO;
};
CONNECTIONS
PARAMETER TC -> TC_Parser.TC;
PARAMETER TC_Parser.Param -> Tc_1.POS;
PARAMETER TC_Parser.Param -> Tc_2.POS;
PROPERTIES
Source_Language => "Lustre";
END Dispatcher.AADL;
SUBPROGRAM TC_Parser
FEATURES
TC : IN PARAMETER DataTypes::T_TC;
Id : OUT PARAMETER DataTypes::T_POS;
Param : OUT PARAMETER DataTypes::T_POS;
PROPERTIES
Source_Language => "Lustre";
END TC_Parser;
SUBPROGRAM IMPLEMENTATION TC_Parser.AADL
END TC_Parser.AADL;
SUBPROGRAM TC
FEATURES
POS : IN PARAMETER DataTypes::T_POS;
END TC;
SUBPROGRAM IMPLEMENTATION TC.POS
CALLS {
Write : SUBPROGRAM Write.AADL;
};
CONNECTIONS
PARAMETER POS -> Write.POS;
END TC.POS;
SUBPROGRAM IMPLEMENTATION TC.PRO
CALLS {
Boost_Order : SUBPROGRAM Boost_Order.AADL;
};
CONNECTIONS
PARAMETER POS -> Boost_Order.POS;
END TC.PRO;
SUBPROGRAM Write
FEATURES
POS : IN PARAMETER DataTypes::T_POS;
END Write;
SUBPROGRAM Boost_Order
FEATURES
POS : IN PARAMETER DataTypes::T_POS;
END Boost_Order;
END Functional_view;
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
aadl2glueC : B mappers -generate code that convert from/to ASN1SCC
"""
from aadl2glueC import main
__version__ = 1.0
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#!/usr/bin/env python
import AadlLexer
import AadlParser
import commonPy.aadlAST
import commonPy.utility
import antlr
import sys
def main():
if len(sys.argv)>1:
L = AadlLexer.Lexer(sys.argv[1])
else:
L = AadlLexer.Lexer()
P = AadlParser.Parser(L)
P.setFilename(L.getFilename())
try:
P.aadl_specification()
except antlr.ANTLRException, e:
commonPy.utility.panic("Error: %s\n" % (str(e)))
SystemsAndImplementations = commonPy.aadlAST.g_subProgramImplementations[:]
SystemsAndImplementations.extend(commonPy.aadlAST.g_threadImplementations[:])
SystemsAndImplementations.extend(commonPy.aadlAST.g_processImplementations[:])
for si in SystemsAndImplementations:
sp, sp_impl, modelingLanguage, fv_name = si[0], si[1], si[2], si[3]
sp = commonPy.aadlAST.g_apLevelContainers[sp]
print sp._id+"."+sp_impl, "(", modelingLanguage, ") FV_name:", fv_name
for param in sp._params:
print "\t",
if isinstance(param, commonPy.aadlAST.InParam):
print "IN",
elif isinstance(param, commonPy.aadlAST.OutParam):
print "OUT",
elif isinstance(param, commonPy.aadlAST.InOutParam):
print "INOUT",
if isinstance(param._signal, commonPy.aadlAST.Signal):
print "\t", param._id, ":", param._signal._asnFilename, param._signal._asnNodename, "(", param._sourceElement._encoding, ")"
else:
print "\t", param._id, ":", param._signal, "(", param._sourceElement._encoding, ")"
print
if len(sp._connections):
print "\tConnections:"
for pair in sp._connections:
print "\t\tfrom", pair._from._componentId+':'+pair._from._portId, "to", pair._to._componentId+':'+pair._to._portId
print
if __name__ == "__main__":
main()
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment