~jasper/type_stack_calc

b68fbc86915388579779bb4ad7c9b550dae52a68 — Jasper den Ouden 1 year, 6 months ago 2f0e047
Manually made Graphviz dotfile how the type calculation works. Makes me think i should join the macros and stuff with `.insert_code`
1 files changed, 84 insertions(+), 0 deletions(-)

A doc/other/type_calc_process.dot
A doc/other/type_calc_process.dot => doc/other/type_calc_process.dot +84 -0
@@ 0,0 1,84 @@


digraph process {
    label="Graph about Type calculation, rest just indication of context.
Oversimplified. (i know maybe hard to understand..)"

    root = Parsing

    Parsing [ shape=box tooltip="Very little to it" ]
    Parsing -> words -> { constant variable component}

    subgraph cluster_type_calculation {
        label = "Type calculation
Note1: next to calculating types, it also collects the code as resulting from it.
Note2: there is a lot of logic about types,\nnot shown here!"

        stack -> component [
            style=dashed
            xlabel=1
            tooltip="First item of stack it is the component of."
        ]

        words [ label="words\nkeep returning to next one" shape=box ]

        constant [ label="(constant)\nnumbers,string,bool" tooltip="here not callable when obtained by-word." ]
        ufun [ label="user defined\nfunction" tooltip="Arguments and Code object used to make one" ] 
        ifun [ label="inbuilt function\ndefined by language"
               tooltip="some get the raw type stack, which include variable objects not-unpacked. So variables can be set." ]
        ifun -> "quite a bit\nwith types(sets)"
        macro [ label="macro\naccesses\nraw stuff" tooltip="Stuff like if, code-parser. Probably should merge with word editor."]

        stack [ shape=diamond
                label = "type stack"
                tooltip="list of types on the stack, function takes the top types as arguments."]

        variables [ shape=diamond ]
        variables -> variable [ style=dashed ]

        ufun_calc [ label="calculate or access\nfunction variant"
                    tooltip="One of hardest parts, process." ]
        "function variants" [ shape=diamond label="function\nvariants"
            tooltip="dictionary of function variants by the types it"
        ]

        "just a value" [ tooltip="Type of value that should just be added to stack." ]
        { variable component constant } -> "just a value"
        "just a value" -> stack [ style=dashed xlabel=1 ]

        { component variable } -> actionable

        stack -> actionable [ style=dashed
            tooltip="if method, the value the component is from is passed along." ]

        word_editor [ label="inbuilt word editor\n(rarely)"
            tooltip="basically just the components-of-object exposer" ]

        actionable [ label="actionable value" tooltip="Have to do more than just put on stack." ]

        actionable -> { ufun ifun word_editor macro }
        word_editor -> words [ taillabel="add/remove\ncoming words" style=dashed ]

        {ifun ufun_calc} -> stack [ taillabel=result style=dashed ]

        "function variants" -> ufun_calc [ style=dashed dir=both tooltip="set or get" ]

        ufun -> ufun_calc
        ufun_calc -> ufun_same_proc
        ufun_same_proc [ label="Same process on Code object\nPre-filled variables\nRecursion complicates\nWords ran out->collect return value"
            shape=box
            tooltip="Repeats until of the calls >= distance of not-entirely-resolved function"
        ]

        words -> "words ran out"
        "words ran out" [ tooltip="Means done. Unless function, more complicated" ]
    }
    Extraction [
        label="Extraction for C\n(more to it)" shape=box
        tooltip="Basically stuff like variable definition and `if` is lifted out of function calls."
    ]
    "Convertion to C" [
        shape=box tooltip="Mostly straightforward, main issue tracking argument counts."
    ]
    "words ran out" -> Extraction -> "Convertion to C"
}