our @ISA = qw(Exporter);
our @EXPORT = qw(input stmts stmt automakerule makerule conditional ifblock
optionalelse optionalcond optionalrhs optionalcomments lhs rhs commentlist primaries
-optionlist traverse printgraph);
+optionlist traverse printgraph recursesubdirs);
my $isSubdir = 0 , @subdirnodes = ();
{
my ( $val ) = @_;
my %node = ( name => input, childs => [ $val ] );
- push @{$node -> {childs}}, subdirNode() if $#subdirnodes > -1;
+ push @{$node{childs}}, subdirNode() if $#subdirnodes > -1;
return \%node;
}
}
}
}
+
+# Recurse into sub directories to generate AST
+sub recursesubdirs($)
+{
+ my ($ref) = @_;
+ my %node= %$ref;
+ if( scalar @{ $node{childs} } == 2)
+ {
+ my $subdirRef = $node{childs} -> [1];
+ my %subdirNode = %$subdirRef;
+ foreach $val ( @{ $subdirNode{subdirs} } )
+ {
+ system( "perl -I. Parser.pl $val/Makefile.am > $val/ast.gv" );
+ system( "unflatten -f -l 10 -c 10 -o $val/ast1.gv $val/ast.gv" );
+ system( "dot -Tpng $val/ast1.gv > $val/ast.png" );
+ system( "rm $val/ast.gv $val/ast1.gv" );
+ }
+ }
+}
1;
\ No newline at end of file
-# Process this file with automake to produce Makefile.in
-dist_bin_PROGRAMS = server \
-client
-server_SOURCES = server.c db.c ## Server Files \
-Database Files
-#Comment Testing Here
-#a
-#b
-#c
-#END
-
-SUBDIRS = app app1
-SUBDIRS += app2
-
-client_SOURCES = #Multiline comment \
-Client dependencies
-if installed
-noinst_LIBRARIES = foolib.b
-else
-noinst_LIBRARIES =
-endif
-noinst_LTLIBRARIES = foolib.a
-files_JAVA = a.java b.java
-files_PYTHON = chk.py app.py test.py
-test_SCRIPTS = t1.sh t2.sh
+bin_PROGRAMS = server client
+server_SOURCES = server.c
+client_SOURCES = client.c