Tag Archives: lex

Date Extractor using lex and yacc

I have been fiddling with lex and yacc since my last semester course – Compiler Design. I even posted an assignment  here where we built a SQL Syntax Checker.

This semester, I opted for Information Retrieval as one of my Elective. Its an awesome subject so far even though I’m unaware of half the things taught in class! :\

Anyway, our first assignment was to build a program that would extract different formats of date from a file. I used lex and yacc to build the program. The program extracts date in various formats including dates with delimiters and words. You can check the complete code here in github. Its a small but certainly a powerful program. If you want any help in the code, you can always ping me. :)

’til then

Tagged , , ,

‘QCompiler’ – SQL Syntax Checker using lex and yacc

As the name suggests, QCompiler is an SQL Syntax Checker that was build using lex and yacc. I made this in my Compiler Design Class and in ONE NIGHT! It wasn’t the best of experience but I managed to complete the mini-project with satisfactory result. The QCompiler will accept SQL Syntax embedded in html and check for any sql syntax error and also suggest proper correction.

The lex and yacc basically covers most of the SQL Commands like INSERT, DELETE, UPDATE, SELECT, GROUP BY etc. It provides the exact error like table name missing, keyword missing, variable missing, lots of parameters, keyword incorrect etc.

I have pushed the codes in my GITHUB. Be sure to check it out.

Thanks.

’til then.

Tagged , , ,