Thread: Need a little help with simple compiler

  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    9

    Need a little help with simple compiler

    Hi guys,

    I'm having a little trouble getting some of my coursework working, basically I'm programming a C compiler (written in C). It only has to compile a very basic program so it's pretty simple.

    Basically I'm a little confused about this line of code:

    lex_init();

    there's no function that shares this name in the program, and it still compile's. Does the _init do something interesting, or is lex_init() a pre-made function?

    and also:

    exit(NOERR);

    This part doesn't work at all, any idea's on what the 'NOERR' is meant to be? (It's just copied from some lecture notes)

    Thanks for any help you can give me,

    Pete C

  2. #2
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    http://en.wikipedia.org/wiki/Lex_programming_tool

    Writing a compiler is certainly no easy task. NOERR is a define, probably resolving to 0 -- stands for "No Error".

  3. #3
    Registered User
    Join Date
    Nov 2008
    Posts
    9
    Thanks for the reply, and the link. The whole thing makes a bit more sense now ^^

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple Socialising Chat Bots
    By bengreenwood in forum C++ Programming
    Replies: 10
    Last Post: 11-28-2007, 08:42 AM
  2. Reading game port with a simple compiler like BuilderX?
    By MaxxMan-X in forum Game Programming
    Replies: 7
    Last Post: 02-27-2005, 11:15 AM
  3. Compiler questions
    By DvdHeijden in forum C++ Programming
    Replies: 6
    Last Post: 01-17-2005, 03:00 PM
  4. Dev C++ Compiler, Indentation?
    By Zeusbwr in forum C++ Programming
    Replies: 3
    Last Post: 10-21-2004, 06:13 AM
  5. lcc win32 compiler download problems
    By GanglyLamb in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 08-01-2004, 07:39 PM