Discussion:
[GSoC] Parsing Makefile.am using Abstract Syntax Tree
Vishal Gupta
2018-07-19 11:42:07 UTC
Permalink
Hi,
In regard to my GSoC project [ Branch : experimental/gsoc/ast ] , I
have some queries :

1) cond34.sh [http://git.savannah.gnu.org/cgit/automake.git/tree/t/cond34.sh ]
if TWO
test1_LDADD = two.$(OBJEXT)
test2_LDADD = two.$(OBJEXT)
test2_DEPENDENCIES = $(test2_LDADD) somethingelse.a
else !TWO
test1_LDADD = one.$(OBJEXT)
test2_LDADD = three.$(OBJEXT)
endif !TWO

Meaning of the above conditional statement, specifically why is their
a requirement of condition after else/endif and what should be its
expected value ?

2) The parser which I have implemented assumes that their will be a
newline character before EOF character in Makefile.am . Is this
assumption correct ?

3) SUBDIRS variable stores the subdirectories which are to be built.
This feature is implemented in parser by calling the "system" function
call and changing the input and output files to corresponding
subdirectories. [ system( "perl -I. parser.pl $val/Makefile.am >
$val/ast.gv" ); ]

present working directory:-
|- parser.pl
|- Lexer.pm
|- Tree.pm
|- test.sh
|- t
|- Makefile.am
|- app
|- Makefile.am

t/Makefile.am contents =>
SUBDIRS = app

test.sh file parses Makefile.am present in "t" directory. Executing
test,sh on "t/Makefile.am", the system call for subdirs, as mentioned
above, checks for app directory in "present working directory" instead
of "t" directory. This is the expected behavior because perl is
running from " present working directory " but the app directory is
inside the "t" directory. How to overcome this ? Moving the test.sh
file into "t" directory, "parser.pl" file is unavailable and using
"perl ../parser.pl" for execution, then rest of the modules like
Lexer.pm, Tree.pm are unavailable.


Thanks
Vishal Gupta

Loading...