diff options
| author | realtradam <[email protected]> | 2022-07-20 06:29:06 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2022-07-20 06:29:06 -0400 |
| commit | e49eefc8ed66c905f13812941269e1b42c239871 (patch) | |
| tree | 251f150aa713abef003e74d60790e7f4cb9f6bbd | |
| parent | 8f12cd1f31d991aeb36ba67a4d00e214b03cdac4 (diff) | |
| download | FelBind-e49eefc8ed66c905f13812941269e1b42c239871.tar.gz FelBind-e49eefc8ed66c905f13812941269e1b42c239871.zip | |
wip planning
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | planning/.vimrc | 2 | ||||
| -rw-r--r-- | planning/dsl.mdown | 34 | ||||
| -rw-r--r-- | planning/structure.puml | 100 |
4 files changed, 137 insertions, 0 deletions
@@ -9,3 +9,4 @@ temp temp.c build build/* +planning/*.png diff --git a/planning/.vimrc b/planning/.vimrc new file mode 100644 index 0000000..961011a --- /dev/null +++ b/planning/.vimrc @@ -0,0 +1,2 @@ +" press F5 to compile and execute the project code +map <f5> :AsyncRun -save=1 plantuml "%:p" && viewnior <cwd>/%:t:r.png <CR> diff --git a/planning/dsl.mdown b/planning/dsl.mdown new file mode 100644 index 0000000..513153e --- /dev/null +++ b/planning/dsl.mdown @@ -0,0 +1,34 @@ +# DSL + +Special DSL for configuring the resulting bindings. Allows you to change the name, change what class or module something belongs to, and change what it is named, or disable something from being bound at all. + +```ruby +// setters +fn[:MyCFunction].rename :my_new_method_name +fn[:MyCFunction].klass :MyRubyClass // make this function belong to a ruby class +fn[:MyCFunction].param_as_self :c_var // have the function use self instead of asking for that parameter +fn[:MyCFunction].skip +// getters +fn{:MyCFunction].name +fn{:MyCFunction].klass +fn{:MyCFunction].param_as_self +fn[:MyCFunction].skip? + +// setters +struct[:MyCStruct].rename :MyRubyClass +struct[:MyCStruct].klass :MyRubyClassTwo //make this struct class belong under another +struct[:MyCStruct].skip +struct[:MyCStruct].add_alias :MyCTypeDef //TODO: figure this out better +// getters +struct{:MyCStruct].name +struct{:MyCStruct].klass +struct{:MyCStruct].param_as_self +struct[:MyCStruct].aliases + +config.define_method_naming_pattern do |c_function| + // your logic +end +config.define_class_naming_pattern do |c_struct| + // your logic +end +``` diff --git a/planning/structure.puml b/planning/structure.puml new file mode 100644 index 0000000..ac66905 --- /dev/null +++ b/planning/structure.puml @@ -0,0 +1,100 @@ +@startuml + +state "General Process" as General_Process { + state Code + state JSON + state Gem { + state Headers + state Structs { + state Struct_Type_Init + state Struct_Accessors + state Struct_Func_Init + } + state Methods + state Gem_Initializer { + state Define_Module + state Define_Struct_Classes + state Define_Struct_Methods + state Define_Functions + } + state Gem_Finalizer + + Code -r-> JSON + JSON -d-> Gem + + Headers -d-> Structs + Structs -d-> Methods + Methods -d-> Gem_Initializer + Gem_Initializer -d-> Gem_Finalizer + + Define_Module -d-> Define_Struct_Classes + Define_Struct_Classes -r-> Define_Struct_Methods + Define_Struct_Classes -d-> Define_Functions + } +} +state "Method" as C_Function { + state "Initialize Vars" as Initialize_Vars_C_Function + state fork_kw_args_c_function <<fork>> + state "Get Single Arg" as Get_Arg_C_Function + state "Get Kwargs" as Get_Kwargs_C_Function + state "Assign Arg" as Assign_Arg_C_Function + state "Assign Kwargs" as Assign_Kwargs_C_Function + state "Call Function" as Call_C_Function + state fork_wrap_struct_c_function <<fork>> + state "Wrap Struct" as Wrap_Struct_C_Function + state "Return Value" as Return_C_Function + + [*] -d-> Initialize_Vars_C_Function + [*] -d-> Call_C_Function + + Initialize_Vars_C_Function -d-> fork_kw_args_c_function + + fork_kw_args_c_function -d-> Get_Arg_C_Function + Get_Arg_C_Function -d-> Assign_Arg_C_Function + + fork_kw_args_c_function -d-> Get_Kwargs_C_Function + Get_Kwargs_C_Function -d-> Assign_Kwargs_C_Function + + Assign_Arg_C_Function -d-> Call_C_Function + Assign_Kwargs_C_Function -d-> Call_C_Function + + Call_C_Function -d-> fork_wrap_struct_c_function + fork_wrap_struct_c_function -d-> Wrap_Struct_C_Function + + fork_wrap_struct_c_function -d-> Return_C_Function + Wrap_Struct_C_Function -d-> Return_C_Function +} + +state "Struct Getter Method" as Struct_Getter { + state fork_is_struct_getter <<fork>> + state "Unwrap Struct\nand Read Value" as Unwrap_Struct_Getter + state "Return Value" as Return_Struct_Getter + state "Handle If Value\nIs Struct" as Handle_Struct_Value_Getter + + [*] -d-> Unwrap_Struct_Getter + Unwrap_Struct_Getter -d-> fork_is_struct_getter + fork_is_struct_getter -d-> Return_Struct_Getter + fork_is_struct_getter -d-> Handle_Struct_Value_Getter + Handle_Struct_Value_Getter -d-> Return_Struct_Getter + +} + +state "Struct Setter Method" as Struct_Setter { + state "Initialize Vars" as Initialize_Vars_Setter + state "Get Arg" as Get_Arg_Setter + state "Unwrap And Set" as Unwrap_Struct_Setter + state "Return Var" as Return_Setter + + [*] -d-> Initialize_Vars_Setter + Initialize_Vars_Setter -d-> Get_Arg_Setter + Get_Arg_Setter -d-> Unwrap_Struct_Setter + Unwrap_Struct_Setter -d-> Return_Setter +} + +state Struct_Initializer { + state Initialize_Vars_Init +} + + + +@enduml |
