Little Class Preprocessor Released

Developed or developing a new product in PureBasic? Tell the world about it.
Chrono Syndrome
Enthusiast
Enthusiast
Posts: 169
Joined: Thu Oct 05, 2006 6:44 am
Contact:

Post by Chrono Syndrome »

Any progress :( ?
Don't try to catch ze Night !
Remember: 'z' is better zen 'th' =) !
Sorry for bad english.
User avatar
bembulak
Enthusiast
Enthusiast
Posts: 575
Joined: Mon Mar 06, 2006 3:53 pm
Location: Austria

Post by bembulak »

2 small questions:

which IDE do you all use and
any chance to get it working on Linux!? :D

(great work btw)
cheers,

bembulak
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

I know this thread is a little old, not too old though. I just saw it today. Wanted to say thank you very much.
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

Ups, just saw that, sorry...

@Chrono Syndrome:
Didn't work on it in a looong time because there was actually no feedback at all, pretty disappointing.
But hey, it's ok.
What do you mean by progress? What do you miss?


@bembulak
Well it's coded in PureBasic, so if instead of RAedit the build in EditorGadget would be used, and every API command would be wrapped into a "compiler if", then yes it could be compiled for Linux.
Actually the GUI could be totally stripped out, but my first intention was to make a small editor out of it with proper syntax highliting.


@SFSxOI
You are welcome.


Just took a look at the code again, it was last September when I touched it. :oops:
Pantcho!!
Enthusiast
Enthusiast
Posts: 538
Joined: Tue Feb 24, 2004 3:43 am
Location: Israel
Contact:

Post by Pantcho!! »

nice one!
Looks good.

i think what Chrono meant for progress is the IDE and other well known PB keywords such as for user librarys and etc.
If this can be implment in a mini JaPBe editor that will be a blast!
Chrono Syndrome
Enthusiast
Enthusiast
Posts: 169
Joined: Thu Oct 05, 2006 6:44 am
Contact:

Post by Chrono Syndrome »

@fsw:
Take a look at: http://blitz.pp.ru/forum/attachment.php ... stid=17785

I want something like this, but better: with properties and static methods ;) .
Don't try to catch ze Night !
Remember: 'z' is better zen 'th' =) !
Sorry for bad english.
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

Pantcho!! wrote:nice one!
Looks good.
Thank you.
Pantcho!! wrote:i think what Chrono meant for progress is the IDE and other well known PB keywords such as for user librarys and etc.
If this can be implment in a mini JaPBe editor that will be a blast!
This was my intention, only because no user keywords can be added to the PB-Editor.
But first there was no user feedback, second a bug with properties and strings that isn't fixed as of now (to make private methods), third all the negative bashing about PureBasic and OOP here on the forum.

And somewhere I read coding should be fun...
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

Chrono Syndrome wrote:@fsw:
Take a look at: http://blitz.pp.ru/forum/attachment.php ... stid=17785

I want something like this, but better: with properties and static methods ;) .
Will take a look at it :)
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

Hey, FSW. :)

That's a cool tool (I know, I said it already. But I wanted to give a feedback in your tools homethread.).
I were very interested for a further developed version.

My wishes for a next version.

- Preprocessing per commandline. (useful as IDE-Tool.)
- Compiling after preprocessing.
- Selectable Class-Templates (for individual OOP-Style)


Best regards

Wolf
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

Hroudtwolf wrote:Hey, FSW. :)
That's a cool tool (I know, I said it already. But I wanted to give a feedback in your tools homethread.).
Thank you very much.

Hroudtwolf wrote: I were very interested for a further developed version.

My wishes for a next version.

- Preprocessing per commandline. (useful as IDE-Tool.)
- Compiling after preprocessing.
- Selectable Class-Templates (for individual OOP-Style)
These are all good ideas.

I wanted to create a small editor to get the proper Keywords hiliting.
But I got side tracked with other programming languages...

If there would be a PB editor where keywords can be added than it would be obsolete. I asked Freak once if this is possible for the future but his answer was: "It's not planned".

Preprocessing per commandline would be possible in a snap, but then there would be no syntax hiliting (well for now LCP is not usable as editor either...).

Compiling after preprocessing would be cool.

For implementing selectable class templates (for individual OOP-Style) inside LCP I would have to know about the different coding styles.

Or do you mean the user should be able to create these templates and LCP should react accordingly. This would be a lot of work.


Thanks again for your input, every feedback is truly appreciated, and motivating. (If you don't believe me ask FangBeast)
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

Preprocessing per commandline would be possible in a snap, but then there would be no syntax hiliting (well for now LCP is not usable as editor either...).
Hey, the most of the freaks here in the community was developed on the good old bread box (c64). There wasn't any syntaxhighlighting. :D
I think we would bear that without sh. ;-)


Or do you mean the user should be able to create these templates and LCP should react accordingly. This would be a lot of work.
Yes, exactly.
But that isn't the most important.


According to my opinion would be "preprocessing per commandline" the most important feature.
'Cause it would be fewer exertion to work OOP.
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

I'm just now getting a chance to try this out on an actual project. I have a question; The '->' and 'This', are these the same as used in C++ or C#?
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

SFSxOI wrote:I'm just now getting a chance to try this out on an actual project. I have a question; The '->' and 'This', are these the same as used in C++ or C#?
"->" is used to access the object property
"This" is used for the object address pointer

Look at the examples, it should show you how to use them.
There is also a minimalistic doc file.

Thank you for trying it out.
Leonhard
User
User
Posts: 55
Joined: Fri Jun 16, 2006 7:43 am

Post by Leonhard »

Super!

A few ask, I would still have:
- why is C++ Borland-syntax here uses become? The methods should be in the class.
- gives it to also modifier later?
- can Can one use several Basic-classes?

I found this is a good syntax:

Code: Select all

;{ CBasic
Class Abstract CBasic ; the class cannot using with 'NewObject'
  Public
    Method CBasic()
      *this\String = ?CBasic::MySection
    EndMethod
    Method ~CBasic()
      ; call by free the class
    EndMethod
    
    *String.s{255} ;/ public-variablen
  Private
    Method.l Method1()
      MethodReturn *this\InternMethod()
    EndMethod
  Protected ; only using in this class
    Method.l InternMethod()
      ProcedureReturn @CBasic::InternMethod()
    EndMethod
  Global ; this modifier is for all objects
    DataSection MySection
      Data.s "MyString"
    EndDataSection
EndClass

Procedure CBasic::CBasic()
  *this\String = ?CBasic::MySection
EndProcedure
;}

;{ CBasic2
Class CBasic2
  Public
    Fixed Public lValue.l ; can´t change this variable at the 'Public'-even
EndClass
;}

;{ CClass
Class Sealed CClass Extends Public CBasic, Private CBasic2
  Public
    Method CClass(lParameter.l)
      Debug "create class with parameter"
    EndMethod
  Public
    Method GetValue.l()
      MethodReturn *this\lValue ; return an extends variable
    EndMethod
EndClass
;}

Define NewObject *obj.CClass(104)

*obj\String = "Hallo"

Debug *obj\Method1()

FreeObject *obj
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

Leonhard wrote:Super!
Thanks.
Leonhard wrote:A few ask, I would still have:
- why is C++ Borland-syntax here uses become? The methods should be in the class.
Why should it be in the class?
Both ways are common in different programming languages.
I decided for a C++/Java one.

The benefit for the way I went would be more visible when static libraries are compiled, because if you compile method by method to a object file the resulting exe stays as small as possible because the not used methods are not linked to.
Wait, Purebasic can't compile static libraries...

Ok, forget that.
Leonhard wrote:- gives it to also modifier later?
Suppose english is not your native language.
Sorry, don't know what you mean with this one.
Leonhard wrote: - can Can one use several Basic-classes?
Not at the same time.
Look at the doc and you see how extends is used.
Leonhard wrote: I found this is a good syntax:

Code: Select all

;{ CBasic
Class Abstract CBasic ; the class cannot using with 'NewObject'
  Public
    Method CBasic()
      *this\String = ?CBasic::MySection
    EndMethod
    Method ~CBasic()
      ; call by free the class
    EndMethod
    
    *String.s{255} ;/ public-variablen
  Private
    Method.l Method1()
      MethodReturn *this\InternMethod()
    EndMethod
  Protected ; only using in this class
    Method.l InternMethod()
      ProcedureReturn @CBasic::InternMethod()
    EndMethod
  Global ; this modifier is for all objects
    DataSection MySection
      Data.s "MyString"
    EndDataSection
EndClass

Procedure CBasic::CBasic()
  *this\String = ?CBasic::MySection
EndProcedure
;}

;{ CBasic2
Class CBasic2
  Public
    Fixed Public lValue.l ; can´t change this variable at the 'Public'-even
EndClass
;}

;{ CClass
Class Sealed CClass Extends Public CBasic, Private CBasic2
  Public
    Method CClass(lParameter.l)
      Debug "create class with parameter"
    EndMethod
  Public
    Method GetValue.l()
      MethodReturn *this\lValue ; return an extends variable
    EndMethod
EndClass
;}

Define NewObject *obj.CClass(104)

*obj\String = "Hallo"

Debug *obj\Method1()

FreeObject *obj

And the benefit is?
Post Reply