In our sixth semester of B-Tech we have a course on Compiler Design. For that two tools are being used: Lex which is a lexical analyzer and Yacc is a parser generator. While compiling the code for the lexical analyzer created by lex and the code for parse created by yacc we require few libraries to include some important function templates into the code. the flags used along with gcc for this purpose are “-ll” and “-lfl”.
After installing Lex/Yacc in my Fedora system few months back, I got an error stating that definition for yywrap is not included. After searching for some time I got the solution for it.
There can be methods to solve it :
- Just include the function yywrap in the lex file in the function definition part(third part of the code).Compiling can be done as “gcc lex.yy.c y.tab.c”
Install flex-static library to use the gcc flag -ll. After this just compile it like “gcc lex.yy.c y.tab.c -ll”.
But later I changed to Arch Linux, after 1 year of using Fedora.
But in Arch when I tryed to compile the lex/yacc file initially the same problem arised. I thought I could solve it the same way as before. All the researches I had done was in vain. I couldn’t find a package similar to flex-static anywhere. At that point of time I used the first option, which easily solved my problem.
If anyone could help in finding a package similar to flex-static in Arch Linux, please share.
New link can be found at abijith-kp.github.io
A compromise is the art of dividing a cake in such a way that everyone believes he has the biggest piece – Ludwig Erhard
After studying Software engineering for my second internals and not understanding anything (meant what to write in the exams… :P), found this quote in the text book….
Untill the git session at Fossmeet 2013 at NITC, I was using git only as a method/tool to upload my code into Github. That particular session by Mr.Noufal Ibrahim really changed my views on usage of git. The word particular was added only because of the satisfaction I that got after attending that workshop.
Me and one of friend Krispin were attending the programme together. Actually gt was the only version control system used by us till date(just heard few names like subversion, mericurial etc). For pushing code into Github repository we only require few commands like add, commit, push and very rarely I used commands like pull. When we first used the branching technique in git, we got really amazed.
In reality I was searching for the file that I created for one branch, when I couldn’t find it in the other. Once I have heard one of seniors tell his friend that all code are maintained using git. Actually I didn’t get why he was wasting his time with all these stuffs. But that session was the point were I really got point on why people use version control system.
We have a compiler lab for this semester and I could have saved a lt of time if I had used git. Whenever I changed the code I make of copy of it and edit the copy only, and since i have a habit of changing the code very often, I had may copies of the same file with only a small difference in them or sometimes nothing.
Now the next thing on the list list would be to study the internals and some advanced topics in git. (well before the Fossmeet itself I had tried to learn git by myself, many times. And all those tries resulted in nothing. But this time it would be different.For sure…. :))