Thread: Parsing a C source file.

  1. #1
    char main() RoshanX's Avatar
    Join Date
    Mar 2003
    Posts
    68

    Parsing a C source file.

    I don't know how relavent this question is to this forum. But I thougt you guys might have ideas on what I have to ask. I am trying to develop a tool that will translate all the source code files (C source files) to it's equivalant HTML file(s) in a source tree. In these HTML files, each function call will have a link to it's funtion definition and any variable types will have linkes to it's type defition.

    To do this I have to identify each function definition and variable definition. For this , I have tokenized (I've already written the tokenizer) the source file and try to identify function definition patterns. I am trying to use a state machine. But it seems that this process is difficult. Is there a better way to identify function definitions ?

  2. #2
    char main() RoshanX's Avatar
    Join Date
    Mar 2003
    Posts
    68
    Initially I didn't think that I have to go to that extent (the compiler level). So, I tried to accoplish it without using lex and yacc. But it seems now that It's high time I use it . Thanks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 05:02 AM
  2. Source file inclusion
    By sh3rpa in forum C++ Programming
    Replies: 7
    Last Post: 10-02-2007, 11:10 AM
  3. Basic text file encoder
    By Abda92 in forum C Programming
    Replies: 15
    Last Post: 05-22-2007, 01:19 PM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. Simple File encryption
    By caroundw5h in forum C Programming
    Replies: 2
    Last Post: 10-13-2004, 10:51 PM