Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Unified Diff: program.pl

Issue 1259553002: Emit program and dependency information as relations in a Prolog database. Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/common.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: program.pl
diff --git a/program.pl b/program.pl
new file mode 100644
index 0000000000000000000000000000000000000000..13019cdd4e2cf363e52a0b9751665fdc97bbfcd6
--- /dev/null
+++ b/program.pl
@@ -0,0 +1,22 @@
+:- [dart].
+
+contains_trans(X, Y) :- contains(X, Y).
+contains_trans(X, Y) :- contains(X, U), contains_trans(U, Y).
+
+callchain(X, Y, [X, Y]) :- calls(X, Y).
+callchain(X, Z, [X | L1]) :- calls(X, Y), callchain(Y, Z, L1).
+
+name(Id, (Class, Function)) :- function(Id, Function), contains(C, Id), class(C, Class).
+
+can_be_called_from_main(X) :- callchain(main, X, _).
+
+enqueued(Source, Target, [Source, Target]) :- enqueues(Source, Target).
+enqueued(Source, Target, [Source | Rest]) :-
+ enqueues(Source, Intermediate),
+ enqueued(Intermediate, Target, Rest).
+
+why_enqueued(ClassName, FunctionName, Reason) :-
+ class(C, ClassName),
+ function(F, FunctionName),
+ contains(C, F),
+ enqueued(main, F, Reason).
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698