/* F90 program symbol/call tree lister */ %{ int Lno; char *currentFile; %} %union { int LineNo; char *symbolName; } %token OTHER %token NAME %token SUBROUTINE %token EXTERNAL %token CALL %token NAMELIST %token FSLASH %token CPP_IFDEF %token CPP_IFNDEF %token CPP_DEFINE %token CPP_UNDEF %token CPP_ELIF %token CPP_IF %type call %% input: /* empty */ | input NAME {noteVariable($2,Lno,currentFile);} | input SUBROUTINE NAME {noteProcDef($3,Lno,currentFile); } | input call NAME {noteProcCall($3,Lno,currentFile);} | input EXTERNAL NAME {noteExtDef($3,Lno,currentFile); } | input NAMELIST FSLASH NAME FSLASH {noteInNameList($4,Lno,currentFile); } | input CPP_IFDEF {noteInIfdef(); } | input CPP_IFNDEF {noteInIfdef(); } | input CPP_DEFINE {noteInIfdef(); } | input CPP_UNDEF {noteInIfdef(); } | input CPP_ELIF {noteInIfdef(); } | input CPP_IF {noteInIfdef(); } | input FSLASH | input OTHER | input error { yyerrok; } ; call: CALL { $$ = $1; } ; %%