Shop OBEX P1 Docs P2 Docs Learn Events
mcc: Preprocessor-based conditional compilation and macros - anybody >>really<< — Parallax Forums

mcc: Preprocessor-based conditional compilation and macros - anybody >>really<<

hammerhead74000hammerhead74000 Posts: 58
edited 2006-07-31 01:12 in General Discussion
OK - I've added a bunch of features to mcc; and one of them is inline functions with input variable aliasing.... which is making me wonder about the utility of a preprocessor; especially given that you can string multiple modules together to get an integrated compile (also, no forward declaration of globals & vdx variables is required in mcc). What I'm thinking right now is that inlines would take the place of macros; the symbolic constants in mcc (const foo = 123[noparse];)[/noparse] and llasm (foo: equ 123[noparse];)[/noparse] would take the place of #define; and the effect of conditional compilation could be achieved by switching out the modules used in any given compile cycle (perhaps by using multiple targets in the IDE?).

Anybody have any thoughts on the matter?


Warnings? nono.gif


Ideas? idea.gif


Rotten tomatos? rolleyes.gif






smile.gif

Post Edited (hammerhead74000) : 7/29/2006 7:58:51 AM GMT

Comments

  • Kevin WoodKevin Wood Posts: 1,266
    edited 2006-07-29 19:58
    What is mcc?
  • hammerhead74000hammerhead74000 Posts: 58
    edited 2006-07-29 23:15
    It's the compiler that I'm working on...

    The current feature list includes:
    Hybrid Syntax inspired by C and Pascal
    Module Init Routines
    Virtual Device eXtension
    Inline Functions with input-variable aliasing
    Strings & Lookup tables
    C-style logical operations and non-zero truth testing
    Statement types:
    -- Expression
    -- If/else
    -- While
    -- Repeat ... While
    -- Setbit & Clearbit
    -- Assembler-code block
    Smart codegen with redundant instruction suppression
    Cross-platform-portable Compiler and Assembler
    OS X IDE

    Additional things I'm working on include a switch statement; a pause statement; strings and lookup tables; and the SX-Key plugin for the IDE.
  • James NewtonJames Newton Posts: 329
    edited 2006-07-30 18:40
    I like macros. I think you could build an entire language given a good enough macro pre-processor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ---
    James Newton, Host of SXList.com
    james at sxlist,com 1-619-652-0593 fax:1-208-279-8767
    SX FAQ / Code / Tutorials / Documentation:
    http://www.sxlist.com Pick faster!



  • hammerhead74000hammerhead74000 Posts: 58
    edited 2006-07-31 01:12
    Hmm... OK. Is nesting a requirement?
Sign In or Register to comment.