TypeIt Posted December 25, 2014 Share Posted December 25, 2014 I'm writing a translator that translates another program written in something similar to AutoIt into AutoIt. That translator performs a static type check, then removes the type annotations and rewrites expressions and statements that AutoIt does not allow (currently only array literals and names) into something that the AutoIt interpreter will accept.Example:Func Fibonacci (n as number) Return n == 0 ? 1 : n * Fibonacci (n - 1) EndFunc Fibonacci (["array", "of", "strings"]) ; type errorbecomesFunc Fibonacci ($n) Return $n == 0 ? 1 : $n * Fibonacci ($n - 1) EndFunc Local $temp1 = ["array", "of", "strings"] Fibonacci ($temp1)I'm planning to include function overloading and static overload resolution, and maybe a runtime type check for the arguments based on the specified or inferred parameter types. Do you have any other ideas? A link to a random TVTropes page to make this the last post you'll read. Link to comment Share on other sites More sharing options...
jvanegmond Posted December 31, 2014 Share Posted December 31, 2014 Yes, run Tidy on the output. github.com/jvanegmond Link to comment Share on other sites More sharing options...
jaberwacky Posted December 31, 2014 Share Posted December 31, 2014 What is this mystery language that is something similar to AutoIt? Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
TypeIt Posted December 31, 2014 Author Share Posted December 31, 2014 Yes, run Tidy on the output.I'm doing that implicitly. What is this mystery language that is something similar to AutoIt?I'm not sure what you would like to know.Does "in development" count? A link to a random TVTropes page to make this the last post you'll read. Link to comment Share on other sites More sharing options...
jvanegmond Posted December 31, 2014 Share Posted December 31, 2014 Not according to the output in the OP. That's the point I am making. github.com/jvanegmond Link to comment Share on other sites More sharing options...
TypeIt Posted December 31, 2014 Author Share Posted December 31, 2014 Not according to the output in the OP. That's the point I am making. I don't agree with every default of Tidy. The lexer removes whitespace; I'm doing my best to make the output readable. The lexer also removes comments. Before adding new comments I'd like to preserve existing comments. But adding a comment containing the name of the function should be easy. I added an option. A link to a random TVTropes page to make this the last post you'll read. Link to comment Share on other sites More sharing options...
jaberwacky Posted January 1, 2015 Share Posted January 1, 2015 I'm doing that implicitly. I'm not sure what you would like to know. Does "in development" count? Oh cool, it's your own language. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now