Related articles |
---|
Language translation awgold70@gmail.com (Anthony Williams) (2014-03-05) |
Re: Language translation DrDiettrich1@aol.com (Hans-Peter Diettrich) (2014-03-05) |
Re: Language translation kaz@kylheku.com (Kaz Kylheku) (2014-03-05) |
Re: Language translation jkallup@web.de (Jens Kallup) (2014-03-06) |
Re: Language translation norjaidi.tuah@ubd.edu.bn (Nor Jaidi Tuah) (2014-03-10) |
Re: Language translation awgold70@gmail.com (Anthony Williams) (2014-03-10) |
From: | Jens Kallup <jkallup@web.de> |
Newsgroups: | comp.compilers |
Date: | Thu, 06 Mar 2014 20:31:43 +0100 |
Organization: | 1&1 Internet AG |
References: | 14-03-009 |
Keywords: | OOP, practice, code |
Posted-Date: | 07 Mar 2014 08:08:23 EST |
Hello,
for my compiler, i do some test's.
when i had a class "Aclass", then i check it's parent.
It can be "Acustom", or an other class "Aform".
So, i have 2 types:
Acustom // parent (super)
Aclass // my plain class
Acustom // parent (super)
Aform // form class (window)
Aclass // class -> Aform = parent
You can build a tree:
CLASS Aform // you can leave the parent, if you know it is Acustom
...
ENDCLASS
CLASS Aclass OF Aform
...
ENDCLASS
Then you can build code:
(All classes becomes numbers - you reserve a part
for your static parents...)
push 10 ; push 10 (Aform - if you wish it is a window)
push 0 ; parent (window) class
push CNAME ; rtti - name the class
call create_class ; call function to create the class
; e.g. init window size
The best way is, you should consult the assembler code,
which is created by follpwing command:
gcc -S test.cc
cheers
Jens
Return to the
comp.compilers page.
Search the
comp.compilers archives again.