From 2f448b290b5794a1dcd68e1da9771d85e37858ea Mon Sep 17 00:00:00 2001 From: yoogx Date: Mon, 14 Apr 2014 15:00:22 -0700 Subject: [PATCH] * Add minimal support for annex-specific property definition --- .../ocarina-me_aadl-aadl_tree-entities-properties.ads | 7 +++++-- src/frontends/aadl/ocarina-fe_aadl-lexer.adb | 8 +++++--- src/frontends/aadl/ocarina-fe_aadl-lexer.ads | 5 +++-- .../aadl/ocarina-fe_aadl-parser-properties-values.adb | 10 +++++++++- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/core/tree/ocarina-me_aadl-aadl_tree-entities-properties.ads b/src/core/tree/ocarina-me_aadl-aadl_tree-entities-properties.ads index aadb5a38..6375627d 100644 --- a/src/core/tree/ocarina-me_aadl-aadl_tree-entities-properties.ads +++ b/src/core/tree/ocarina-me_aadl-aadl_tree-entities-properties.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2012 ESA & ISAE. -- +-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2014 ESA & ISAE. -- -- -- -- Ocarina is free software; you can redistribute it and/or modify -- -- it under terms of the GNU General Public License as published by the -- @@ -132,7 +132,10 @@ package Ocarina.ME_AADL.AADL_Tree.Entities.Properties is PO_Provides_Subprogram_Access, PO_Prototype, - PO_Package); + PO_Package, + + PO_Alien_Meta_Model -- Not support alien meta-model elements, e.g. EMV2 + ); type Referable_Element_Category is (REC_Component_Category, diff --git a/src/frontends/aadl/ocarina-fe_aadl-lexer.adb b/src/frontends/aadl/ocarina-fe_aadl-lexer.adb index b2ca2cd0..e2af3b51 100644 --- a/src/frontends/aadl/ocarina-fe_aadl-lexer.adb +++ b/src/frontends/aadl/ocarina-fe_aadl-lexer.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2012 ESA & ISAE. -- +-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2014 ESA & ISAE. -- -- -- -- Ocarina is free software; you can redistribute it and/or modify -- -- it under terms of the GNU General Public License as published by the -- @@ -981,10 +981,12 @@ package body Ocarina.FE_AADL.Lexer is -- Skip_Tokens -- ----------------- - procedure Skip_Tokens (Delimiters : Token_List_Type) is + procedure Skip_Tokens (Delimiters : Token_List_Type; + Include_Delimiter : Boolean := True) + is begin for Index in Delimiters'Range loop - Skip_Tokens (Delimiters (Index)); + Skip_Tokens (Delimiters (Index), Include_Delimiter); end loop; end Skip_Tokens; diff --git a/src/frontends/aadl/ocarina-fe_aadl-lexer.ads b/src/frontends/aadl/ocarina-fe_aadl-lexer.ads index e08fa8d3..e3ee63a0 100644 --- a/src/frontends/aadl/ocarina-fe_aadl-lexer.ads +++ b/src/frontends/aadl/ocarina-fe_aadl-lexer.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2012 ESA & ISAE. -- +-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2014 ESA & ISAE. -- -- -- -- Ocarina is free software; you can redistribute it and/or modify -- -- it under terms of the GNU General Public License as published by the -- @@ -86,7 +86,8 @@ package Ocarina.FE_AADL.Lexer is -- Skip tokens until we find Delimiter -- This procedure verifies that skipped tokens are well embraced - procedure Skip_Tokens (Delimiters : Token_List_Type); + procedure Skip_Tokens (Delimiters : Token_List_Type; + Include_Delimiter : Boolean := True); -- Same as above, with each token T in given list, calls Skip_Tokens (T) end Ocarina.FE_AADL.Lexer; diff --git a/src/frontends/aadl/ocarina-fe_aadl-parser-properties-values.adb b/src/frontends/aadl/ocarina-fe_aadl-parser-properties-values.adb index 00ed44bb..3c12e84a 100644 --- a/src/frontends/aadl/ocarina-fe_aadl-parser-properties-values.adb +++ b/src/frontends/aadl/ocarina-fe_aadl-parser-properties-values.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2012 ESA & ISAE. -- +-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2014 ESA & ISAE. -- -- -- -- Ocarina is free software; you can redistribute it and/or modify -- -- it under terms of the GNU General Public License as published by the -- @@ -2918,6 +2918,14 @@ package body Ocarina.FE_AADL.Parser.Properties.Values is Owner_Category := New_Node (K_Named_Element, Token_Location); case Token is + when T_Left_Curly_Bracket => + -- For now, we simply skip annex-dependent properties + + Save_Lexer (Loc); + Skip_Tokens ((T_Comma, T_Right_Parenthesis), False); + Category := PO_Alien_Meta_Model; + Comp_Cat := CC_Unknown; + when T_Abstract | T_System | T_Processor | T_Thread | T_Process | T_Virtual -- GitLab