Related articles |
---|
Making my first compiler szigetir@gmail.com (2006-09-16) |
Re: Making my first compiler pjb@informatimago.com (Pascal Bourguignon) (2006-09-18) |
Re: Making my first compiler tommy.thorn@gmail.com (Tommy Thorn) (2006-09-18) |
Re: Making my first compiler idknow@gmail.com (idknow@gmail.com) (2006-09-18) |
Re: Making my first compiler torbenm@app-1.diku.dk (2006-09-18) |
Re: Making my first compiler jeffrey.kenton@comcast.net (Jeff Kenton) (2006-09-25) |
Re: Making my first compiler firefly@diku.dk (Peter \Firefly\Lund) (2006-09-25) |
[10 later articles] |
From: | szigetir@gmail.com |
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 |
Hi,
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 ,
eg:
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?
thanks
Roland
szigetir@gmail.com
Return to the
comp.compilers page.
Search the
comp.compilers archives again.