Major change into libGPR2 and GPRTools, all APIs previously
using Attribute_Id and/or Package_Id/Attribute_Id are now
using the combined qualified name Q_Attribute_Id in order
to unify APIs usage.
Few exceptions exist when retriving Attributes from a named
Package.
As Q_Attribute_Id is now used all over libGPR2, the list of
Attribute_Id constants was removed and a list of Q_Attribute_Id
constants can now be found at the same place. This was done
to simplify APIs call by providing defined and registered
attributes qualified name.
V720-027 :
When users are adding attributes without adding a package first
this package is not taken into account when launching Validity_Check.
We cannot make the assumption on which kind of project this package
is authorized to be in, so we are adding a precondition.
We now raise an ASSERTION_ERROR when trying to add an attribute
in a unknown package.
TN: V725-008
TN: V720-027
Change-Id: I3807ac993002c308021f082c7ba034cc371563cc
no-precommit-check
This patch is rejected by the "Copyright notice must include current
year" check, we actually want to preserve the copyright years here.
TN: V822-021
Change-Id: Iad42ad0863f12d7a3c714855287c5996581910b6
The view's "Attribute" function now fully computes the attributes values
based on the attributes definitions in Project.Registry.Attribute.
The various subprograms that were used to retrieve individually those
values are now simplified and call Attribute.
As a result, retrieval of Package Values and Attributes need to be
performed via the View, so as a result GPR2.Project.Pack is now a private
package, and only contains the raw object definition of a Package.
The parser is also reworked to benefit from the attribute computation when
referencing attributes. As a result it now need to work on the view object
rather than trying to build first the lists of variables and attributes
before building the object.
In order for the parser to see the package definition, it has been also
renamed to GPR2.Project.Parser, and GPR2.Parser hierarchy is now removed.
Finally, the GPR2.Project.Attribute object has been improved to include
missing information to fully handle all situations. In particular the
notion of Aliased attributes is now added to it (attributes that have
different names, such as Spec and Specification).
Part of U813-023
Change-Id: Ife12e67035c45f2915050e6550eb7d83d98fede2
Depends-On: Ie49c13da3ef7dbfc5f9b51f863e46b9f0ff9c4d1
This allows for faster retrieval of attributes with the use of containers
manipulating bounded values, as well as simple integer comparisons.
Depends-On: I325abb397527ac72abff4f3bfe315a3a42aad25b
TN: U722-008
Change-Id: Ic56ecb845fb6768d62b5b6c533850c2f58550469
The message level format can be controled for each level (information,
warning, error). It can be either not displayed or with a short or
long version.
Update expected outputs.
For S914-004.
Change-Id: I126463466fd109b5abb9a8354eea55a5099d3cbf
We were passing the name as an Identifier.Object but storing only
the name as a string hence losing the sloc. Furthermore now Name
does return an Identifier.Object.
Change-Id: I51f8c1e8ee872360bfa40f564d42ddfc5d856933
The Name is a Source_Reference.Identifier.Object and the Value
is a Source_Reference.Value.Object. This is needed to be able
to record the source references for values. The API is now also
cleaner, we were passing the Name (as Name_Type) and the corresponding
sloc to each routine. Now the slock for the Name is into the
corresponding object.
This change also support Name and Value for variables and types.
Adapt the code to this new API.
Change-Id: Ica2bd2ab0f4666c58378d7b8b7748b7b58613269
This is needed to pass all arguments coming from a tools (-XVAR=VALUE
for GPRbuild for example) while loading a project. It is needed for
proper semantics of External built-in.
Update regression tests.
Continued work for P113-046.
Change-Id: Iefa2ab2716ff05680a12ac42a6e9a124722bd3b2
We now detect some errors when dealing with sources.
When an error occurs we raise an exception as we do not want errors to
get unnoticed.
Add corresponding regression test.
Part of P113-046.
Change-Id: I3d75d459230867d852a5c720c68be5a470c5782c
Instead of storing the configuration view we directly store the
tree (actually an access to the tree). For this a project tree
object is now limited and is self referenced (Rosen's trick).
The Load routine is now a procedure to comply with the limited
tree object. This permits some clean-up as some routines are not
needed anymore.
Note that the tree will be needed to be able to record error messages
(in the tree's log object) while parsing sources. So this is globally
a clean-up to prepare future work.
The regression tests are adjusted accordingly.
Part of P113-046.
Change-Id: I6f5068a11c2f346d8df8c37b35c6d6b8898e9745
Rework Name_Type support.
A Name_Type is now a type and handled without case-sensitivity. An
Optional_Name_Type is introduced which allows empty value.
The code is changed to take this into account. For example there is
no more need to Less_Case_Insensitive or Equal_Case_Insensitive as the
Name_Type's "=" and "<" operator are already case insensitive.
Part of P113-046.
Change-Id: Ie16e5e7add49a16ffffee2610afafdf7474c8c5c
The new representation allows multiple attribute with the same
name but with different index.
Part of P113-046.
Change-Id: I7566bf69a1b41903b58e63af11c8579a165ea88d