Hi, I am working on a project building a scanner based on Lex and Yacc. I have added "gettimeoftheday" function to display total scanning times, now i want to find a way to print the line numbers in the terminal.plz if anyone can help me in this.Here is my yacc file......Its a bit long.You can go to line 573 to 588 to check for the C functions. %{ #include<stdio.h> #include<stdlib.h> #include<string.h> #include"safelib.h" #include<sys/time.h> FILE *outFile_p; FILE *outFile_p1; extern FILE *yyin; int counter=0; int pointer[500]; int pointer2; char *temp[500]; char *temp2; int i=0; extern "C" { int yylex(void); int yyparse(void); void …

Member Avatar
+0 forum 0

Hi friends, I need to make a simple parser for parsing PHP files (classes, functions et al) and I have read both Flex and Bison manual. I have read somewhere that I must build Abstract Syntax Tree (AST) and utilize that. But I cannot find any tutorial on how to make AST with Bison Please help me with a link or explanations. Thanks!

Member Avatar
Member Avatar
+0 forum 5

The End.