Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
buildsupport
Commits
2f56caee
Commit
2f56caee
authored
Mar 30, 2017
by
Maxime Perrotin
Browse files
Setup parsing of context parameters
parent
991ebcff
Changes
3
Hide whitespace changes
Inline
Side-by-side
ada/buildsupport.adb
View file @
2f56caee
...
...
@@ -269,8 +269,6 @@ procedure BuildSupport is
NA
:
constant
Name_Array
:=
Get_Source_Text
(
Asn1type
);
FS_File
:
Unbounded_String
;
-- For the Ada AST:
CP
:
Context_Parameter
;
begin
-- Some special DATA components have no
-- Source_Text property in DataView.aadl
...
...
@@ -288,12 +286,6 @@ procedure BuildSupport is
To_String
(
FS_file
),
To_String
(
FS_file
)'
Length
,
FS_Fullname
);
CP
:=
(
Name
=>
US
(
FS_Fullname
),
Sort
=>
US
(
FS_type
),
Default_Value
=>
US
(
FS_value
),
ASN1_Module
=>
US
(
FS_module
),
ASN1_File_Name
=>
FS_file
);
pragma
Unreferenced
(
CP
);
end
;
end
if
;
FV_Subco
:=
Next_Node
(
FV_Subco
);
...
...
ada/buildsupport_utils.adb
View file @
2f56caee
...
...
@@ -400,6 +400,8 @@ package body Buildsupport_Utils is
-- To get the optional zip filename where user code is stored:
Source_Text
:
constant
Name_Array
:=
Get_Source_Text
(
Inst
);
Zip_Id
:
Name_Id
:=
No_Name
;
-- To get the context parameters
Subco
:
Node_Id
;
begin
Result
.
Name
:=
US
(
Name
);
Result
.
Language
:=
Get_Source_Language
(
Inst
);
...
...
@@ -407,6 +409,20 @@ package body Buildsupport_Utils is
Zip_Id
:=
Source_Text
(
1
);
Result
.
Zip_File
:=
Just
(
US
(
Get_Name_String
(
Zip_Id
)));
end
if
;
-- Parse context parameters
if
Present
(
AIN
.
Subcomponents
(
Inst
))
then
Subco
:=
AIN
.
First_Node
(
AIN
.
Subcomponents
(
Inst
));
while
Present
(
Subco
)
loop
case
Get_Category_Of_Component
(
Subco
)
is
when
CC_Data
=>
null
;
when
others
=>
null
;
end
case
;
Subco
:=
AIN
.
Next_Node
(
Subco
);
end
loop
;
end
if
;
return
Result
;
end
Parse_Function
;
...
...
ada/buildsupport_utils.ads
View file @
2f56caee
...
...
@@ -105,6 +105,9 @@ package Buildsupport_Utils is
-- Types needed to build the AST of the TASTE Interface View in Ada
type
Parameter_Direction
is
(
param_in
,
param_out
);
package
Option_UString
is
new
Option_Type
(
Unbounded_String
);
use
Option_UString
;
type
ASN1_Parameter
is
record
Name
:
Unbounded_String
;
...
...
@@ -139,18 +142,16 @@ package Buildsupport_Utils is
Sort
:
Unbounded_String
;
Default_Value
:
Unbounded_String
;
ASN1_Module
:
Unbounded_String
;
ASN1_File_Name
:
Unbounded_String
;
ASN1_File_Name
:
Option
(
Present
=>
False
)
;
end
record
;
package
Ctxt_Params
is
new
Indefinite_Vectors
(
Natural
,
Context_Parameter
);
package
Option_Zip
is
new
Option_Type
(
Unbounded_String
);
use
Option_Zip
;
type
Taste_Terminal_Function
is
record
Name
:
Unbounded_String
;
Language
:
Supported_Source_Language
;
Zip_File
:
Option
_Zip
.
Option
(
False
)
:=
Nothing
;
Zip_File
:
Option
(
Present
=>
False
)
;
Context_Params
:
Ctxt_Params
.
Vector
;
User_Properties
:
Property_Maps
.
Map
;
Timers
:
String_Vectors
.
Vector
;
...
...
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