OpenAADL / ocarina

AADL model processor: mappings to code (C, Ada); Petri Nets; scheduling tools (MAST, Cheddar); WCET; REAL
http://www.openaadl.org
Other
64 stars 29 forks source link

Parsing of array size definition using constant property for subcomponent component arrays #174

Open 2000GYI opened 5 years ago

2000GYI commented 5 years ago

OCARINA VERSION: Ocarina 2017.x (Working Copy from r23cc28c) Copyright (c) 2003-2009 Telecom ParisTech, 2010-2018 ESA & ISAE Build date: /home/user/git/ocarina-build/ocarina_install/share/ocarina/AADLv1/

HOST MACHINE and OPERATING SYSTEM: Linux laptop 4.15.0-36-generic #39-Ubuntu SMP Mon Sep 24 16:19:09 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

COMPILER VERSION GNATLS 7.3.0 Copyright (C) 1997-2017, Free Software Foundation, Inc.

Source Search Path:

/usr/lib/gcc/x86_64-linux-gnu/7/adainclude Object Search Path: /usr/lib/gcc/x86_64-linux-gnu/7/adalib Project Search Path: /usr/x86_64-linux-gnu/lib/gnat /usr/x86_64-linux-gnu/share/gpr /usr/share/gpr /usr/lib/gnat **DESCRIPTION:** Osate2.3.5 accepts subcomponents components array with a size defined by a constant property (form a property set); however, the ocarina parser (using AADLXML backend) rejects the addl file. **REPEAT BY:** Unzip the attached files: [aadl_test_case.zip](https://github.com/OpenAADL/ocarina/files/2481122/aadl_test_case.zip) Run ocarina with this command: `ocarina -d -v -aadlv2 -f -g aadl_xml -r sys.impl -o . TestCase_ParseSubcomponentsArraysWithAADLXMLBackend.aadl props.aadl` Get this output: ``` Ocarina 2017.x (Working Copy from r23cc28c) Copyright (c) 2003-2009 Telecom ParisTech, 2010-2018 ESA & ISAE Build date: Loading file TestCase_ParseSubcomponentsArraysWithAADLXMLBackend.aadl TestCase_ParseSubcomponentsArraysWithAADLXMLBackend.aadl:19:45: parsing Subcomponent, token ';' is expected, found identifier 'sise' TestCase_ParseSubcomponentsArraysWithAADLXMLBackend.aadl:19:04: parsing Component_Implementation, unexpected identifier 'procs_property' TestCase_ParseSubcomponentsArraysWithAADLXMLBackend.aadl:21:56: parsing Package_Specification, Empty packages are not allowed Cannot parse AADL specifications ``` **SAMPLE FIX/WORKAROUND:** unknown Thanks, GYI
2000GYI commented 5 years ago

I think I see the problem. AADLv2 specification defines array size like so:

array_dimension_size ::= 
   numeral | unique_property_constant_identifier | unique_property_identifier

whereas lines 103-105 of the file /src/frontends/aadl/ocarina-fe_aadl-parser-components-arrays.adb defines the array size like so:

--  AADL_V2
--  array_dimensions ::= { [ [ array_dimension_size ] ] }*
--  array_dimension_size ::= numeral | unique_property_constant_identifier

In other words, it doesn't appear to be implemented. If you can give me some pointers, I might give it a go to create a patch.

Thanks, GYI

yoogx commented 5 years ago

I did a first pass at supporting this feature. Remaining actions