Making my first compiler
16 Sep 2006 15:58:17 -0400

          From comp.compilers

Related articles
Making my first compiler (2006-09-16)
Re: Making my first compiler (Pascal Bourguignon) (2006-09-18)
Re: Making my first compiler (Tommy Thorn) (2006-09-18)
Re: Making my first compiler ( (2006-09-18)
Re: Making my first compiler (2006-09-18)
Re: Making my first compiler (Jeff Kenton) (2006-09-25)
Re: Making my first compiler (Peter \Firefly\Lund) (2006-09-25)
[10 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
Date: 16 Sep 2006 15:58:17 -0400
Organization: Compilers Central
Keywords: question
Posted-Date: 16 Sep 2006 15:58:17 EDT


I'm trying to create a pascal subset interpreter/compiler.

Do I HAVE to create a syntax tree? Or can I go straight to creating
Intermediate Code (Quadruples) in Yacc's reduce actions?

Say I have a generic paramater_list (for function definitions) in BNF ,

paramater_list: paramater_list paramater

In Yacc, would this be connected together as a linked-list?
paramater_list: paramater_list paramater { $$ = make_paramater($2);
$$->next = $1; }
| paramater { $$ = make_paramater($1); }

What's a basic structure for a syntax tree in C?

Say I want my compiler to convert Pascal code to C code, which steps
are absolutely necessary to do this correctly?
Im thinking:
Build Syntax Tree -> Convert it to Three Address Code (Quadruples) ->
then into C
Was this correct?



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.