Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/23/2019 in all areas

  1. Use quicktest.au3 at bottom in your first lexer/parser trials and see how easy it isπŸ˜… I experiment a little with Antlr (using Eclipse/Java) as I am nowadays doing much more with Java. Antlr was new to me and took me a few hours to get it running within Eclipse. With the g4 and visual studio you should also be able to create a C++ lexer/parser (no C lexer/parser seen anymore) Steps to start with this https://github.com/antlr4ide/antlr4ide (just follow the steps with the exception I used latest versions) Install eclipse 2019-09 Install xtext 2.19.0 (just thru the marketplace) Install Faceted Project Framework Install ANTLR 4 IDE (just thru the marketplace) Obtain a copy of antlr-4.x-complete.jar (I have antlr-4.7.2) Create your project (just follow the steps as given on github, read carefully the steps, i did not initially and missed some version stuff) Create the au3.g4 file Create the Au3Runner.java file Rest is "straight forward' Java and eclipse debug/run save as au3.g4 /** * Define a grammar called au3 */ grammar au3; au3program : line+; // match line line: expr+; //From highest precedence to lowest: //Not //^ //* / //+ - //& //< > <= >= = <> == //And Or expr: ID '(' exprList? ')' // func call like f(), f(x), f(1,2) | expr '[' expr ']' // array index like a[i], a[i][j] | '-' expr // unary minus | '!' expr // boolean not | expr (TOK_MULT | TOK_DIV )expr | expr (TOK_PLUS | TOK_MINUS) expr | expr TOK_EQUAL expr // equality comparison (lowest priority op) | ID // variable reference | NUMBER | '(' expr ')' ; exprList : expr (',' expr)* ; // arg list TOK_END : ';' ; TOK_VARIABLE : ('$'?) ID; TOK_MACRO : '@'ID; TOK_PLUS : '+'; TOK_MINUS : '-'; TOK_DIV : '/'; TOK_MULT : '*'; TOK_POW : '^'; TOK_CONCAT : '&'; TOK_PLUS_ASSIGN : '+='; TOK_MINUS_ASSIGN : '-='; TOK_DIV_ASSIGN : '/='; TOK_MULT_ASSIGN : '*='; TOK_CONCAT_ASSIGN : '&='; TOK_LEFTPAREN : '('; TOK_RIGHTPAREN : ')'; TOK_LEFTBRACE : '{'; TOK_RIGHTBRACE : '}'; TOK_LEFTSUBSCRIPT : '['; TOK_RIGHTSUBSCRIPT: ']'; TOK_COMMA : ','; TOK_STRINGEQUAL : '=='; TOK_EQUAL : '='; TOK_NOTEQUAL : '<>'; TOK_LESSEQUAL : '<='; TOK_LESS : '<'; TOK_GREATEREQUAL : '>='; TOK_GREATER : '>'; TOK_DOT : '.'; TOK_INC : '++'; TOK_DEC : '--'; TOK_TILDE : '~'; //TOK_END //TOK_VARIABLE starts with a $ or has a _ in it //TOK_MACRO //TOK_STRING //TOK_INT32 //TOK_DOUBLE ;FLOAT //TOK_INT64 //TOK_FUNCTION //TOK_USERFUNCTION // Fragment rules fragment ExponentPart : [eE] [+-]? Digits ; //fragment EscapeSequence // : '\\' [btnfr"'\\] // | '\\' ([0-3]? [0-7])? [0-7] // | '\\' 'u'+ HexDigit HexDigit HexDigit HexDigit // ; fragment HexDigits : HexDigit ((HexDigit | '_')* HexDigit)? ; fragment HexDigit : [0-9a-fA-F] ; fragment Digits : [0-9] ([0-9_]* [0-9])? ; fragment LetterOrDigit : Letter | [0-9] ; fragment Letter : [a-zA-Z$_]; TAB : '\t' -> skip ; // match but don't pass to the parser //Directives COMMENTSTART : ('#comments-start' | '#cs') ; INCLUDE : '#include'; INCLUDE_ONCE : '#include-once'; NOTRAYICON : '#' N O T R A Y I C O N; ONAUTOITREGISTER : '#OnAutoItRegister'; PRAGMA : '#pragma'; REQUIREADMIN : '#requireadmin'; DIRECTIVEOPERATOR : '#'; //AutoIt supports NUMBERS, STRINGS, BOOLEANS, //BOOLEAN operators AND, OR, NOT //BINARY type (is a result of a function and results into a 0x..... string) //POINTER depends on 32 or 64 bits runtime // CONST and ENUM //Keywords KW_False : F A L S E ; KW_True : T R U E ; KW_ContinueCase : C O N T I N U E C A S E ; KW_ContinueLoop : C O N T I N U E L O O P ; KW_Default : D E F A U L T ; KW_Dim : D I M ; KW_Global : G L O B A L ; KW_Local : L O C A L ; KW_Const : C O N S T ; KW_Do : D O ; KW_Until : U N T I L ; KW_Enum : E N U M ; KW_Exit : E X I T ; KW_ExitLoop : E X I T L O O P ; KW_For : F O R ; KW_To : T O ; KW_Step : S T E P ; KW_In : I N ; KW_Next : N E X T ; KW_Func : F U N C ; KW_Return : R E T U R N ; KW_EndFunc : E N D F U N C ; KW_If : I F ; KW_Then : T H E N ; KW_Elseif : E L S E I F ; KW_Else : E L S E ; KW_Endif : E N D I F ; KW_Null : N U L L ; KW_ReDim : R E D I M ; KW_Select : S E L E C T ; KW_Case : C A S E ; KW_EndSelect : E N D S E L E C T ; KW_Static : S T A T I C ; KW_Switch : S W I T C H ; KW_EndSwitch : E N D S W I T C H ; KW_Volatile : V O L A T I L E ; KW_While : W H I L E ; KW_Wend : W E N D ; KW_With : W I T H ; KW_EndWith : E N D W I T H ; fragment DIGIT : [0-9] ; NUMBER : DIGIT+ ([.,] DIGIT+)? ; FLOAT: DIGIT+ '.' DIGIT* // match 1. 39. 3.14159 etc... | '.' DIGIT+ // match .1 .14159 ; //LINE_COMMENT : '//' .*? '\n' -> skip ; //COMMENT : '/*' .*? '*/' -> skip ; //STRING : '"' .*? '"' ; // match anything in "..." //STRING : '"' (~[\r\n"] | '""')* '"' | '\'' (~[\r\n\'] | '\'\'')* '\''; STRING : '"' (~[\r\n"] | '""')* '"' ; STRING2 : '\'' (~[\r\n'] | '\'\'')* '\'' ; //STRING : '"' ('""' | ~'"')* '"' ; // quote-quote is an escaped quote //STRING2 : '\'' ('""'|~'"')* '\'' ; // quote-quote is an escaped quote //STRING : '"' ( ESC | . )*? '"' ; fragment ESC : ('\\' | '\b' | '\t' | '\n'); // \b, \t, \n etc... //STRING_LITERAL: (STRING_LITERAL1 | STRING_LITERAL2); //STRING_LITERAL1: '"' (LETTER | EscapeSequence)* '"'; //STRING_LITERAL2: '\'' (LETTER | EscapeSequence)* '\''; //EscapeSequence: ('""' | '\'\''); fragment HEX_DIGIT : ('0'..'9' | 'a'..'f' | 'A'..'F') ; fragment LETTER : (LOWERCASE | UPPERCASE); fragment LOWERCASE : [a-z] ; fragment UPPERCASE : [A-Z] ; ID : (LETTER | '_')+(LETTER | DIGIT | '_') ; VARIABLE: '$'ID; MACRO: '@'ID; // au3 keywords // Local, Global and Dim which is not adviced //NEWLINE : ('\r'? '\n' | '\r')+ ; LineComment : '//' ~[\r\n]* -> skip; LineComment2: ';~' ~[\r\n]* -> skip; WS : [ \t\r\n]+ -> skip ; // skip spaces, tabs, newlines //au3 functions F_Abs : A B S ; F_ACos : A C O S ; F_AdlibRegister : A D L I B R E G I S T E R ; F_AdlibUnRegister : A D L I B U N R E G I S T E R ; F_Asc : A S C ; F_AscW : A S C W ; F_ASin : A S I N ; F_Assign : A S S I G N ; F_ATan : A T A N ; F_AutoItSetOption : A U T O I T S E T O P T I O N ; F_AutoItWinGetTitle : A U T O I T W I N G E T T I T L E ; F_AutoItWinSetTitle : A U T O I T W I N S E T T I T L E ; F_Beep : B E E P ; F_Binary : B I N A R Y ; F_BinaryLen : B I N A R Y L E N ; F_BinaryMid : B I N A R Y M I D ; F_BinaryToString : B I N A R Y T O S T R I N G ; F_BitAND : B I T A N D ; F_BitNOT : B I T N O T ; F_BitOR : B I T O R ; F_BitRotate : B I T R O T A T E ; F_BitShift : B I T S H I F T ; F_BitXOR : B I T X O R ; F_BlockInput : B L O C K I N P U T ; F_Break : B R E A K ; F_Call : C A L L ; F_CDTray : C D T R A Y ; F_Ceiling : C E I L I N G ; F_Chr : C H R ; F_ChrW : C H R W ; F_ClipGet : C L I P G E T ; F_ClipPut : C L I P P U T ; F_ConsoleRead : C O N S O L E R E A D ; F_ConsoleWrite : C O N S O L E W R I T E ; F_ConsoleWriteError : C O N S O L E W R I T E E R R O R ; F_ControlClick : C O N T R O L C L I C K ; F_ControlCommand : C O N T R O L C O M M A N D ; F_ControlDisable : C O N T R O L D I S A B L E ; F_ControlEnable : C O N T R O L E N A B L E ; F_ControlFocus : C O N T R O L F O C U S ; F_ControlGetFocus : C O N T R O L G E T F O C U S ; F_ControlGetHandle : C O N T R O L G E T H A N D L E ; F_ControlGetPos : C O N T R O L G E T P O S ; F_ControlGetText : C O N T R O L G E T T E X T ; F_ControlHide : C O N T R O L H I D E ; F_ControlListView : C O N T R O L L I S T V I E W ; F_ControlMove : C O N T R O L M O V E ; F_ControlSend : C O N T R O L S E N D ; F_ControlSetText : C O N T R O L S E T T E X T ; F_ControlShow : C O N T R O L S H O W ; F_ControlTreeView : C O N T R O L T R E E V I E W ; F_Cos : C O S ; F_Dec : D E C ; F_DirCopy : D I R C O P Y ; F_DirCreate : D I R C R E A T E ; F_DirGetSize : D I R G E T S I Z E ; F_DirMove : D I R M O V E ; F_DirRemove : D I R R E M O V E ; F_DllCall : D L L C A L L ; F_DllCallAddress : D L L C A L L A D D R E S S ; F_DllCallbackFree : D L L C A L L B A C K F R E E ; F_DllCallbackGetPtr : D L L C A L L B A C K G E T P T R ; F_DllCallbackRegister : D L L C A L L B A C K R E G I S T E R ; F_DllClose : D L L C L O S E ; F_DllOpen : D L L O P E N ; F_DllStructCreate : D L L S T R U C T C R E A T E ; F_DllStructGetData : D L L S T R U C T G E T D A T A ; F_DllStructGetPtr : D L L S T R U C T G E T P T R ; F_DllStructGetSize : D L L S T R U C T G E T S I Z E ; F_DllStructSetData : D L L S T R U C T S E T D A T A ; F_DriveGetDrive : D R I V E G E T D R I V E ; F_DriveGetFileSystem : D R I V E G E T F I L E S Y S T E M ; F_DriveGetLabel : D R I V E G E T L A B E L ; F_DriveGetSerial : D R I V E G E T S E R I A L ; F_DriveGetType : D R I V E G E T T Y P E ; F_DriveMapAdd : D R I V E M A P A D D ; F_DriveMapDel : D R I V E M A P D E L ; F_DriveMapGet : D R I V E M A P G E T ; F_DriveSetLabel : D R I V E S E T L A B E L ; F_DriveSpaceFree : D R I V E S P A C E F R E E ; F_DriveSpaceTotal : D R I V E S P A C E T O T A L ; F_DriveStatus : D R I V E S T A T U S ; F_EnvGet : E N V G E T ; F_EnvSet : E N V S E T ; F_EnvUpdate : E N V U P D A T E ; F_Eval : E V A L ; F_Execute : E X E C U T E ; F_Exp : E X P ; F_FileChangeDir : F I L E C H A N G E D I R ; F_FileClose : F I L E C L O S E ; F_FileCopy : F I L E C O P Y ; F_FileCreateNTFSLink : F I L E C R E A T E N T F S L I N K ; F_FileCreateShortcut : F I L E C R E A T E S H O R T C U T ; F_FileDelete : F I L E D E L E T E ; F_FileExists : F I L E E X I S T S ; F_FileFindFirstFile : F I L E F I N D F I R S T F I L E ; F_FileFindNextFile : F I L E F I N D N E X T F I L E ; F_FileFlush : F I L E F L U S H ; F_FileGetAttrib : F I L E G E T A T T R I B ; F_FileGetEncoding : F I L E G E T E N C O D I N G ; F_FileGetLongName : F I L E G E T L O N G N A M E ; F_FileGetPos : F I L E G E T P O S ; F_FileGetShortcut : F I L E G E T S H O R T C U T ; F_FileGetShortName : F I L E G E T S H O R T N A M E ; F_FileGetSize : F I L E G E T S I Z E ; F_FileGetTime : F I L E G E T T I M E ; F_FileGetVersion : F I L E G E T V E R S I O N ; F_FileInstall : F I L E I N S T A L L ; F_FileMove : F I L E M O V E ; F_FileOpen : F I L E O P E N ; F_FileOpenDialog : F I L E O P E N D I A L O G ; F_FileRead : F I L E R E A D ; F_FileReadLine : F I L E R E A D L I N E ; F_FileReadToArray : F I L E R E A D T O A R R A Y ; F_FileRecycle : F I L E R E C Y C L E ; F_FileRecycleEmpty : F I L E R E C Y C L E E M P T Y ; F_FileSaveDialog : F I L E S A V E D I A L O G ; F_FileSelectFolder : F I L E S E L E C T F O L D E R ; F_FileSetAttrib : F I L E S E T A T T R I B ; F_FileSetEnd : F I L E S E T E N D ; F_FileSetPos : F I L E S E T P O S ; F_FileSetTime : F I L E S E T T I M E ; F_FileWrite : F I L E W R I T E ; F_FileWriteLine : F I L E W R I T E L I N E ; F_Floor : F L O O R ; F_FtpSetProxy : F T P S E T P R O X Y ; F_FuncName : F U N C N A M E ; F_GUICreate : G U I C R E A T E ; F_GUICtrlCreateAvi : G U I C T R L C R E A T E A V I ; F_GUICtrlCreateButton : G U I C T R L C R E A T E B U T T O N ; F_GUICtrlCreateCheckbox : G U I C T R L C R E A T E C H E C K B O X ; F_GUICtrlCreateCombo : G U I C T R L C R E A T E C O M B O ; F_GUICtrlCreateContextMenu : G U I C T R L C R E A T E C O N T E X T M E N U ; F_GUICtrlCreateDate : G U I C T R L C R E A T E D A T E ; F_GUICtrlCreateDummy : G U I C T R L C R E A T E D U M M Y ; F_GUICtrlCreateEdit : G U I C T R L C R E A T E E D I T ; F_GUICtrlCreateGraphic : G U I C T R L C R E A T E G R A P H I C ; F_GUICtrlCreateGroup : G U I C T R L C R E A T E G R O U P ; F_GUICtrlCreateIcon : G U I C T R L C R E A T E I C O N ; F_GUICtrlCreateInput : G U I C T R L C R E A T E I N P U T ; F_GUICtrlCreateLabel : G U I C T R L C R E A T E L A B E L ; F_GUICtrlCreateList : G U I C T R L C R E A T E L I S T ; F_GUICtrlCreateListView : G U I C T R L C R E A T E L I S T V I E W ; F_GUICtrlCreateListViewItem : G U I C T R L C R E A T E L I S T V I E W I T E M ; F_GUICtrlCreateMenu : G U I C T R L C R E A T E M E N U ; F_GUICtrlCreateMenuItem : G U I C T R L C R E A T E M E N U I T E M ; F_GUICtrlCreateMonthCal : G U I C T R L C R E A T E M O N T H C A L ; F_GUICtrlCreateObj : G U I C T R L C R E A T E O B J ; F_GUICtrlCreatePic : G U I C T R L C R E A T E P I C ; F_GUICtrlCreateProgress : G U I C T R L C R E A T E P R O G R E S S ; F_GUICtrlCreateRadio : G U I C T R L C R E A T E R A D I O ; F_GUICtrlCreateSlider : G U I C T R L C R E A T E S L I D E R ; F_GUICtrlCreateTab : G U I C T R L C R E A T E T A B ; F_GUICtrlCreateTabItem : G U I C T R L C R E A T E T A B I T E M ; F_GUICtrlCreateTreeView : G U I C T R L C R E A T E T R E E V I E W ; F_GUICtrlCreateTreeViewItem : G U I C T R L C R E A T E T R E E V I E W I T E M ; F_GUICtrlCreateUpdown : G U I C T R L C R E A T E U P D O W N ; F_GUICtrlDelete : G U I C T R L D E L E T E ; F_GUICtrlGetHandle : G U I C T R L G E T H A N D L E ; F_GUICtrlGetState : G U I C T R L G E T S T A T E ; F_GUICtrlRead : G U I C T R L R E A D ; F_GUICtrlRecvMsg : G U I C T R L R E C V M S G ; F_GUICtrlRegisterListViewSort : G U I C T R L R E G I S T E R L I S T V I E W S O R T ; F_GUICtrlSendMsg : G U I C T R L S E N D M S G ; F_GUICtrlSendToDummy : G U I C T R L S E N D T O D U M M Y ; F_GUICtrlSetBkColor : G U I C T R L S E T B K C O L O R ; F_GUICtrlSetColor : G U I C T R L S E T C O L O R ; F_GUICtrlSetCursor : G U I C T R L S E T C U R S O R ; F_GUICtrlSetData : G U I C T R L S E T D A T A ; F_GUICtrlSetDefBkColor : G U I C T R L S E T D E F B K C O L O R ; F_GUICtrlSetDefColor : G U I C T R L S E T D E F C O L O R ; F_GUICtrlSetFont : G U I C T R L S E T F O N T ; F_GUICtrlSetGraphic : G U I C T R L S E T G R A P H I C ; F_GUICtrlSetImage : G U I C T R L S E T I M A G E ; F_GUICtrlSetLimit : G U I C T R L S E T L I M I T ; F_GUICtrlSetOnEvent : G U I C T R L S E T O N E V E N T ; F_GUICtrlSetPos : G U I C T R L S E T P O S ; F_GUICtrlSetResizing : G U I C T R L S E T R E S I Z I N G ; F_GUICtrlSetState : G U I C T R L S E T S T A T E ; F_GUICtrlSetStyle : G U I C T R L S E T S T Y L E ; F_GUICtrlSetTip : G U I C T R L S E T T I P ; F_GUIDelete : G U I D E L E T E ; F_GUIGetCursorInfo : G U I G E T C U R S O R I N F O ; F_GUIGetMsg : G U I G E T M S G ; F_GUIGetStyle : G U I G E T S T Y L E ; F_GUIRegisterMsg : G U I R E G I S T E R M S G ; F_GUISetAccelerators : G U I S E T A C C E L E R A T O R S ; F_GUISetBkColor : G U I S E T B K C O L O R ; F_GUISetCoord : G U I S E T C O O R D ; F_GUISetCursor : G U I S E T C U R S O R ; F_GUISetFont : G U I S E T F O N T ; F_GUISetHelp : G U I S E T H E L P ; F_GUISetIcon : G U I S E T I C O N ; F_GUISetOnEvent : G U I S E T O N E V E N T ; F_GUISetState : G U I S E T S T A T E ; F_GUISetStyle : G U I S E T S T Y L E ; F_GUIStartGroup : G U I S T A R T G R O U P ; F_GUISwitch : G U I S W I T C H ; F_Hex : H E X ; F_HotKeySet : H O T K E Y S E T ; F_HttpSetProxy : H T T P S E T P R O X Y ; F_HttpSetUserAgent : H T T P S E T U S E R A G E N T ; F_HWnd : H W N D ; F_InetClose : I N E T C L O S E ; F_InetGet : I N E T G E T ; F_InetGetInfo : I N E T G E T I N F O ; F_InetGetSize : I N E T G E T S I Z E ; F_InetRead : I N E T R E A D ; F_IniDelete : I N I D E L E T E ; F_IniRead : I N I R E A D ; F_IniReadSection : I N I R E A D S E C T I O N ; F_IniReadSectionNames : I N I R E A D S E C T I O N N A M E S ; F_IniRenameSection : I N I R E N A M E S E C T I O N ; F_IniWrite : I N I W R I T E ; F_IniWriteSection : I N I W R I T E S E C T I O N ; F_InputBox : I N P U T B O X ; F_Int : I N T ; F_IsAdmin : I S A D M I N ; F_IsArray : I S A R R A Y ; F_IsBinary : I S B I N A R Y ; F_IsBool : I S B O O L ; F_IsDeclared : I S D E C L A R E D ; F_IsDllStruct : I S D L L S T R U C T ; F_IsFloat : I S F L O A T ; F_IsFunc : I S F U N C ; F_IsHWnd : I S H W N D ; F_IsInt : I S I N T ; F_IsKeyword : I S K E Y W O R D ; F_IsNumber : I S N U M B E R ; F_IsObj : I S O B J ; F_IsPtr : I S P T R ; F_IsString : I S S T R I N G ; F_Log : L O G ; F_MemGetStats : M E M G E T S T A T S ; F_Mod : M O D ; F_MouseClick : M O U S E C L I C K ; F_MouseClickDrag : M O U S E C L I C K D R A G ; F_MouseDown : M O U S E D O W N ; F_MouseGetCursor : M O U S E G E T C U R S O R ; F_MouseGetPos : M O U S E G E T P O S ; F_MouseMove : M O U S E M O V E ; F_MouseUp : M O U S E U P ; F_MouseWheel : M O U S E W H E E L ; F_MsgBox : M S G B O X ; F_Number : N U M B E R ; F_ObjCreate : O B J C R E A T E ; F_ObjCreateInterface : O B J C R E A T E I N T E R F A C E ; F_ObjEvent : O B J E V E N T ; F_ObjGet : O B J G E T ; F_ObjName : O B J N A M E ; F_OnAutoItExitRegister : O N A U T O I T E X I T R E G I S T E R ; F_OnAutoItExitUnRegister : O N A U T O I T E X I T U N R E G I S T E R ; F_Ping : P I N G ; F_PixelChecksum : P I X E L C H E C K S U M ; F_PixelGetColor : P I X E L G E T C O L O R ; F_PixelSearch : P I X E L S E A R C H ; F_ProcessClose : P R O C E S S C L O S E ; F_ProcessExists : P R O C E S S E X I S T S ; F_ProcessGetStats : P R O C E S S G E T S T A T S ; F_ProcessList : P R O C E S S L I S T ; F_ProcessSetPriority : P R O C E S S S E T P R I O R I T Y ; F_ProcessWait : P R O C E S S W A I T ; F_ProcessWaitClose : P R O C E S S W A I T C L O S E ; F_ProgressOff : P R O G R E S S O F F ; F_ProgressOn : P R O G R E S S O N ; F_ProgressSet : P R O G R E S S S E T ; F_Ptr : P T R ; F_Random : R A N D O M ; F_RegDelete : R E G D E L E T E ; F_RegEnumKey : R E G E N U M K E Y ; F_RegEnumVal : R E G E N U M V A L ; F_RegRead : R E G R E A D ; F_RegWrite : R E G W R I T E ; F_Round : R O U N D ; F_Run : R U N ; F_RunAs : R U N A S ; F_RunAsWait : R U N A S W A I T ; F_RunWait : R U N W A I T ; F_Send : S E N D ; F_SendKeepActive : S E N D K E E P A C T I V E ; F_SetError : S E T E R R O R ; F_SetExtended : S E T E X T E N D E D ; F_ShellExecute : S H E L L E X E C U T E ; F_ShellExecuteWait : S H E L L E X E C U T E W A I T ; F_Shutdown : S H U T D O W N ; F_Sin : S I N ; F_Sleep : S L E E P ; F_SoundPlay : S O U N D P L A Y ; F_SoundSetWaveVolume : S O U N D S E T W A V E V O L U M E ; F_SplashImageOn : S P L A S H I M A G E O N ; F_SplashOff : S P L A S H O F F ; F_SplashTextOn : S P L A S H T E X T O N ; F_Sqrt : S Q R T ; F_SRandom : S R A N D O M ; F_StatusbarGetText : S T A T U S B A R G E T T E X T ; F_StderrRead : S T D E R R R E A D ; F_StdinWrite : S T D I N W R I T E ; F_StdioClose : S T D I O C L O S E ; F_StdoutRead : S T D O U T R E A D ; F_String : S T R I N G ; F_StringAddCR : S T R I N G A D D C R ; F_StringCompare : S T R I N G C O M P A R E ; F_StringFormat : S T R I N G F O R M A T ; F_StringFromASCIIArray : S T R I N G F R O M A S C I I A R R A Y ; F_StringInStr : S T R I N G I N S T R ; F_StringIsAlNum : S T R I N G I S A L N U M ; F_StringIsAlpha : S T R I N G I S A L P H A ; F_StringIsASCII : S T R I N G I S A S C I I ; F_StringIsDigit : S T R I N G I S D I G I T ; F_StringIsFloat : S T R I N G I S F L O A T ; F_StringIsInt : S T R I N G I S I N T ; F_StringIsLower : S T R I N G I S L O W E R ; F_StringIsSpace : S T R I N G I S S P A C E ; F_StringIsUpper : S T R I N G I S U P P E R ; F_StringIsXDigit : S T R I N G I S X D I G I T ; F_StringLeft : S T R I N G L E F T ; F_StringLen : S T R I N G L E N ; F_StringLower : S T R I N G L O W E R ; F_StringMid : S T R I N G M I D ; F_StringRegExp : S T R I N G R E G E X P ; F_StringRegExpReplace : S T R I N G R E G E X P R E P L A C E ; F_StringReplace : S T R I N G R E P L A C E ; F_StringReverse : S T R I N G R E V E R S E ; F_StringRight : S T R I N G R I G H T ; F_StringSplit : S T R I N G S P L I T ; F_StringStripCR : S T R I N G S T R I P C R ; F_StringStripWS : S T R I N G S T R I P W S ; F_StringToASCIIArray : S T R I N G T O A S C I I A R R A Y ; F_StringToBinary : S T R I N G T O B I N A R Y ; F_StringTrimLeft : S T R I N G T R I M L E F T ; F_StringTrimRight : S T R I N G T R I M R I G H T ; F_StringUpper : S T R I N G U P P E R ; F_Tan : T A N ; F_TCPAccept : T C P A C C E P T ; F_TCPCloseSocket : T C P C L O S E S O C K E T ; F_TCPConnect : T C P C O N N E C T ; F_TCPListen : T C P L I S T E N ; F_TCPNameToIP : T C P N A M E T O I P ; F_TCPRecv : T C P R E C V ; F_TCPSend : T C P S E N D ; F_TCPShutdown : T C P S H U T D O W N ; F_UDPShutdown : U D P S H U T D O W N ; F_TCPStartup : T C P S T A R T U P ; F_UDPStartup : U D P S T A R T U P ; F_TimerDiff : T I M E R D I F F ; F_TimerInit : T I M E R I N I T ; F_ToolTip : T O O L T I P ; F_TrayCreateItem : T R A Y C R E A T E I T E M ; F_TrayCreateMenu : T R A Y C R E A T E M E N U ; F_TrayGetMsg : T R A Y G E T M S G ; F_TrayItemDelete : T R A Y I T E M D E L E T E ; F_TrayItemGetHandle : T R A Y I T E M G E T H A N D L E ; F_TrayItemGetState : T R A Y I T E M G E T S T A T E ; F_TrayItemGetText : T R A Y I T E M G E T T E X T ; F_TrayItemSetOnEvent : T R A Y I T E M S E T O N E V E N T ; F_TrayItemSetState : T R A Y I T E M S E T S T A T E ; F_TrayItemSetText : T R A Y I T E M S E T T E X T ; F_TraySetClick : T R A Y S E T C L I C K ; F_TraySetIcon : T R A Y S E T I C O N ; F_TraySetOnEvent : T R A Y S E T O N E V E N T ; F_TraySetPauseIcon : T R A Y S E T P A U S E I C O N ; F_TraySetState : T R A Y S E T S T A T E ; F_TraySetToolTip : T R A Y S E T T O O L T I P ; F_TrayTip : T R A Y T I P ; F_UBound : U B O U N D ; F_UDPBind : U D P B I N D ; F_UDPCloseSocket : U D P C L O S E S O C K E T ; F_UDPOpen : U D P O P E N ; F_UDPRecv : U D P R E C V ; F_UDPSend : U D P S E N D ; F_VarGetType : V A R G E T T Y P E ; F_WinActivate : W I N A C T I V A T E ; F_WinActive : W I N A C T I V E ; F_WinClose : W I N C L O S E ; F_WinExists : W I N E X I S T S ; F_WinFlash : W I N F L A S H ; F_WinGetCaretPos : W I N G E T C A R E T P O S ; F_WinGetClassList : W I N G E T C L A S S L I S T ; F_WinGetClientSize : W I N G E T C L I E N T S I Z E ; F_WinGetHandle : W I N G E T H A N D L E ; F_WinGetPos : W I N G E T P O S ; F_WinGetProcess : W I N G E T P R O C E S S ; F_WinGetState : W I N G E T S T A T E ; F_WinGetText : W I N G E T T E X T ; F_WinGetTitle : W I N G E T T I T L E ; F_WinKill : W I N K I L L ; F_WinList : W I N L I S T ; F_WinMenuSelectItem : W I N M E N U S E L E C T I T E M ; F_WinMinimizeAll : W I N M I N I M I Z E A L L ; F_WinMinimizeAllUndo : W I N M I N I M I Z E A L L U N D O ; F_WinMove : W I N M O V E ; F_WinSetOnTop : W I N S E T O N T O P ; F_WinSetState : W I N S E T S T A T E ; F_WinSetTitle : W I N S E T T I T L E ; F_WinSetTrans : W I N S E T T R A N S ; F_WinWait : W I N W A I T ; F_WinWaitActive : W I N W A I T A C T I V E ; F_WinWaitClose : W I N W A I T C L O S E ; F_WinWaitNotActive : W I N W A I T N O T A C T I V E ; // case insensitive chars fragment A:('a'|'A'); fragment B:('b'|'B'); fragment C:('c'|'C'); fragment D:('d'|'D'); fragment E:('e'|'E'); fragment F:('f'|'F'); fragment G:('g'|'G'); fragment H:('h'|'H'); fragment I:('i'|'I'); fragment J:('j'|'J'); fragment K:('k'|'K'); fragment L:('l'|'L'); fragment M:('m'|'M'); fragment N:('n'|'N'); fragment O:('o'|'O'); fragment P:('p'|'P'); fragment Q:('q'|'Q'); fragment R:('r'|'R'); fragment S:('s'|'S'); fragment T:('t'|'T'); fragment U:('u'|'U'); fragment V:('v'|'V'); fragment W:('w'|'W'); fragment X:('x'|'X'); fragment Y:('y'|'Y'); fragment Z:('z'|'Z'); test java program to see if files tokenizes in a decent way import java.nio.file.Paths; import org.antlr.v4.runtime.*; import org.antlr.v4.runtime.tree.*; public class Au3Runner { public static void main(String[] args) throws Exception { CharStream charStream = CharStreams.fromPath(Paths.get(args[0])); Lexer lexer = new au3Lexer(charStream); CommonTokenStream tokens = new CommonTokenStream(lexer); tokens.fill(); for (Token token : tokens.getTokens()) { System.out.println("Got token: " + token.toString()); // System.out.println("'" + token.getText() + "<" + token.getType() + ">' "); } } } quicktest.au3 file that I feed as a file to lex consolewrite("a str a" & @CRLF) consolewrite('b str b' & @CRLF) consolewrite("c str "" c" & @CRLF) consolewrite('d str '' d' & @CRLF) consolewrite('e str " e' & @CRLF) consolewrite("f str ' f" & @CRLF) consolewrite('e str "" e' & @CRLF) consolewrite("f str '' f" & @CRLF) ;~ consolewrite('g str ' g' & @CRLF) ;~ consolewrite("h str " h" & @CRLF) #comments-start #ce consolewrite("Below is an alphabetized list of all the macros available in AutoIt.") consolewrite(@appdatacommondir & @CRLF) consolewrite(@appdatadir & @CRLF) consolewrite(@autoitexe & @CRLF) consolewrite(@autoitpid & @CRLF) consolewrite(@autoitversion & @CRLF) consolewrite(@autoitx64 & @CRLF) ;~ consolewrite(@com_eventobj & @CRLF) consolewrite(@commonfilesdir & @CRLF) consolewrite(@compiled & @CRLF) consolewrite(@computername & @CRLF) consolewrite(@comspec & @CRLF) consolewrite(@cpuarch & @CRLF) consolewrite(@cr & @CRLF) consolewrite(@crlf & @CRLF) consolewrite(@desktopcommondir & @CRLF) consolewrite(@desktopdepth & @CRLF) consolewrite(@desktopdir & @CRLF) consolewrite(@desktopheight & @CRLF) consolewrite(@desktoprefresh & @CRLF) consolewrite(@desktopwidth & @CRLF) consolewrite(@documentscommondir & @CRLF) consolewrite(@error & @CRLF) ;~ consolewrite(@exitcode & @CRLF) ;~ consolewrite(@exitmethod & @CRLF) consolewrite(@extended & @CRLF) consolewrite(@favoritescommondir & @CRLF) consolewrite(@favoritesdir & @CRLF) ;~ consolewrite(@gui_ctrlhandle & @CRLF) ;~ consolewrite(@gui_ctrlid & @CRLF) ;~ consolewrite(@gui_dragfile & @CRLF) ;~ consolewrite(@gui_dragid & @CRLF) ;~ consolewrite(@gui_dropid & @CRLF) ;~ consolewrite(@gui_winhandle & @CRLF) consolewrite(@homedrive & @CRLF) consolewrite(@homepath & @CRLF) consolewrite(@homeshare & @CRLF) consolewrite(@hotkeypressed & @CRLF) consolewrite(@hour & @CRLF) consolewrite(@ipaddress1 & @CRLF) consolewrite(@ipaddress2 & @CRLF) consolewrite(@ipaddress3 & @CRLF) consolewrite(@ipaddress4 & @CRLF) consolewrite(@kblayout & @CRLF) consolewrite(@lf & @CRLF) consolewrite(@localappdatadir & @CRLF) consolewrite(@logondnsdomain & @CRLF) consolewrite(@logondomain & @CRLF) consolewrite(@logonserver & @CRLF) consolewrite(@mday & @CRLF) consolewrite(@min & @CRLF) consolewrite(@mon & @CRLF) consolewrite(@msec & @CRLF) consolewrite(@muilang & @CRLF) consolewrite(@mydocumentsdir & @CRLF) consolewrite(@numparams & @CRLF) consolewrite(@osarch & @CRLF) consolewrite(@osbuild & @CRLF) consolewrite(@oslang & @CRLF) consolewrite(@osservicepack & @CRLF) consolewrite(@ostype & @CRLF) consolewrite(@osversion & @CRLF) consolewrite(@programfilesdir & @CRLF) consolewrite(@programscommondir & @CRLF) consolewrite(@programsdir & @CRLF) consolewrite(@scriptdir & @CRLF) consolewrite(@scriptfullpath & @CRLF) consolewrite(@scriptlinenumber & @CRLF) consolewrite(@scriptname & @CRLF) consolewrite(@sec & @CRLF) consolewrite(@startmenucommondir & @CRLF) consolewrite(@startmenudir & @CRLF) consolewrite(@startupcommondir & @CRLF) consolewrite(@startupdir & @CRLF) consolewrite(@sw_disable & @CRLF) consolewrite(@sw_enable & @CRLF) consolewrite(@sw_hide & @CRLF) consolewrite(@sw_lock & @CRLF) consolewrite(@sw_maximize & @CRLF) consolewrite(@sw_minimize & @CRLF) consolewrite(@sw_restore & @CRLF) consolewrite(@sw_show & @CRLF) consolewrite(@sw_showdefault & @CRLF) consolewrite(@sw_showmaximized & @CRLF) consolewrite(@sw_showminimized & @CRLF) consolewrite(@sw_showminnoactive & @CRLF) consolewrite(@sw_showna & @CRLF) consolewrite(@sw_shownoactivate & @CRLF) consolewrite(@sw_shownormal & @CRLF) consolewrite(@sw_unlock & @CRLF) consolewrite(@systemdir & @CRLF) consolewrite(@tab & @CRLF) consolewrite(@tempdir & @CRLF) ;~ consolewrite(@tray_id & @CRLF) consolewrite(@trayiconflashing & @CRLF) consolewrite(@trayiconvisible & @CRLF) consolewrite(@username & @CRLF) consolewrite(@userprofiledir & @CRLF) consolewrite(@wday & @CRLF) consolewrite(@windowsdir & @CRLF) consolewrite(@workingdir & @CRLF) consolewrite(@yday & @CRLF) consolewrite(@year & @CRLF)
    2 points
  2. water

    AD - Active Directory UDF

    Version 1.6.3.0

    17,300 downloads

    Extensive library to control and manipulate Microsoft Active Directory. Threads: Development - General Help & Support - Example Scripts - Wiki Previous downloads: 30467 Known Bugs: (last changed: 2020-10-05) None Things to come: (last changed: 2020-07-21) None BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort
    1 point
  3. Your questions are slightly unclear. Have a look at the gorgeous WinHttp.au3 from @trancexx : https://github.com/dragana-r/autoit-winhttp/releases (also contains a help file with examples)
    1 point
  4. Version 0.7.0.0 released Changelog can be found on the download page and the history in the ZIP file. For download please see my signature below. Please play with this version and tell me what doesn't work or is missing!
    1 point
  5. I'd like to start by saying that I've experienced pretty much everything that has been mentioned in this thread - quarantined exes for completely innocuous code, compiled exes flagged as infected months or years after they've been sitting idle in an archive folder, the same script being flagged intermittently each time I compile it, you name it. I knew that would be unacceptable if we released our product in that condition so I researched for many days (probably weeks) before our initial release. This is the route we ended up choosing and I honestly couldn't be happier with the results. After we started signing all of our executables using a reputable code signing cert we no longer get flagged by Windows Defender - even using UPX with maximum compression. We've had rare issues with other AV providers but they've been so rare (easily less than 10 total over the past 18 months) it's really been a non-issue. If you already have a corporation setup I highly recommend doing this sooner rather than later. To be upfront, it does have a cost - both in time (generally 1-4 weeks from application to receiving your cert) and money (<$100/year) - but user trust and peace of mind are (very nearly) priceless. Once you have the code signing cert downloaded and installed you can simply add a line to the top of your script to have SciTE automatically sign your newly compiled exe as the final step in the compile process. Something like this: #AutoIt3Wrapper_Run_After=""%ProgramFiles(x86)%\Windows Kits\....\signtool.exe" sign /tr http://timestamp.comodoca.com/?td=sha384 /td SHA384 /a "%out%"" Also, if you have concerns about Windows Defender being reliable and accurate AV software you can let those concerns go. While it's true Windows Defender has had issues in the past, they were in the beginning of Microsoft's attempts at AV and things have improved significantly since then. If you want to check it out for yourself you can Google it or go here: https://www.techspot.com/news/81396-windows-defender-ranked-joint-best-antivirus-program.html (Fyi, up until about 5 years ago I'd been in IT for >20 years doing anywhere from tech support to Windows/Network Admin. In other words, basically dealing with viruses/rootkits/malware/ransomware on a daily basis because of users or customers lacking the wherewithal to not click the link in the email from an unknown source claiming their inheritance is waiting. πŸ€¦β€β™‚οΈ) Edit: Btw, in case anyone does want to go this route I can recommend https://www.thesslstore.com/. I'm not affiliated with them in any way except for that's where I purchased our cert from and I can attest that we received it and it works exactly as I've described. We went with the standard Comodo Code Signing cert. The EV certs are more expensive because they require more background evaluation to be done to verify the entity applying for the cert. It may be advantageous in particular circumstances but isn't necessary to simply avoid AV quarantine. Also, the other unmentioned advantage is your exes are now digitally signed. While for most customers this won't make a difference, if you're using your scripts in a corporate environment this may be a major peace-of-mind bonus since it's easy to verify the authenticity of your exes and they have certain assurances the exes haven't been tampered with. πŸ‘
    1 point
  6. you have an option to use Label or Edit control to show script try this piece of code: $control = GUICtrlCreateEdit("",10,10,200,200) $data = FileRead("Install.vbs") ; read whole file GUICtrlSetData($control,$data)
    1 point
×
×
  • Create New...