How does the autoit interpreter do...
#1
Posted 06 May 2011 - 12:25 AM
Been looking through the public bits of the autoit source code, and there are a couple of things I dont understand (probably deriving from my lack of experience with c++)
I was wondering how Autoit Implements...
VARIABLE Lookup and storage:
My guesses is that variables are organised into some sort of ordered linked list, Which is used for lookup. Is this correct?? If not, how is it implemented??
Interrupts:
Functions like HotKeySet can interrupt the execution of the script, calling another function instead. How does autoit do this??
Parser:
Whats the name of the algorithm implemented? Is it the Shift/Reduce Thingy???
Thanks heaps in advance,
-Hyperzap.
@Manadar: I am still studying as well!
#2
Posted 06 May 2011 - 01:33 AM
Edited by Manadar, 06 May 2011 - 01:33 AM.
#3
Posted 06 May 2011 - 02:36 AM
#4
Posted 06 May 2011 - 03:18 AM
Try the file thats cryptically called variable_table.cpp. The parser is a left-to-right parser which implements shunting yard, among other things.
Yes - I have seen variable_table.cpp, what I mean is that I dont understand it, I can see It implements some kind of data structure with pointers to other data structures, which suggests to me that it is a linked list, but then there is more to the story -as some kind of greater than/less than comparision is used (I think), which suggests to me that there is an ordering and lookup system. How this is implemented, what is used as the basis for ordering, what the memory representation actually looks like, is yet to be discovered (assuming of course, that I am right).
Shunting Yard? Really? Its a very LONG implementation. It thought it was an LALR Shift/Reduce Algorithm. Hmmmm.
Any Idea how execution is interrupted? (eg: HotKeySet)??????
Thx.
Edited by hyperzap, 06 May 2011 - 03:18 AM.
#5
Posted 06 May 2011 - 03:20 AM
Magic.
Indeed. But the human body is magic and medical science has allowed us to take the interesting bits out of it as well.
Edited by hyperzap, 06 May 2011 - 03:21 AM.
#6
Posted 06 May 2011 - 10:36 PM
#7
Posted 07 May 2011 - 02:08 AM
It's shift/reduce. The public source code is almost unrecognizable to what it is like now however. The variable look up table IIRC was a linked list but may be a binary tree now for more speed. But at the most basic level, yeah a linked list.
thankyou.
also, how are you doing interrupts? (like when hotkeyset interrupts code execution to run its corresponding function.)???
#8
Posted 07 May 2011 - 07:39 AM
#9
Posted 08 May 2011 - 12:19 PM
I don't know where I'm going, but I'm on my way.
#10
Posted 08 May 2011 - 12:45 PM
If it can be converted (based on rules you define), convert it.
If it can't, error out.
That's how any cast works.
#11
Posted 08 May 2011 - 12:50 PM
I don't know where I'm going, but I'm on my way.
#12
Posted 08 May 2011 - 01:01 PM
Create a variant-class which will be used to store variables. Implement the operators including automatic conversion. If you don't want to do it from scratch, use COM-Varaints as a basis.Yes, but how would you define the rules? That's the bit I'm interested in.
#13
Posted 08 May 2011 - 01:08 PM
I've already done that. I have a variant class that overloads the operators and the only thing I need to do is the conversion/casting itself. Of the conversion and casting I have a header defining the type, which is extended by the variant class to include the data.Create a variant-class which will be used to store variables. Implement the operators including automatic conversion. If you don't want to do it from scratch, use COM-Varaints as a basis.
All I am interested in is the specific process of casting data D from type F to type T, knowing that such a cast is possible, and F != T.
I don't know where I'm going, but I'm on my way.
#14
Posted 08 May 2011 - 07:53 PM
Can convert to string if it's a string, number, or boolean.
Can convert to a number if it's a number. Can parse string for number if you choose. Can optionally convert booleans to 0s and 1s.
Can convert to a boolean using rules like 0/"" = false, everything else = true.
Arrays can't be converted to anything else except maybe strings if they are character arrays.
#15
Posted 08 May 2011 - 08:14 PM
#16
Posted 08 May 2011 - 10:04 PM
We made it up as we went along. It still comes back to haunt us.
Always a good time to renovate.
#17
Posted 09 May 2011 - 03:18 AM
Always a good time to renovate.
It has been a while since a new version of autoit has been released. Autoit v4 has been forshadowed for some time. Is there going to be another version?? if yes what will be included??? how can we contribute??? when will it be released???
If the answer is yes, Im pretty sure there is an army of people who are willing to help out in any way.
#18
Posted 09 May 2011 - 01:45 PM
Edited by Richard Robertson, 09 May 2011 - 03:31 PM.
#19
Posted 09 May 2011 - 03:46 PM
I'm curious. Whose suggestion was to edit the post? Manadar's?People have been talking about v4 since v3 came out.
Edited by trancexx, 09 May 2011 - 03:48 PM.
eMyvnE
#20
Posted 09 May 2011 - 04:20 PM
What did it say earlier? (I forgot)I'm curious. Whose suggestion was to edit the post? Manadar's?
How to Report Bugs Effectively
Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC Shift
Some of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users




