Jump to content
x39

[InDev] ObjectOrientedScripting - A C# Project to bring SQF to the next level

Recommended Posts

Gen2 EBNF file is finished
now the hard part starts ... adding the TreeGenerator to the EBNF file and then finish the new tree writer

main difference to the old one is that gen2 will have typesafety enabled to get rid of the overhead which is normally produced (there will still be some overhead for some operations ... however, that overhead will be WAY smaller)
it also adds interfaces (not yet sure how i will implement theese ... they might wont be accessible thus rly just class interfaces and no way to use em as type)

Share this post


Link to post
Share on other sites

Just here with latest update

Project not dead btw. :P just cannot show off much due to the fact that its not yet finished thus non-functional ... anyway

here is something for you folks out there

the support list:

https://github.com/X39/ObjectOrientedScripting/blob/TypeSafety/ObjectOrientedScripting/Compiler/Resources/SQF_SupportInfo.txt

need some help with filling the correct return type into the document so if you ever should feel bored, just hop in and do me some favor <3

as little extra, here is the object structure in SQF:

https://github.com/X39/ObjectOrientedScripting/blob/TypeSafety/Concept/ObjectBase.sqf

greets

X39

PS

if you got any questions, just ask

Share this post


Link to post
Share on other sites

It is done my friends

GEN2 is officially released now

https://github.com/X39/ObjectOrientedScripting/releases/tag/v0.5.0-ALPHA2

Changelog:

Version 0.5.0-ALPHA
    |- Wrapper:   Fixed -gen is not working if file is not existing
    |             (also if file was existing ... but expected error then)
    |- Compiler:  Flag /DEFINE="#whatever(arg) dosomething with arg"
    |- Compiler:  Flag /THISVAR="_thisvarname_"
    |- Compiler:  PreProcessor replaced non-keywords when they just contained a
    |             part of the keyword (EG. keyword was FOO, FOOBAR would have
    |             been replaced with <CONTENT>BAR)
    |- Compiler:  PreProcessor now supports "merge" operator ##
    |             #define FOO(BAR) BAR##FOOBAR
    |             FOO(test) => testFOOBAR
    \v- Compiler: GEN2 Implementation
     |-           New Syntax
     |-           New SQF ObjectStructure
     |-           Type Restriction (with that all stuff that is connected to it)
     |-           Interfaces (and with them virtual functions)
     |-           "Linker" issues with proper issue IDs
     |            (currently room for 4 digits (so 0001 - 9999))
     \-           No unneeded overhead anymore
documentation will be up in the following week

Share this post


Link to post
Share on other sites

Release 0.5.1-ALPHA

https://github.com/X39/ObjectOrientedScripting/releases/tag/v0.5.1-ALPHA

Changelog:

Version 0.5.1-ALPHA
|- Wrapper:   Fixed naming of -gen param (poject.oosproj instead of
|             project.oosproj)
|- Wrapper:   Fixed "URI-Format not supported" message when not forcing
|             a DLL (dll lookup now works as expected -.-*)
|- Compiler:  Fixed functions getting invalidly recognized as duplicate
BTW.

The documentation is currently being created right here:

http://wiki.x39.io/index.php/ObjectOrientedScripting

greets

X39

  • Like 1

Share this post


Link to post
Share on other sites

Release

https://github.com/X39/ObjectOrientedScripting/releases/tag/v0.5.2-ALPHA

Changelog

Version 0.5.2-ALPHA                                                             
    |- Compiler:  Fixed output folder is not getting generated if not existing  
    |- Compiler:  Fixed typeless functions are all recognized as constructor    
    |- Compiler:  Fixed classes are lacking a cfgConfig layer                   
    |- Compiler:  Fixed namespace static variables lacked semicolon in EBNF     
    |- Compiler:  Fixed object functions not getting object parameter passed    
    |- Compiler:  Added output folder cleanup                                   
    |- Compiler:  Flag /NOCLEANUP which prevents output folder cleanup          
    |- Compiler:  PreProcessor now supports stdLibrary #include (using < >)     
    |- Compiler:  Added additional keyword "boolean" for bool types             
    |- Compiler:  New CompileErrors: C0049                                      
    |- Compiler:  Added NativeClasses                                           
    \- Compiler:  Added array object to stdLib                                  

OOS Skype group link:

https://join.skype.com/gkC9bnujA9zN

Share this post


Link to post
Share on other sites

just quick update fyi guys

OOS currently gets a rewrite of the linker & writeOut which leads to more stable linking etc.

thats why the project looks kinda dead right now

also, there is currently a german tutorial being built by some folk which will be later (hopefully) lead to an english tutorial

btw. there is also a Discord server available

feel free to join :P

https://discord.gg/0arQM0FX6xt0iWm3

greetings

X39

Share this post


Link to post
Share on other sites

Release

https://github.com/X39/ObjectOrientedScripting/releases/tag/v0.6.0-ALPHA

Changelog

Version 0.6.0-ALPHA                                                             
    |- Compiler:  Rewrote entire Linker & Writer
    |- Compiler:  Added !syntax! to call base constructors via following:
    |             bar(arg1, arg2, argn) : foo(arg1, "foobar", argn) {...}
    |- Compiler:  During Linking, functions will now check if they always return
    |             (only exception for this are VOID functions)
    |- Compiler:  Added "PRINTMODE=<MODE>" Flag
    |             Possible modes are: NONE, 0, NEEDED, 1, PARTIAL, 2, ALL, 3
    |- Compiler:  Added fast assign operators: ++, --, +=, -=, *=, /=
    |- Compiler:  Reorganized how overwrite should be used (see INFO1)
    |- Compiler:  Added "async" keyword for functions (see INFO1)
    |             async functions have to have the return type void!
    |- INFO1:     Functions syntax got altered:
    \             <encapsulation> [async] [override] <type> <name> ( <argList> )
Known Issue:

InstanceOf gives invalid result

Share this post


Link to post
Share on other sites

Release

https://github.com/X39/ObjectOrientedScripting/releases/tag/v0.6.1-ALPHA

Changelog

Version 0.6.1-ALPHA
    |- Compiler:  fixed InstanceOf printout
    |- Compiler:  Introduced "using" operation, replaces #include
    |- Compiler:  #include now wont "include" the file anymore and instead just
    |             checks the PreProcessor directives in given file
    |- Compiler:  Added "extends" keyword to native classes --> you now can
    |             extend native classes
    |- Compiler:  Added code for the "async" keyword on functions (sorry)
    |- Compiler:  "PRINTMODE" flag modes have changed:
    |             Possible modes are: NONE, 0, NEEDED, 1, ALL, 2
    |- Compiler:  Renamed all stdLibrary objects to have first char uppercase
    |- Compiler:  Added "VehicleBase" object to stdLibrary (not intended to be
    |             created via new, will throw an error when you attempt)
    |- Compiler:  Added "Man" object to stdLibrary, represents all CAManBase
    |             ArmA objects
    \- WrapperUI: Introduced WrapperUI.exe, a UI for OOS <3 (to be improved)
Known Issues:
  • Creating a new variable containing an object requires auto keyword.

    Thus, the following is not possible:

    ::std::vehicle variable = new ::std::vehicle("foobar");

Share this post


Link to post
Share on other sites

Going to have a crack at this, X39. Looks very impressive. I'm in the process of teaching myself C++, so this should be useful for learning the OO paradigm.

Share this post


Link to post
Share on other sites

Going to have a crack at this, X39. Looks very impressive. I'm in the process of teaching myself C++, so this should be useful for learning the OO paradigm.

Thanks

feel free to join the discord server https://discord.gg/0arQM0FX6xt0iWm3in case you got any questions

btw. the wiki currently gets migrated to the github page


Release

https://github.com/X39/ObjectOrientedScripting/releases/tag/v0.6.2-ALPHA

Changelog

Version 0.6.2-ALPHA
    |- Compiler:  fixed various minor issues
    |- Compiler:  removed multi-base classes
    |- Compiler:  improved object structure (==> less overhead)
    |- Compiler:  fixed overloaded functions overwriting themself
    |- Compiler:  fixed different case same name functions overwriting themself
    |- Compiler:  temporary disabled interfaces as function argument
    |- Compiler:  fixedasync keyword made functions being callen instead of 
    |             spawned (and vice versa)
    |- Compiler:  unlocked the native "object" object (actually thats a speciall
    \             internal class now, might happen with string too soon)
Known Issues
  • Creating a new variable containing an object requires auto keyword.

    Thus, the following is not possible:

    ::std::vehicle variable = new ::std::vehicle("foobar");
  • Fixed in inDev the 'using' instruction is not using the PreProcessor --> only main file is getting preprocessed
  • Fixed in inDev the toString function has invalid encapsulation and thus cannot be used
Notes

Interfaces are temporary disabled as function arguments due to missing idea (yes ... no idea) about how to implement em with a minimum performance loss

  • Like 1

Share this post


Link to post
Share on other sites

Release

https://github.com/X39/ObjectOrientedScripting/releases/tag/v0.7.0-ALPHA

Changelog

Version 0.7.0-ALPHA
    |- Compiler:  fixed objects added using the using instruction where not
    |             touched by the PreProcessor
    |- Compiler:  printout syntax got altered slightly (missing tabs and invalid
    |             new lines)
    |- Compiler:  fixed for required all params or it would throw a NPE
    |- Compiler:  fixed NPE when assigning variables in other namespaces
    |- Compiler:  fixed StackOverflow case with this variable
    |- Compiler:  using directive threw out folder path instead of file path
    |- Compiler:  using now is generalized (no difference between local and std
    |             includes) thus syntax changed:
    |             using ::foo::bar
    |             instead of
    |             using "::foo::bar" or using <::foo::bar>
    |- Compiler:  fixed invalid encapsulation on object function "toString"
    |- Compiler:  Changed cast operator from %...% to <...>
    |- Compiler:  fixed templates only could use native types
    |- Compiler:  added internal class "array"
    |- Compiler:  added internal class "string"
    |- Compiler:  Parser is more solid now (side effect thx to EBNF changes)
    |- Compiler:  Fixed CfgFunctions class is never written out regardless of
    |             the NFNC flag
    |- Compiler:  Fixed invalid distinction between variable and function when
    |             using a class variable with an object as type
    |- Compiler:  class & native syntax now supports flags
    |             (not important for generic oos users)
    |             `class <IDENT> flags <FLAG1> <FLAG2> <FLAGN>`
    |             Flags which got introduced:
    |             - disableConstructor
    |             - noObjectExtends
    |             - virtualFunctionsOnly (not available in native)
    |- Compiler:  Introduced enum`s. They got following syntax:
    |             enum { <IDENT1> [ = <VALUE2> ], <IDENTN> [ = <VALUEN> ] }
    |- Compiler:  SQF instruction now supports forcedType via "as". Example:
    |             `SQF allPlayers as ::std::Array<::std::Men>`
    |- stdLib:    added ::std::UI::Display object
    |- stdLib:    added ::std::UI::Control object
    |- stdLib:    added ::std::Marker object
    |- stdLib:    fixed invalid typing in ::std::base::VehicleBase object
    |- stdLib:    removed ::std::Array object (moved to internal classes)
    |- stdLib:    removed ::std::String object (moved to internal classes)
    |- stdLib:    added get-/setObject function to ::std::Context
    \- .oosproj:  Added <srcfolder> attribute to set the source folder
Known Issues
  • Creating a new variable containing an object requires auto keyword.

    Thus, the following is not possible:

    `::std::vehicle variable = new ::std::vehicle("foobar");`

  • Passing an object of the same class which you are in right now will result in

    the object getting assigned an invalid type

    ((Internally it will ref to the function which is for sure nonsense ...

    however ... harder to fix then it might sounds in first place due to the

    lower logic behind it))

  • (Not rly an issue but more of a note) currently only idents are allowed to be

    callen. Thus you cannot call from an expression

    following would be invalid:

    `(new foobar()).foo()`

    due to the fact that it is the following:

    `<EXPRESSION>.<IDENT><FUNCTIONCALL>`

Share this post


Link to post
Share on other sites

Release

0.7.1-ALPHA

Changelog

Version 0.7.1-ALPHA
    |- Compiler:  fixed member functions without arguments lacked params command
    |- Compiler:  fixed callWrapper `___tmp___ = ___tmp___` printout
    |- Compiler:  fixed breakout missed left args brackets
    |- Compiler:  fixed invalid LNKxxxx exception when function is not existing
    |- Compiler:  fixed ident call wrapper used ___tmp___ AND _tmp
    |- Compiler:  fixed some other stuff (meh ... do not ask :) tiny things)
    |- Compiler:  fixed loops not printing scopeName instruction
    |- Compiler:  "using" files did not got preprocessed
    |- Compiler:  fixed third for argument is printed at the very begining
    |- Compiler:  fixed native function calls do not process last argument
    |- Compiler:  fixed passing <IDENT>.<IDENT> for a native function (and some
    |             other things too ... kinda hard to explain ^^)
    |- Compiler:  fixed objects require auto keyword inside of code
    |- Compiler:  added static native functions
    |- Compiler:  added external function references using the external keyword
    |             static external [ async ] <TYPE> <IDENT> ( <ARGLIST> );
    |- Compiler:  added foreach operation
    |             foreach( <VARTYPE> <IDENT> in <IDENT> )
    |- Compiler:  added vec3 object to OOS
    |v- Compiler: added native functions to OOS
    ||-           isServer()
    ||-           sleep(scalar)
    |\-           isDedicated()
    |- stdLib:    added ::std::getPlayer static function to ::std::Man
    |- stdLib:    added AiSection enum to ::std::Man
    |- stdLib:    added enableAI function to ::std::Man
    |- stdLib:    added disableAI function to ::std::Man
    |- stdLib:    fixed invalid return type in getObject of ::std::Context
    |- stdLib:    fixed script issue on ::std::VehicleBase::setDamage(scalar)
    |- stdLib:    fixed invalid string argument on ::std::Config::count()
    |- stdLib:    fixed potential script issue in all native objects
    \- stdLib:    changed function arglists of ::std::Context
Known Issues

- Passing an object of the same class which you are in right now will result in
  the object getting assigned an invalid type
  ((Internally it will ref to the function which is for sure nonsense ...
    however ... harder to fix then it might sounds in first place due to the
	lower logic behind it))

- (Not rly an issue but more of a note) currently only idents are allowed to be
  callen. Thus you cannot call from an expression
  following would be invalid:
  `(new foobar()).foo()`
  due to the fact that it is the following:
  `<EXPRESSION>.<IDENT><FUNCTIONCALL>`

- Casts currently do not check if given object is kind of cast target thus you
  can enforce invalid object types

- Downcasting has to be done explicit

- casting to an object having a template requires you to write it like so (example shows array<scalar> cast):
  < array<scalar> >yourVariable
  
- creating a new template object which gets another template object as kind requires you to write it like so (example shows array<scalar> in another array):
  new array< array<scalar> >()

Share this post


Link to post
Share on other sites

big up man ! keep up your work :)

thats what im doing :)

there is even a little OOS project ongoing where i discovered the majority of the bugs i fixed since release of 0.7.0

https://github.com/X39/XInsurgency/tree/OOS_Insurgency/InsurgencyModule/src

Release

0.7.2-ALPHA

Changelog

    Version 0.7.2-ALPHA
        |- Wrapper:   fixed Project.writeToFile(string) wrote buildfolder to
        |             srcfolder
        |- WrapperUI: fixed saving exception which prevented saving changes
        |- WrapperUI: fixed set buttons not getting disabled when loading files
        |- Compiler:  fixed issue where assignment type is not chosen correctly
        |- Compiler:  fixed member variables are "directly assigned"
        |- Compiler:  fixed member variables w/o def val being initialized using nil
        |- Compiler:  fixed missing comma printing on params for multi-arg fncs
        |- Compiler:  fixed static native functions args get messed up with printout
        |- Compiler:  fixed native functions wrappers wrong select index
        |- Compiler:  fixed void function wrappers tried to return something
        |- Compiler:  added internal script object (currently unused)
        |- Compiler:  added internal floor(<scalar>) function
        |- Compiler:  added LNK0051 exception for variable defined twice in class
        |-            and function
        |v- stdLib:   Updated ::std::Marker functions
        ||- stdLib:   new enum: Shape
        ||- stdLib:   new function: void setType(string)
        ||- stdLib:   new function: string getType()
        ||- stdLib:   new function: void setShape(Shape)
        |\- stdLib:   new function: Shape getType()
        |- stdLib:    Added delete() function to ::std::Marker
        |- stdLib:    Added deleteVehicle() function to ::std::base::VehicleBase
        |- WrapperUI: WrapperUI will inform you about unsaved changes you have
        |             made to current file upon load/close
        |- WrapperUI: Implemented Ressources
        \- Compiler:  Implemented Ressources
Known Issues

- Passing an object of the same class which you are in right now will result in
  the object getting assigned an invalid type
  ((Internally it will ref to the function which is for sure nonsense ...
    however ... harder to fix then it might sounds in first place due to the
	lower logic behind it))

- (Not rly an issue but more of a note) currently only idents are allowed to be
  callen. Thus you cannot call from an expression
  following would be invalid:
  `(new foobar()).foo()`
  due to the fact that it is the following:
  `<EXPRESSION>.<IDENT><FUNCTIONCALL>`

- Casts currently do not check if given object is kind of cast target thus you
  can enforce invalid object types

- Downcasting has to be done explicit

- casting to an object having a template requires you to write it like so (example shows array<scalar> cast):
  < array<scalar> >yourVariable
  
- creating a new template object which gets another template object as kind requires you to write it like so (example shows array<scalar> in another array):
  new array< array<scalar> >()

Share this post


Link to post
Share on other sites

Release

v0.7.3-ALPHA

Changelog

Version 0.7.3-ALPHA
    |v- Compiler: Added `deref <ident>` operation, returns SQF name of given
    ||            Non-Native function (virtual functions are not allowed too)
    ||            or of given static variable
    ||-           Added new Linker exception LNK0052
    ||            "Invalid Operation, Native functions are not derefable"
    ||-           Added new Linker exception LNK0053
    ||            "Invalid Operation, Virtual Functions are not derefable"
    ||-           Added new Linker exception LNK0054
    |\            "Invalid Operation, Non-Static Variables are not derefable"
    ||-           Added new Linker exception LNK0055
    |\            "Invalid Operation, using this in static functions"
    |v- Compiler: rewrote Expression code & EBNF
    ||v- Compiler: Expressions get parsed according to following precedence
    |||-           First:  "+" | "-" | "*" | "/"
    |||-           Second: ">=" | "<=" | "==" | "<" | ">"
    ||\-           Third:  "&&" | "||"
    ||-           EXPOP `==` is now using isEqualTo
    ||-           removed EXPOP `===`
    ||-           removed EXPOP `&`
    |\-           removed EXPOP `|`
    |- Compiler:  added `bool array<T>::contains(T)` function
    |v- stdLib:   Added missing functions to ::std::Marker
    ||-            string getText()
    |\-            void setText(string)
    |- stdLib:    Fixed ::std::Man constructor not returning objects
    |v- stdLib:   Altered how ::std::Group is working
    ||-            Removed ::std::Group::createGroup*() functions
    ||v- stdLib:   Added ::std::Side class 
    |||-            Member Function: ::std::Side asEast()
    |||-            Member Function: ::std::Side asWest()
    |||-            Member Function: ::std::Side asResistance()
    |||-            Member Function: ::std::Side asCivilian()
    |||-            Member Function: ::std::Side asLogic()
    |||-            Member Function: ::std::Side asEnemy()
    |||-            Member Function: ::std::Side asFriendly()
    ||\-            Member Function: ::std::Side asUnknown()
    |\-            Added constructor ::std::Group::Group(::std::Side)
    |- Compiler:  Fixed exception when LNK0012 happens 
    |- Compiler:  Fixed external functions had to return
    |- Compiler:  Fixed variables without value get printed in function
    |- Compiler:  Fixed Fixed static functions throw LNK0051
    |- Compiler:  Fixed encapsulation call check (on private/protected)
    |- Compiler:  Fixed for loop arg1 variable not private in parents scope
    |- Compiler:  Fixed private functions 
    \- Compiler:  Fixed "_" in fnc name fucks up config.cpp 
Known Issues

- Passing an object of the same class which you are in right now will result in
  the object getting assigned an invalid type
  ((Internally it will ref to the function which is for sure nonsense ...
    however ... harder to fix then it might sounds in first place due to the
	lower logic behind it))

- (Not rly an issue but more of a note) currently only idents are allowed to be
  callen. Thus you cannot call from an expression
  following would be invalid:
  `(new foobar()).foo()`
  due to the fact that it is the following:
  `<EXPRESSION>.<IDENT><FUNCTIONCALL>`

- Casts currently do not check if given object is kind of cast target thus you
  can enforce invalid object types

- Downcasting has to be done explicit

- casting to an object having a template requires you to write it like so (example shows array<scalar> cast):
  < array<scalar> >yourVariable
  
- creating a new template object which gets another template object as kind requires you to write it like so (example shows array<scalar> in another array):
  new array< array<scalar> >()
Notes

I am happy to announce that this build finally is stable for productive usage!

BETA release will most likely be in Q2 this year

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×