Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2000GYI opened this issue Oct 16, 2018 · 2 comments
Assignees
Labels

Comments

@2000GYI
Copy link

2000GYI commented Oct 16, 2018

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
Copy link
Author

2000GYI commented Oct 16, 2018

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
Copy link
Contributor

yoogx commented Oct 27, 2018

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

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

@yoogx yoogx self-assigned this Oct 27, 2018
@yoogx yoogx added the bug label Oct 27, 2018
@yoogx yoogx changed the title Ocarina fails to parse valid (osate2.3.5 valid) AADL using constant property for subcomponent component arrays Parsing of array size definition using constant property for subcomponent component arrays Oct 27, 2018
yoogx added a commit that referenced this issue Oct 27, 2018
yoogx added a commit that referenced this issue Oct 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants