ocarina icon indicating copy to clipboard operation
ocarina copied to clipboard

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

Open 2000GYI opened this issue 7 years ago • 2 comments

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: <Current_Directory> /usr/lib/gcc/x86_64-linux-gnu/7/adainclude

Object Search Path: <Current_Directory> /usr/lib/gcc/x86_64-linux-gnu/7/adalib

Project Search Path: <Current_Directory> /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

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 avatar Oct 16 '18 02:10 2000GYI

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

2000GYI avatar Oct 16 '18 04:10 2000GYI

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

  • complete property resolution in AST (analyser part)
  • revisit instantiation mechanism

yoogx avatar Oct 27 '18 20:10 yoogx