Commit Graph

1390 Commits

Author SHA1 Message Date
Raphael Amiard
e25fc9e153 PB03-023: Fix adalog tests
Change-Id: Ifeb3ccb8042c6f327b67b5c74e0aa70e6d7515d1
2016-11-10 10:56:06 +01:00
Pierre-Marie de Rodat
659e452a7d Revamp the AST debug dumpers
... so that their outputs provides a more readable description of null
nodes and lists, in particular it displays as much information for lists
as for other AST nodes.

Change-Id: Ib615fb70bd6a1fd9a5f0fa9b473cbc445d51abcb
TN: PA21-020
2016-11-09 17:29:55 +01:00
Pierre-Marie de Rodat
ed64967509 Ada list templates: remove an useless access type declaration
Change-Id: If33671394172fbe9dcc0b7a202dd2904b2ea8b4c
TN: PA21-020
2016-11-09 16:39:57 +01:00
Pierre-Marie de Rodat
df6266b80d First attempt at removing manual str interpolation for value type name
This is a cleanup since it centralizes the logic to create a value type
name for AST node types in one single place.

Change-Id: I1c32c9ef0874925d3477e3aae4acc5de8b9ccdb2
TN: PA21-020
2016-11-09 16:38:16 +01:00
Pierre-Marie de Rodat
42c175137b Harmonize list type names between the DSL and the generated library
There is a discrepancy between various parts of Langkit for the name
given to root list types: ListFoo, FooList, FooListType, ... This commit
attempts to unify them into FooList.

Change-Id: I11276fd28963e20ede5bee1199869d06903a1112
TN: PA21-020
2016-11-09 16:22:58 +01:00
Pierre-Marie de Rodat
2ed140daeb Remove an obsolete (and wrong) comment
Change-Id: Ic4a7bac8faa1df36c1957ccde90770e469bf7a03
TN: PA21-020
2016-11-09 16:07:41 +01:00
Pierre-Marie de Rodat
096fd7df0a Make it possible for root list types to be abstract
Users can choose whether automatically generated "root list types" are
abstract. This makes it possible to make abstract AST node types that we
know are never instantiated.

Change-Id: Id3cbfcab9523f4d87aa3acf8ec32188776c94d3a
TN: PA21-020
2016-11-09 16:03:08 +01:00
Pierre-Marie de Rodat
8a143f6a67 Minor reformatting
Change-Id: Id7bef14adaeedbd70b8b2427d036b2aabd1e3fcb
TN: minor
2016-11-09 16:03:08 +01:00
Pierre-Marie de Rodat
99ec4c4323 Introduce an abstract AST node derived type for all AST lists
This will make it possible for users have only one implementation to
handle all lists.

Change-Id: Icd5b2c964278f751f34270472fca1990dee0cec6
TN: PA21-020
2016-11-09 16:03:08 +01:00
Pierre-Marie de Rodat
b158073248 Remove the legacy $_List AST node kind
Now that all concrete AST lists have their own concrete kind, this
$_List kind is unused. Better remove it.

Change-Id: I1022b93b06a63b36fb8f6613be9ea134480eea95
TN: PA21-020
2016-11-09 16:03:08 +01:00
Raphael Amiard
248019c433 PB03-023: Allowing conv_prop to be null in bind generation
Change-Id: Ic2e4b99df5e7d9d64539c11f6ebbd9093c850431
2016-11-09 15:16:35 +01:00
Raphael Amiard
fdf209435b PB03-023: Decouple logic binder and converter generation
Change-Id: I9b601f4eaa6a31e7be9bbe88f76257f1606f6c49
2016-11-09 15:16:04 +01:00
Raphael Amiard
177b27e44b PB03-023: Bind instantiates full unify
Change-Id: I237a5b838779d404b1e75f28708f3042c27f12b6
2016-11-09 12:48:06 +01:00
Raphael Amiard
1b64a78fab PB03-023: Introduce PropertyDef.uid and use it for binder identity
Change-Id: I1f0389d95ff4b45e3679dfbbd4072b15b3ae28cd
2016-11-09 12:48:00 +01:00
Raphael Amiard
b161998064 PB03-023: Move generation of logic binders on the context
The identity is still determined by the property, but this will allow to
have a logic binder with a null conversion property.

Change-Id: I94dfea8ccacac49cf64712eeb42c0a0a3d56db37
2016-11-09 12:42:11 +01:00
Raphael Amiard
05dda976bc PB03-023: Generalize bind behavior
From taking two Equations operands to taking any kind of expression that
is an equation of a node type.

Change-Id: I1bbd05a62f92db3c719a24b0f0456d817bf4d192
2016-11-09 12:17:53 +01:00
Raphael Amiard
4f4578ea6b PB03-023: Adalog - allow general custom unify with convert
Also get rid of the "=" operators for logic equations. Calling a
function is clearer.

Change-Id: Ieea4556cf6240fa8bcfd797d7180a931d855c6ce
2016-11-09 11:40:55 +01:00
Raphael Amiard
f6f5f9de6d Minor: remove erroneous assert
Change-Id: I3ccb298e26b2e5775169aaf745e9e880dbd1cf43
2016-11-08 19:13:28 +01:00
Raphael Amiard
0acda03b53 PB08-014: Opt uses Pick rt. Row when passed several parsers
Change-Id: I88fad589d4d959d31d572cc2cb6d13d6ace11feb
2016-11-08 19:13:28 +01:00
Raphael Amiard
7b31a3559e PB08-014: List parser can take a list of sub-parsers
In that case, they'll be wrapped in a `Pick` parser.

Change-Id: I201306991f6ba6cd56324a9c2d8314128a30ceb3
2016-11-08 19:13:28 +01:00
Raphael Amiard
bda57df5da PB08-014: Add Pick utility parser
Change-Id: I6755a1753bd5312620cdcbf92b4d332a57e2037f
2016-11-08 19:06:14 +01:00
Raphael Amiard
8372a01b2c PB08-014: Shorter parsing forms based on node instantiations.
Change-Id: I6909237b6fa85d73d6731d4bfadd22c86144ca1a
2016-11-08 18:54:50 +01:00
Pierre-Marie de Rodat
9a29c85097 Allow users to subclass ASTNode.list_type()
This will allow users to attach properties to lists themselves and thus
avoid patterns like:

    class ItemList(BaseNode):
        items = Field(type=Item.list_type())

        my_property = Property(...)

Also enhance the List parser so that users can provide a specific list
subclass to use to hold the parsing result.

Change-Id: I3ee57d27095951f5480ae35c90ef569be4bc2ed6
TN: PA21-020
2016-11-08 14:07:35 +01:00
Pierre-Marie de Rodat
bb3e04e624 Parsers templates: disable warnings for unreferenced Bump_Ptr instances
Change-Id: Ib36198dcdd3ea682413abebfd5d1e9136a85b215
TN: PB07-025
2016-11-08 14:00:09 +01:00
Pierre-Marie de Rodat
f222babdfa Use specific kinds for AST lists in the Python API
Change-Id: Ia48dba3db901e31bcc3245f793cde440fe99b69e
TN: PA21-020
2016-11-08 13:38:40 +01:00