/*____________________________________________________________________________
64bits signed word
can host 8 ascii character
____________________________________________________________________________*/

#pragma once
#ifndef _WORD
#define _WORD

/*____________________________________________________________________________
word definition
with char[8] to word convertion
____________________________________________________________________________*/

typedef signed long long int word;
#define txt2word(txt) (*((word*)txt))
#define word2txt(wrd) (((char*)&wrd))

/*____________________________________________________________________________
list of predefined word
____________________________________________________________________________*/

#define PUSH 5786932008338019664
#define POP 4994585737305280336
#define DUPE 4708323196067140932
#define SWAP 4921942912364795731

#define AND 5620582834218749505
#define OR 6341160974925451855
#define NOT 23168187471515470
#define XOR 19215344385281880
#define ADD 18671163438023745
#define SUB 5064658777278666067
#define SHIFTL 5980864229988190291
#define SHIFTR 2522106313237416019

#define NUM 4847377627315262798
#define EXEC 6077700057241835589
#define TXT 7378413666008586324

/*____________________________________________________________________________
list of mode
____________________________________________________________________________*/

enum mode {execMode, 
           pushNumMode, 
           pushTxtMode,
           thenMode,
           elseMode,
           loopMode,
           whileMode,
           untilMode,
           defineMode};

#endif

/*_________MODE___________________
NUM mode
all word are inserted as number
will return error if no number
will exit on 0
word ZERO is intended to push zero

EXEC mode
all word are executed or return an error

TXT mode
will push 8 char package until empty one

LOGIN mode
single input word
hope number
*/

/*_______FLOW CONTROL______________
need Call and return
    push address call word
    pop address
need if else endif
    if true exec, then on else skip to endif
    if false , skip to else or endif
need do while, do until
    push address at do
    at while if not zero, pop address to do
    at until, if zero, pop address to do
switch... not sure but clever
    
*/

/*_______USER RIGHT________________
all word have an owner
all right are available to admin
there is right for owner
there is right for other
right are 
    see
    read
    write
    execute

can have many word of the same name but with different owner
while login stackup
latest login will priorise word like update

*/

/*____________word declaration______
how the hell i do that
i will need many duplicate word name
i will need to search in a tree
i will need owner right declaration
    will need a dictionnary
        this kind of operation is always costy
        i can consider that word will be more offen called than declared
        
*/

