Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LARA
inox
Commits
fecfef7f
Commit
fecfef7f
authored
8 years ago
by
Nicolas Voirol
Browse files
Options
Downloads
Patches
Plain Diff
Better TreeDeconstructor instantiation system
parent
a2a57136
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/scala/inox/ast/Extractors.scala
+8
-3
8 additions, 3 deletions
src/main/scala/inox/ast/Extractors.scala
src/main/scala/inox/ast/TreeOps.scala
+2
-15
2 additions, 15 deletions
src/main/scala/inox/ast/TreeOps.scala
with
10 additions
and
18 deletions
src/main/scala/inox/ast/Extractors.scala
+
8
−
3
View file @
fecfef7f
...
...
@@ -231,14 +231,19 @@ trait TreeDeconstructor {
* [[TreeDeconstructor]] instance. */
trait
Extractors
{
self
:
Trees
=>
val
d
econstructor
:
TreeDeconstructor
{
def
getD
econstructor
(
that
:
Trees
)
:
TreeDeconstructor
{
val
s:
self.type
val
t:
self
.type
val
t:
that
.type
}
=
new
TreeDeconstructor
{
protected
val
s
:
self.
type
=
self
protected
val
t
:
self
.
type
=
self
protected
val
t
:
that
.
type
=
that
}
val
deconstructor
:
TreeDeconstructor
{
val
s:
self.type
val
t:
self.type
}
=
getDeconstructor
(
self
)
/** Operator Extractor to extract any Expression in a consistent way.
*
* You can match on any Inox Expr, and then get both a Seq[Expr] of
...
...
This diff is collapsed.
Click to expand it.
src/main/scala/inox/ast/TreeOps.scala
+
2
−
15
View file @
fecfef7f
...
...
@@ -12,11 +12,6 @@ trait TreeOps { self: Trees =>
trait
SelfTreeTransformer
extends
TreeTransformer
{
val
s
:
self.
type
=
self
val
t
:
self.
type
=
self
lazy
val
deconstructor
:
TreeDeconstructor
{
val
s:
self.type
val
t:
self.type
}
=
self
.
deconstructor
}
trait
IdentityTreeTransformer
extends
SelfTreeTransformer
{
...
...
@@ -57,10 +52,10 @@ trait TreeTransformer {
val
s
:
Trees
val
t
:
Trees
val
deconstructor
:
TreeDeconstructor
{
lazy
val
deconstructor
:
TreeDeconstructor
{
val
s:
TreeTransformer.this.s.type
val
t:
TreeTransformer.this.t.type
}
}
=
s
.
getDeconstructor
(
t
)
def
transform
(
id
:
Identifier
,
tpe
:
s.Type
)
:
(
Identifier
,
t.Type
)
=
(
id
,
transform
(
tpe
))
...
...
@@ -231,14 +226,6 @@ trait TreeTransformer {
}
=
new
TreeTransformerComposition
{
val
t1
:
TreeTransformer.this.
type
=
TreeTransformer
.
this
val
t2
:
that.
type
=
that
lazy
val
deconstructor
:
TreeDeconstructor
{
val
s:
TreeTransformer.this.s.type
val
t:
that.t.type
}
=
new
TreeDeconstructor
{
protected
val
s
:
TreeTransformer.this.s.
type
=
TreeTransformer
.
this
.
s
protected
val
t
:
that.t.
type
=
that
.
t
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment