This commit is contained in:
Vitor Santos Costa
2018-04-27 13:01:08 +01:00
parent af848f28aa
commit 1c293a9af4
51 changed files with 4794 additions and 2393 deletions

View File

@@ -5,17 +5,22 @@
:- initialization(main).
:- yap_flag(write_strings,on).
main :-
popen('find . \\( -name \"*.pl\" -o -name \"*.yap\" -o -name \"*.c\" -o -name \"*.h\" -o -name \"*.cpp\" -o -name \"*.hh\" \\) -type f -print | xargs grep \"@defgroup\\|@ingroup\\|@addtogroup\\|@\\{\\|@\\}\"', read, S),
S = popen('./get_comments'),
file_filter_with_start_end( S, user_output, add2graph, initgraph, checkgraph).
initgraph(_,_).
initgraph(_,_) :-
retractall(node(_,_,_,_)),
retractall(edge(_,_,_)),
retractall(e_b_n(_,_,_)).
:- dynamic node/3, edge/3, e_b_n/3.
:- dynamic node/4, edge/3, e_b_n/3.
checkgraph(_,_) :-
e_b_n(F,KN,_C),
node(KF,KN,_),
node(_,KF,KN,_),
add_edge(KF, F, KN),
fail.
checkgraph(_,_) :-
@@ -23,10 +28,12 @@ checkgraph(_,_) :-
listing(edge).
add2graph(Line, _Out) :-
split( Line, "% \t/*:", [File, Job, Name|_]),
append( _, L, Line),
add2graph(Line, _Out) :-
writeln(Line),
split( Line, ":@% \t*", [File, Job, Name|_]),
append(Name, R, L),
append( _, L, Line),
!,
dispatch( Name, File, Job, R).
dispatch( Name, File, "defgroup", Comment):-
@@ -45,20 +52,26 @@ dispatch( Name, File, "ingroup", Comment):-
atom_codes(C, Comment),
add_edge(KF, KN,C).
add_node(F, K,_C) :-
node(_,K,_),
throw( repeat(F:K) ).
node(d,F0,K,_),
!,
throw( repeat(K:F0/F) ).
add_node(F, K,_C) :-
retract(node(d,F1,K,_)),
!,
assert(edge(F,F1,K)),
assert(node(d,F,K,C)).
add_node(F, K,C) :-
assert(node(F,K,C)).
assert(node(d,F,K,C)).
add_node_edge(F, K,_C) :-
node(F1,K,_),
node(_,F1,K,_),
!,
assert(edge(F1,F,K)).
add_node_edge(F, K,C) :-
assert(node(F,K,C)).
assert(node(a,F,K,C)).
add_edge(F, K,_C) :-
node(F1,K,_),
node(_,F1,K,_),
!,
assert(edge(F1,F,K)).
add_edge(F, K,C) :-