-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'eyraud/118' into 'master'
TGen: fix generation of marshallers for scalar type with private ext See merge request eng/ide/libadalang-tools!152
- Loading branch information
Showing
32 changed files
with
361 additions
and
378 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/tgen/templates/marshalling_templates/composite_size_max.tmplt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@@-- Template for the specification of the base subprograms for composite | ||
@@-- types. | ||
@@-- @_GLOBAL_PREFIX_@ Prefix used to prefix all entities local to the unit. | ||
@@-- @_TY_PREFIX_@ Prefix used to prefix all entities for the current type. | ||
@@-- @_TY_NAME_@ Name of the current type. | ||
@@-- @_FIRST_NAME_@ Names of the components for the 'First attributes. Only | ||
@@-- set if the current type is an array. | ||
@@-- @_LAST_NAME_@ Same as above for the 'Last attributes. | ||
@@-- @_DISCR_NAME_@ Same as above for the discriminants of records. | ||
@@-- @_COMP_TYP_@ Index types for arrays, and types of the discriminants for | ||
@@-- records. | ||
@@-- @_SIZE_MAX_PUB_@ True if the Size_Max function can be declared in the | ||
@@-- public part. This will be False if one of the discriminant types, or | ||
@@-- index types is not visible outside of the private part. | ||
@@-- | ||
@@INCLUDE@@ util.tmplt | ||
|
||
function @_TY_PREFIX_@_Size_Max | ||
@@IF@@ @_DISCR_NAME_@ /= "" | ||
@@TABLE'ALIGN_ON(":", ":=")@@ | ||
@_LPAR()_@@_GLOBAL_PREFIX_@_@_DISCR_NAME_@_D_Min : @_DISCR_TYP_@ := @_DISCR_TYP_@'First; | ||
@_GLOBAL_PREFIX_@_@_DISCR_NAME_@_D_Max : @_DISCR_TYP_@ := @_DISCR_TYP_@'Last@_RPAR()_@ | ||
@@END_TABLE@@ | ||
@@ELSIF@@ @_FIRST_NAME_@ /= "" | ||
@@TABLE'ALIGN_ON(":", ":=")@@ | ||
@_LPAR()_@@_GLOBAL_PREFIX_@_@_FIRST_NAME_@ : @_BOUND_TYP_@'Base := @_BOUND_TYP_@'First; | ||
@_GLOBAL_PREFIX_@_@_LAST_NAME_@ : @_BOUND_TYP_@'Base := @_BOUND_TYP_@'Last@_RPAR()_@ | ||
@@END_TABLE@@ | ||
@@END_IF@@ | ||
return Natural; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/tgen/templates/marshalling_templates/header_private.tmplt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@@-- Template for the private part of the header handling. | ||
@@-- @_GLOBAL_PREFIX_@ Prefix used to prefix all entities local to the unit. | ||
@@-- @_TY_PREFIX_@ Prefix used to prefix all entities for the current type. | ||
@@-- @_TY_NAME_@ Name of the current type. | ||
@@-- @_FIRST_NAME_@ Names of the components for the 'First attributes. Only | ||
@@-- set if the current type is an array. | ||
@@-- @_LAST_NAME_@ Same as above for the 'Last attributes. | ||
@@-- @_DISCR_NAME_@ Same as above for the discriminants of records. | ||
@@-- @_COMP_TYP_@ Index types for arrays, and types of the discriminants for | ||
@@-- records. | ||
@@-- | ||
-- Definition of a header type and Input and Output functions for @_TY_NAME_@ | ||
|
||
type @_TY_PREFIX_@_Header_Type is record | ||
@@IF@@ @_FIRST_NAME_@ /= "" | ||
@@TABLE'ALIGN_ON(":")@@ | ||
@_FIRST_NAME_@ : @_COMP_TYP_@'Base; | ||
@_LAST_NAME_@ : @_COMP_TYP_@'Base; | ||
@@END_TABLE@@ | ||
@@ELSE@@ | ||
@@TABLE'ALIGN_ON(":")@@ | ||
@_DISCR_NAME_@ : @_COMP_TYP_@; | ||
@@END_TABLE@@ | ||
@@END_IF@@ | ||
end record; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/tgen/templates/marshalling_templates/scalar_base_private.tmplt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@@-- Template for the specification of the base subprograms for scalar types. | ||
@@-- @_GLOBAL_PREFIX_@ Prefix used to prefix all entities local to the unit. | ||
@@-- @_TY_PREFIX_@ Prefix used to prefix all entities for the current type. | ||
@@-- @_TY_NAME_@ Name of the current type or of its base type if we are | ||
@@-- doing the generation for the base type. | ||
@@-- @_FOR_BASE_@ True if we are doing the generation for the base type. | ||
@@-- | ||
@@INCLUDE@@ util.tmplt | ||
-- Private extensions of the functions encoding 'First and 'Last | ||
|
||
function @_TY_PREFIX_@_First@_BASE_SUFFIX()_@ return @_TY_NAME_@ is (@_TY_NAME_@'First); | ||
function @_TY_PREFIX_@_Last@_BASE_SUFFIX()_@ return @_TY_NAME_@ is (@_TY_NAME_@'Last); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.