Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
Ocarina
Commits
1158948c
Commit
1158948c
authored
Apr 10, 2015
by
yoogx
Browse files
* Adjust parser to address AADLv2.1 parsing of list of records
For ticket #29
parent
9426eaee
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/frontends/aadl/ocarina-fe_aadl-parser-properties-values.adb
View file @
1158948c
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-201
4
ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-201
5
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 --
...
...
@@ -2508,6 +2508,9 @@ package body Ocarina.FE_AADL.Parser.Properties.Values is
return
No_Node
;
end
if
;
when
T_Left_Square_Bracket
=>
return
P_Record_Term
;
when
others
=>
DPE
(
PC_Boolean_Or_Record_Term
);
return
No_Node
;
...
...
src/frontends/aadl/ocarina-fe_aadl-parser-properties.adb
View file @
1158948c
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-201
4
ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-201
5
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 --
...
...
@@ -85,7 +85,6 @@ package body Ocarina.FE_AADL.Parser.Properties is
Loc
:
Location
;
Prop_Value
:
Node_Id
;
Parse_List_Of_Properties
:
Boolean
:=
True
;
begin
-- Parse Property_Value
...
...
@@ -93,30 +92,7 @@ package body Ocarina.FE_AADL.Parser.Properties is
Save_Lexer
(
Loc
);
Scan_Token
;
-- The AADLv2 BNF is ambiguous, a string starting with a '('
-- can either be a list of property expressions e.g. "(foo,
-- bar);" _or_ a single_expression containing a record term,
-- e.g. "(foo => 1; bar =>2;)". This look ahead loop scans
-- token to see which case we are currently processing.
declare
Loc2
:
Location
;
begin
Save_Lexer
(
Loc2
);
if
Token
=
T_Left_Parenthesis
then
while
Token
/=
T_Right_Parenthesis
loop
Scan_Token
;
if
Token
=
T_Semicolon
or
else
Token
=
T_Applies
then
Parse_List_Of_Properties
:=
False
;
end
if
;
end
loop
;
else
Parse_List_Of_Properties
:=
False
;
end
if
;
Restore_Lexer
(
Loc2
);
end
;
if
Parse_List_Of_Properties
then
if
Token
=
T_Left_Parenthesis
then
Save_Lexer
(
Loc
);
Scan_Token
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment