Re: [cc65] C Compiler Semantic Analysis

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2006-01-16 22:37:52
Hi!

On Mon, Jan 16, 2006 at 06:40:28AM -0800, Payton Byrd wrote:
> I haven't dug into the code for CC65, so this is more of a general
> question. Does CC65 has a generic rules engine that it uses to interpret
> the C grammar, or is the semantic analysis done with hard-coded functions?

The compiler uses a hardcoded recursive descent parser.

> I've been doing some reading on compiler design for the 64/128 and was
> wondering if the CC65 framework would be a good starting point to create a
> BASIC compiler.  BASIC and C are so different from a grammatical
> standpoint that I don't think a hard-coded semantic analysis would offer
> much reuse. I'm sure I could do sometime with YACC, but was hoping to be
> able to reuse the assembly generation already existing in CC65.

The problem I have with scanner and parser generators is that they do only
offer help with the easiest part of writing a compiler. On the other side,
lex/yacc aren't readily available on some machines (windows comes to mind), so
using them will push the margin for anyone trying to compile the software.

Anyway, I don't think that parts of cc65 cannot be reused for a BASIC compiler
without much work.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Jan 16 22:38:09 2006

This archive was generated by hypermail 2.1.8 : 2006-01-16 22:38:13 CET