jalilweb.com

You are here: Home arrow University
  • Decrease font size
  • Default font size
  • Increase font size
University
C++: Save Console Output to a File Print E-mail
Written by Jalil   
Thursday, 13 March 2008
The most annoying thing when developing console applications (especially under windows) is when you cannot see the entire output when it is too long for the command line window to handle.

The only way around this is to print the output to a file that you can later open and read. You can usually do this by instantiating an output stream and write to it. But there is a simpler and tidier way to achieve that.

Include this line in your Main function:

std::freopen("output.txt", "w", stdout);

What this function does is that it redirects the standard output stream "cout" to the file you specify in its first argument.

Simple, Tidy and Useful.

Last Updated ( Monday, 14 April 2008 )
 
Parsing VHDL Print E-mail
Written by Jalil   
Wednesday, 28 November 2007

Two months into my PhD now, and I already have an idea of what needs to be done to achieve the ultimate goal! (Not the real goal though)

As part of the system I am creating, I need to create a VHDL parser! This is no trivial task. Simply because everything I read in the internet and in a couple of papers agrees that the VHDL standard BNF specification is an ambigious grammar.

This means that using a parser generator tool like Bison(YACC) is not the safest option. Since Bison resolves reduce/reduce conflicts by choosing to use the rule that appears first in the grammar, it is very risky to rely on this. "According to the Bison manual"

The only way such a parser generator can be usefull is by changing the standard BNF specification in order to eliminate those conflicts. I found a VHDL BNF grammar for YACC that was modified and only produces 3 shift/reduce and 3 reduce/reduce conflicts. This is nice, but I really need to go through the changes one by one trying to spot any unwanted mistakes.

The other way, is to create a parser from scratch. Maybe reuse some parts of the bison generated source code to reduce the time it will take to create a fresh parser.

For the time being.. I have no conclusion to write in this post ! 

Last Updated ( Thursday, 03 April 2008 )
 
Week 1 Print E-mail
Written by Jalil   
Tuesday, 09 October 2007

Today is the second day of my PhD. I already have a desk and ordered a new PC which will arrive in about 20 odd days... I have done most paperwork and met briefly with my supervisor.. we've agreed a meeting early next week.. so that's a very good oportunity for me to finish reading a thesis related to my research and get some technical books from the library. So far so good and off I go to do some reading...

 
<< Start < Prev 1 2 Next > End >>

Results 5 - 7 of 7