Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/13/2020 in all areas

  1. TheSaint

    PiD “challenge”

    And to think I could have replied to TheDcoder's reply instead, and shown him the error of his ways, and thus missed out on such a heartfelt reply. Luckily Fate intervened, that fickle woman of the web, and a different thread was spun. Such is life on this spinning globe as it traverses the Milky Bar Way.
    2 points
  2. I am back with another bi-weekly (almost ) update, as usual I have been busy with life so progress is slow, but I have jumped another small yet-somewhat-significant hurdle, I have mostly figured out the basic skeleton of the syntax, to achieve this I had to spend 100% of my brain power for a couple of minutes almost every day for a two weeks Here is a sneak peak of the code: enum Operation { /* Addition, Substraction, Multiplcation, Division, Exponentiation */ OP_ADD, OP_SUB, OP_MUL, OP_DIV, OP_EXP, /* Concatenation */ OP_CAT, /* Equal to, Strictly equal to, Less than, Less than or equal to, Greater than, Greater than or equal to */ OP_EQU, OP_SEQU, OP_LT, OP_LTE, OP_GT, OP_GTE, /* Conditional */ OP_CON, }; struct Token { enum TokenType type; char *data; size_t data_len; void *info; }; struct TokenList { size_t length; struct TokenListNode *head; struct TokenListNode *tail; bool dirty; }; struct TokenListNode { struct Token *token; struct TokenListNode *prev; struct TokenListNode *next; }; struct Primitive { enum { PRI_NUMBER, PRI_STRING, PRI_BOOLEAN, // ... } type; union { //int number; //char *string; //bool boolean; }; }; struct Operand { enum { OPR_PRIMITIVE, //OPR_VARIABLE, //OPR_MACRO, } type; union { struct Primitive *value; //struct Variable *variable; //struct Macro *macro; }; }; struct Expression { enum Operation op; struct Operand operands[]; }; struct Declaration { enum {SCO_LOCAL, SCO_GLOBAL} scope; // ...Const, Static char *name; bool is_function; union { // Variable or constant struct Expression *initializer; // Function struct { struct Statement *block; size_t size; } code; }; }; struct Statement { enum StatementType { SMT_DECLARATION, SMT_EXPRESSION, } type; union { struct Declaration *declaration; struct Expression *expression; }; }; struct Unit { enum UnitType { UNT_COMMENT, UNT_DIRECTIVE, UNT_STATEMENT, } type; union { struct Token *token; struct Statement *statement; }; }; The above code is basically the struct declarations that I extracted from my WIP code, these structures reference each other to form a single "code unit" which roughly corresponds to a single line of code in the AutoIt syntax. I have tried to arrange the declarations in the ascending order, where the top-most structure roughly represents the most basic element of the syntax (the token in this case) which is contained in a more informative and complex structure, all the way to the bottom where the "Unit" structure has a fully formed meaning. This should be enough for me to start writing code to construct the syntax tree, but there are some other things that I would like to work on first. Right now I am looking into incorporating debug data into the final binary, so that we can have a nice debugger to debug our scripts . It is not necessary that I look into this right now, but it will come in handy if I study and understand the basic concepts of how the debugger maps the final instructions to strings in the source code, so that I can make modifications to the syntax tree's design right now, as opposed to in the future to prevent inconvenience of re-writing of related code. Basically leaving gaps in the tree which I can fill later when actually implementing the debugging functionality. A good example to study in my opinion is the format used by C debuggers (gdb and co.), and I found out that the format is called DWARF (Name FAQ), I tried to read their technical specification but it is too thick for me right now... but luckily I found an article called "Introduction to the DWARF debugging format" written by the Chairman of the standardization committee, lucky me . So I am reading that right now. Hopefully I will have another update for you in 2 weeks, see you until then!
    2 points
  3. Unfortunately, I meant exactly what it sounds like: “even“ as in “can you even believe @TheSaint was right ?!”. But I had little choice in the matter, as “even” a cursory analysis will show. First off, please understand the tone and the overarching intent of my entire post: exaggerated self-flagellation. Why would I do that? Consider, here I was, a relative unknown, irreverently Jostling with the OGs, at the same time abusing the sacred “challenge” designation, and smugly pushing my plausible yet ultimately false assertion, to everyone with the possible exception of you. And so to atone properly, the moment required the heartfelt display of extreme and genuine humility, (which is something I have always been quite good at, if I do say so myself). That is where you come in. You see everyone else was arguing from a point of mere brute force logic; but not you, instead you barged thru the door, unannounced, with your copious wit and searing sarcasm on full display, settling scores from untold battles with those in your clan, and then just as quickly, departing, no doubt heading off to more important matters. However, since your post was the only not directly in conflict with my claim, I seized on it as a way to humorously deprecate myself further. And, that is where the word “even” comes in. For if I had said truthfully “No surprise but the TheSaint was proven right again” this would not diminish me as much. But rather I needed to bring you down just a tad so I could squeeze under you “even” further. But now I see I didn’t think it thru enough
    2 points
  4. TheSaint

    PiD “challenge”

    What do you mean, even?
    2 points
  5. if you're tricky enough you can block any key/keys except the function key on a laptop, even the ctrl alt delete can be kind of blocked (depending on the sleep in the loop and the rate the keys are pressed). i've posted a few solutions to similar problems, so i don't want to write the code again, basically, you can use _IsPressed() to see what keys are being pressed and respond accordingly. if an alt key is pressed, send an {ALTUP} and an {ESCAPE}, same for windows key, and for the regular alpha keys, just hotkey out any that you don't want used as in the examples provided. also i'd suggest checking this forum for solutions, because as i said, there have been many examples given for this same problem, except possibly different keys...
    1 point
  6. You can't disable the Windows key or any built-in shortcuts involving it, and while you can disable combinations of ALT+Something, you can't block the ALT key by itself (look in the help files on HotKeySet for details). Here's an example of how to disable ALT+B: HotKeySet("!b","_Dummy") ;The rest of your script goes here Func _Dummy() ;This is a useless function EndFunc If your script is dependent on the user not doing anything while it's running, it might be a better idea to use BlockInput, which kills the mouse and everything on the keyboard except Ctrl-Alt-Del.
    1 point
×
×
  • Create New...