AGlassman Posted May 19, 2012 Posted May 19, 2012 I have been searching for a general purpose AutoIt macro preprocessor for some time. I've looked at all the existing implementations I could find, and researched two in detail:Shaggi's implementation of the C Preprocessor "mcpp" ()kjactive's Au3PreProcessor ().But none of these are general enough in scope, or powerful enough in their macro expansion capabilities, to allow the rapid development of domain specific commands or the encapsulation of complex AutoIt constructs that I'm looking for.So, I am currently building a prototype AutoIt preprocessor (tentatively named "M4Au3") based on the GNU M4 macro processor (http://www.gnu.org/software/m4/). My goal is to provide a well defined set of built-in macros that extend the existing AutoIt "@Macro" syntax (but accept arguments) and to allow user defined macros in the same style, e.g. "@MyMacro( Arg1, Arg2 )".If anyone has already tried this approach, or something similar to it, I would be very interested in your results and suggestions.
AGlassman Posted August 10, 2014 Author Posted August 10, 2014 (edited) Update on my continuing search for an AutoIt preprocessor. I have given up on M4. I got as far as doing some simple AutoIt style macros. But as Michael Breen states on http://mbreen.com/m4.html "While m4's textual rescanning approach is conceptually elegant, it can be confusing in practice and demands careful attention to layers of nested quotes". It is just too much work doing M4 macros that consistently work correctly and fit into the AutoIt programming style. Filepp http://freecode.com/projects/filepp a generic Perl-based file preprocessor looked promising. But it lacks essential customization abilities, and the existing code is not easy to modify or maintain. I am currently evaluating GPP http://en.nothingisreal.com/wiki/GPP a general-purpose preprocessor with customizable syntax. I would welcome any input about other attempts to create an AutoIt preprocessor and the tools involved. Edited August 10, 2014 by AGlassman
junkew Posted August 11, 2014 Posted August 11, 2014 With compiler tools like http://www.antlr.org/ and antlrworks you should be able to generate a java or c++ tool doing what you want FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
guinness Posted August 12, 2014 Posted August 12, 2014 (edited) What about PreExpand? I know it's not completely up to par with what you're looking for but it's a start. Check out the link in my signature. It doesn't do anything fancy line #define PI = 3.14, because it uses the existing AutoIt syntax i.e. Global Const $PI = 3.14. Therefore you don't have to process before running in SciTE as the code is already valid. You should check it out. Thanks to Mat for pointing out your thread. Edited August 12, 2014 by guinness UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
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