Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
Ocarina
Commits
ed6fcec6
Commit
ed6fcec6
authored
Apr 19, 2016
by
Jerome Hugues
Browse files
* Move instantiation and analyse part of REAL to its backend,
for symmetry with other backends
parent
ce72615f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/backends/ocarina-backends-real.adb
View file @
ed6fcec6
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-201
5
ESA & ISAE. --
-- Copyright (C) 2009 Telecom ParisTech, 2010-201
6
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
...
...
@@ -32,9 +32,12 @@
with
Ada
.
Numerics
.
Generic_Elementary_Functions
;
with
Ocarina
.
Namet
;
with
Ocarina
.
Output
;
with
Errors
;
use
Errors
;
with
Locations
;
use
Locations
;
with
Ocarina
.
Analyzer
.
REAL
;
with
Ocarina
.
ME_REAL
.
Tokens
;
use
Ocarina
.
ME_REAL
.
Tokens
;
with
Ocarina
.
ME_REAL
.
REAL_Tree
.
Nodes
;
with
Ocarina
.
ME_REAL
.
REAL_Tree
.
Nutils
;
with
Ocarina
.
ME_REAL
.
REAL_Tree
.
Utils
;
...
...
@@ -44,6 +47,8 @@ with Ocarina.Backends.Messages;
with
Ocarina
.
ME_AADL
.
AADL_Instances
.
Nodes
;
with
Ocarina
.
ME_AADL
.
AADL_Instances
.
Nutils
;
with
Ocarina
.
Analyzer
;
with
Ocarina
.
Instances
;
with
Ocarina
.
Instances
.
REAL_Finder
;
with
Ocarina
.
Instances
.
REAL_Checker
.
Queries
.
Subcomponent_Predicates
;
with
Ocarina
.
Instances
.
REAL_Checker
.
Queries
.
Bound_Predicates
;
...
...
@@ -62,10 +67,12 @@ package body Ocarina.Backends.REAL is
(
Long_Long_Float
);
use
Numerics
;
use
Ocarina
.
Analyzer
;
use
Ocarina
.
ME_REAL
.
REAL_Tree
.
Nodes
;
use
Ocarina
.
ME_REAL
.
REAL_Tree
.
Nutils
;
use
Ocarina
.
ME_REAL
.
REAL_Tree
.
Utils
;
use
Ocarina
.
REAL_Values
;
use
Ocarina
.
Instances
;
use
Ocarina
.
Instances
.
REAL_Finder
;
use
Ocarina
.
Backends
.
Messages
;
use
Ocarina
.
Namet
;
...
...
@@ -3187,8 +3194,13 @@ package body Ocarina.Backends.REAL is
It
:
Natural
:=
First
;
Node
:
Node_Id
;
Success
:
Boolean
;
begin
Root_System
:=
AADL_Root
;
Root_System
:=
Instantiate_Model
(
AADL_Root
);
Exit_On_Error
(
No
(
AADL_Root
),
"Cannot instantiate AADL models"
);
Success
:=
Analyze
(
REAL_Language
,
Root_System
);
Exit_On_Error
(
not
Success
,
"Cannot analyze REAL specifications"
);
-- Runtime
...
...
src/main/ocarina_cmd.adb
View file @
ed6fcec6
...
...
@@ -62,11 +62,8 @@ with Ocarina.Options; use Ocarina.Options;
with
Ocarina
.
Parser
;
use
Ocarina
.
Parser
;
with
Ocarina
.
Property_Sets
;
use
Ocarina
.
Property_Sets
;
with
Ocarina
.
FE_AADL
.
Parser
;
use
Ocarina
.
FE_AADL
.
Parser
;
-- with Ocarina.FE_REAL; use Ocarina.FE_REAL;
with
Ocarina
.
ME_REAL
.
Tokens
;
with
Ocarina
.
ME_AADL
.
AADL_Instances
.
Nodes
;
with
Ocarina
.
Scripts
;
use
Ocarina
.
Scripts
;
with
Ocarina
.
Scripts
;
use
Ocarina
.
Scripts
;
procedure
Ocarina_Cmd
is
...
...
@@ -537,8 +534,6 @@ procedure Ocarina_Cmd is
end
;
end
Parse_Scenario_Files
;
package
RT
renames
Ocarina
.
ME_REAL
.
Tokens
;
begin
-- Init
...
...
@@ -651,16 +646,6 @@ begin
end
if
;
when
Generate_Code
=>
if
Get_Current_Backend_Name
=
Get_String_Name
(
"real_theorem"
)
or
else
Get_Current_Backend_Name
=
Get_String_Name
(
"real_pp"
)
then
AADL_Root
:=
Instantiate_Model
(
AADL_Root
);
Exit_On_Error
(
No
(
AADL_Root
),
"Cannot instantiate AADL models"
);
Success
:=
Analyze
(
RT
.
REAL_Language
,
AADL_Root
);
Exit_On_Error
(
not
Success
,
"Cannot analyze REAL specifications"
);
end
if
;
Generate_Code
(
AADL_Root
);
if
Verbose
then
Set_Standard_Error
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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