Jump to content

M4Au3 - M4 Based Macro Preprocessor for AutoIt


AGlassman
 Share

Recommended Posts

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.

Link to comment
Share on other sites

  • 2 years later...

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 by AGlassman
Link to comment
Share on other sites

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 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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...