Interpreter.. Where to start? [Compiler]

This is a discussion on Interpreter.. Where to start? [Compiler] within the General Discussions forums, part of the Community Boards category; So we are to create a compiler for our own programming language. We now have a scanner, and parser. Now, ...

  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    64

    Interpreter.. Where to start? [Compiler]

    So we are to create a compiler for our own programming language. We now have a scanner, and parser.

    Now, I don't know where to start for the interpreter. Can anyone here help me give me some head start. I'm google it but can't find any specifics.

    Thank you,
    sarah22

  2. #2
    and the hat of copycat stevesmithx's Avatar
    Join Date
    Sep 2007
    Posts
    489
    Have you gone through the dragon book?
    Let's Build a Compiler looks like an interesting non technical read but it's a bit dated though.
    Not everything that can be counted counts, and not everything that counts can be counted
    - Albert Einstein.


    No programming language is perfect. There is not even a single best language; there are only languages well suited or perhaps poorly suited for particular purposes.
    - Herbert Mayer

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    64
    I can't find anyway on how to interpret a code after the parser successfully check the grammar. The sample on the book is so simple. Mine has a code like C. or maybe I miss anything?

    Ex:
    int i = 2*3;
    int j = i*2;

    so how the hell I'll tell my interpreter those? and updating my symbol table manager.

    The tokens has this
    int <- datatype
    i <- identifier
    = <- assignment
    2 <- numeric
    * <- multiply
    3 <- numeric
    ;
    int <- dataype
    j <- identifier
    = <- assignment
    i <- identifier
    * <- multiply
    2 <- numeric
    ;

    Thank you,
    Sarah

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,340
    Well you could try reading part2 of the tutorial that was posted a week ago.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to start
    By iprecious in forum General Discussions
    Replies: 4
    Last Post: 04-10-2010, 07:32 PM
  2. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 08:35 AM
  3. Adventures in labyrinth generation.
    By guesst in forum Game Programming
    Replies: 8
    Last Post: 10-12-2008, 01:30 PM
  4. C++ gui for windows where to start
    By prixone in forum Windows Programming
    Replies: 2
    Last Post: 12-16-2006, 10:48 PM
  5. GNOME Desktop won't start (Mandriva)
    By psychopath in forum Tech Board
    Replies: 10
    Last Post: 07-19-2006, 01:21 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21