Little Class Preprocessor Released
Little Class Preprocessor Released
OK, here it is... finally.
For PB users that don't know what it is:
LCP is a preprocessor and adds 4 keywords to PureBasic:
Class, EndClass, New and This.
Grab it here:
http://fsw.pb.home.comcast.net/lcp.0v82.zip
Some examples are included.
If you find bugs or have suggestions please post them here.
Take care
For PB users that don't know what it is:
LCP is a preprocessor and adds 4 keywords to PureBasic:
Class, EndClass, New and This.
Grab it here:
http://fsw.pb.home.comcast.net/lcp.0v82.zip
Some examples are included.
If you find bugs or have suggestions please post them here.
Take care
thanks fsw, good work!
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

I just processed the example file "test.opb" and got an error when compiling the "test.pb" output file, on this line:
because the procedure is defined to return a string:
Eric
Code: Select all
ProcedureReturn ReadFile_ ( hFile , pBuffer , NumBytes , pBytesRead , 0 ) ! 1
Code: Select all
Procedure.s MyClass_My2ndMethod(*THIS.MyClass_Properties_)
Suppose you are refering to test_!.pb...ebs wrote:I just processed the example file "test.opb" and got an error when compiling the "test.pb" output file, on this line:because the procedure is defined to return a string:Code: Select all
ProcedureReturn ReadFile_ ( hFile , pBuffer , NumBytes , pBytesRead , 0 ) ! 1
EricCode: Select all
Procedure.s MyClass_My2ndMethod(*THIS.MyClass_Properties_)
Thank you for your input, as this file has actually no use for you guys/gals.
It's in the zip file by mistake, my mistake.
This file is not intendet to be compiled, as you can see there is no class declaration... nothing except a procedure with "!" used in 2 different ways.
The intention was to make the preprocessor intelligent enough to understand if the "!" referes to ASM code or not.
This file is now deleted in the 0v82 zip file.
Thanks again.
-
- Enthusiast
- Posts: 468
- Joined: Sat Dec 20, 2003 6:19 pm
- Location: Switzerland
No - I am referring to the file "test.opb", which has this procedure at the end:Suppose you are refering to test_!.pb...
Code: Select all
Procedure.s MyClass::My2ndMethod()
If *THIS->My1stProperty
*THIS->My2ndProperty = "My1stProperty is set to: " + Str(*THIS->My1stProperty)
ProcedureReturn *THIS->My2ndProperty
Else
*THIS->My2ndProperty = "My1stProperty is not set"
EndIf
*THIS->ProcAddr = @Test()
Debug *THIS->ProcAddr
ProcedureReturn ReadFile_(hFile, pBuffer, NumBytes, pBytesRead, 0) ! 1
EndProcedure
Hi fsw,
thanks for all your efforts, but your License makes it (still
) useless to me.
Please do think about some paragraphs as for instance it shouldnt be a must to report u if I would use that nice plugin when writing code.

thanks for all your efforts, but your License makes it (still

Please do think about some paragraphs as for instance it shouldnt be a must to report u if I would use that nice plugin when writing code.
No offense, but could you think about it again ...License wrote: For the creation of commercial applications: you can test this software but you need to notify me if you want to use this software. If you use it to create and sell commercial applications you have to contact me at: fsw DOT pb AT comcast DOT net
Again: You cannot use this software for the creation of commercial applications without my consent.

Check out OOP support for PB here!
UPSebs wrote:No - I am referring to the file "test.opb", which has this procedure at the end:Suppose you are refering to test_!.pb...EricCode: Select all
Procedure.s MyClass::My2ndMethod() If *THIS->My1stProperty *THIS->My2ndProperty = "My1stProperty is set to: " + Str(*THIS->My1stProperty) ProcedureReturn *THIS->My2ndProperty Else *THIS->My2ndProperty = "My1stProperty is not set" EndIf *THIS->ProcAddr = @Test() Debug *THIS->ProcAddr ProcedureReturn ReadFile_(hFile, pBuffer, NumBytes, pBytesRead, 0) ! 1 EndProcedure

Please change:
Code: Select all
ProcedureReturn ReadFile_(hFile, pBuffer, NumBytes, pBytesRead, 0) ! 1
Code: Select all
ProcedureReturn "0"
Sorry for the inconvenience.
ZIP file is changed accordingly.
Thanks ebs.

What do you dislike about it?inc. wrote:Hi fsw,
thanks for all your efforts, but your License makes it (still) useless to me.
Please do think about some paragraphs as for instance it shouldnt be a must to report u if I would use that nice plugin when writing code.
No offense, but could you think about it again ...License wrote: For the creation of commercial applications: you can test this software but you need to notify me if you want to use this software. If you use it to create and sell commercial applications you have to contact me at: fsw DOT pb AT comcast DOT net
Again: You cannot use this software for the creation of commercial applications without my consent.
Is it too much to ask to send an e-mail?
Sending an e-mail is not needed while testing, only if you use it for production of commercial applications.
Its at least quite uncommon thats all.
Im also not forced to email Gnozal or GPI if I enjoy their great efforts on JaPBe when using it for Coding
Remi Meier also doesnt wants you to email and ask him if u use his lexer in your parser.
But its your decision, so no big issue, it was just a *hint* to think about it and I gave my statement as I do respect licenses, so thats all.
Im also not forced to email Gnozal or GPI if I enjoy their great efforts on JaPBe when using it for Coding

Remi Meier also doesnt wants you to email and ask him if u use his lexer in your parser.
But its your decision, so no big issue, it was just a *hint* to think about it and I gave my statement as I do respect licenses, so thats all.
Check out OOP support for PB here!
Thank you for your input.
Because you mention Remi Meier: As soon as he wants a copy of the modified lexer I will give it to him; no question about it.
BTW: the ratio of the code (without gui) is:
lexer 33%
parser 65%
bugs 2% (hopefully less...)
The parser code is double in size, but supposedly only because Remi Meier's code is cool and efficient and his coding skills are lightyears ahead compared with my coding skills.
Because you mention Remi Meier: As soon as he wants a copy of the modified lexer I will give it to him; no question about it.
BTW: the ratio of the code (without gui) is:
lexer 33%
parser 65%
bugs 2% (hopefully less...)
The parser code is double in size, but supposedly only because Remi Meier's code is cool and efficient and his coding skills are lightyears ahead compared with my coding skills.
-
- Enthusiast
- Posts: 468
- Joined: Sat Dec 20, 2003 6:19 pm
- Location: Switzerland
Thanks, as long as we find no bugs, I don't need it at the momentAs soon as he wants a copy of the modified lexer I will give it to him; no question about it.

Don't exaggerate! I didn't have to write the hard partonly because Remi Meier's code is cool and efficient and his coding skills are lightyears ahead compared with my coding skills.

And btw: The next will be the delete keyword, right?

Athlon64 3700+, 1024MB Ram, Radeon X1600
You catched me wrong, I didn't want to tease by mention the Lexer approachBecause you mention Remi Meier: As soon as he wants a copy of the modified lexer I will give it to him; no question about it.

He didnt release using the GPL so your aren't forced to anything.
As already I stated you in another thread. Its the effort that counts, not the skills.The parser code is double in size, but supposedly only because Remi Meier's code is cool and efficient and his coding skills are lightyears ahead compared with my coding skills.
Check out OOP support for PB here!