Worklog for MusicianKool
oops(Object Orianted Programming Syntax) for blitz3d and other languages.
Return to Worklogs
| ||
Here is a close to final of oops to c++. Just need to figure out how
to do dynamic array's and the rest will be up to the programmer. Basic commands covered in methods and functions if / elseif / else / endif for / next and / or / xor while / wend dim myarray[n] / dim myarray#[n] / dim myarray$[n] / dim myarray.foo[n] class / field / method/ end method/end class class foo:bar ;class foo inherits bar Inline c++ code in methods and functions [cpp] or [c++] add c++ code here [c++] or [cpp] some limitations: no multiple lines of code on a single line unless in an inline c++ code block. so: if a < 10 then a = a + 1:x = x + 1: endif ; will not work! it must be written: if a < 10 then a = a + 1 x = x + 1 endif This applies to all basic code that will be converted. the local scope of variables in c++ are very different then that of basic. ie: local I,J for I = 1 to 100 for J = 1 to 100 next next produces 200 loops its very different from: local I for I = 1 to 100 local J for J = 1 to 100 next next produces 1000 loops Do not apply values in the local statement ie(dont do this) local I = 1, J = 100, K$ = "errrm" do this instead: local I,J%,K$,g# I = 1 J = 100 K = "errm" g = 12.123 an example oops file: will be converted to this: The blitz3d source for converting: My Music Mouse XY to 3D XY / Improved Perlin Noise 2D and 3D HeightMapped GeoSphere/ Dynamic LOD(Level Of Detail) Blitz3D Keyword Data List / Blitz3D like syntax to C++ |
| ||
Here is step one of a thousand with this idea. Bugs: Not all comments are transported to b3d, not really a bug as it is I'm to lazy to put it in. Limitations: Dose not support multiple lines of code on a single line. Can not do class within class. Fields can be privatized (all fields that are privatized are not inherited) . Features: += -= *= /= ++ -- all work Classes can contain methods and can inherit other classes of infinite scope. Methods can return the type they are working with by "Return This". Methods are called by the same means of other popular oop languages by "ThisClassHandle.ThisMethod()". Methods can be privatized (excluded from inheritance) Example of OOPS: OOPS is converted to: Source for converting OOPS to B3D: Working on a OOPS to C++ converter. It's taking some time as I don't really know C++ that well. My Music Mouse XY to 3D XY / Improved Perlin Noise 2D and 3D HeightMapped GeoSphere/ Dynamic LOD(Level Of Detail) Blitz3D Keyword Data List / Blitz3D like syntax to C++ |
| ||
I have had an Idea, not sure if it has been done before, to create a
language that will convert to any other language. Like oops to C++ or
Java but only in general syntax, you will still need to know the
libraries and extensions for individual languages and you will also need
to know how to compile them. I'm sure the logistics of this idea would be immense but the final product would be sweet. And damn it, Mark took my idea with monkey! well whatever not like i was going to get as far along as he did. My Music Mouse XY to 3D XY / Improved Perlin Noise 2D and 3D HeightMapped GeoSphere/ Dynamic LOD(Level Of Detail) Blitz3D Keyword Data List / Blitz3D like syntax to C++ |