//////////////////////////////////////////////////////////////////////////////////// // // // FreeBASIC Hightlighter, writed by Leandro Daniel Huff - leandrohuff@gmail.com // // FreeBASIC Compiler v0.20.0 - http://www.freebasic.net // // This highlighter is up to date according to the information in // // FB-manual-0.20.0-chm.chm file. // // // //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// // language name Language: FreeBASIC //////////////////////////////////////////////////////////////////////////////////// // default file filter // FreeBASIC files *.bas, *.bi, *.rc, *.fb Filter: FreeBASIC files (*.bas,*.bi,*.rc,*.fb)|*.bas,*.bi,*.rc,*.fb //////////////////////////////////////////////////////////////////////////////////// // help file which will be invokend when F1 is pressed HelpFile: //////////////////////////////////////////////////////////////////////////////////// // language case sensitivity // 0 - no // 1 - yes CaseSensitive: 0 //////////////////////////////////////////////////////////////////////////////////// // comment type: LineComment - comment to the end of line // BlockCommentBeg - block comment begin, it could be multiline // BlockCommentEnd - block comment end LineComment: ' rem BlockCommentBeg: /' BlockCommentEnd: '/ //////////////////////////////////////////////////////////////////////////////////// // identifier characters // note: characters shouldn't be delimited, except arrays // array of chars could be defined as from_char..to_char IdentifierBegChars: a..z A..Z _ IdentifierChars: a..z A..Z _ 0..9 %&!#$ //////////////////////////////////////////////////////////////////////////////////// // numeric constants begin characters // note: characters shouldn't be delimited, except arrays // array of chars could be defined as from_char..to_char // number always starts with 0..9 except when NumConstBeg // defines other NumConstBegChars: & 0..9 //////////////////////////////////////////////////////////////////////////////////// // numeric constants characters // note: characters shouldn't be delimited, except arrays // array of chars could be defined as from_char..to_char // number always starts with 0..9 except when NumConstBeg // defines other NumConstChars: 0..9 abcdefhABCDEFH //////////////////////////////////////////////////////////////////////////////////// // escape character EscapeChar: //////////////////////////////////////////////////////////////////////////////////// // basic keywords table KeyWords1: alias any as asm base byref byval call case cdecl class common constructor continue declare delete destructor dim dinamic do dylibfree dylibload dylibsymbol else elseif end enum escape exit explicit extern field for gosub goto if iif import is let lib loop namespace next new nogosub nokeyword operator option overload pascal private protected property public redim return scope select shared sleep static stdcall step then this to type union until using var wend while with word // Pointers Functions ProcPtr StrPtr VarPtr SAdd //////////////////////////////////////////////////////////////////////////////////// // data types, declarations and modifiers KeyWords2: const pointer ptr function sub unsigned byte //(8-bit signed -128..+127) ubyte //(8-bit unsigned 0..+255) short //(16-bit signed -32768..+32767) ushort //(16-bit unsigned 0..65535) integer //(32-bit signed -2147483648..+2147483647) uinteger //(32-bit unsigned 0..4294967395) long //*(integer or longint) ulong //*(uinteger or ulongint) longint //(64-bit signed -9223372036854775808..+9223372036854775807) ulongint //(64-bit unsigned 0..+18446744073709551615) single //(Single precision +/-2.802597 E-45..+/-3.402823 E+38) double //(Double precision +/-4.490656458412465 E-324..+/-1.797693134862310 E+308) string //(Variable fixed length strings 0..2GB) zstring //(Null terminated strings 0..2GB) wstring //(Wide character strings 0..2GB) // * Long and ULong data types lenth vary with plataform. // casting convertion Cast CByte CDbl CInt CLng CLngInt CPtr CShort CSign CSng CUByte CUInt CULong CULngInt CUnsg CUShort Str Val ValInt ValUInt ValLng ValULng WStr //////////////////////////////////////////////////////////////////////////////////// // runtime library table KeyWords3: // Array Erease LBound Redim Preserve UBound // Bit Manipulation Bit BitReset BitSet HiByte HiWord LoByte LoWord // Console Beep Cls Color CsrLin Locate Pos Print Screen Spc Tat View Width Write // Data and Time Date DateAdd DateDiff DatePart DateSerial DateValue Day Hour IsDate Minute Month MonthName Now Second SetDate SetTime Time TimeSerial TimeValue Timer WeekDay WeekDayNname Year // Debug Support Assert AssertWarn Stop // Error Handling Erfn Erl Ermn Err Error Local On Resume // File IO Access Append Binary BLoad BSave Close Encoding EOF FreeFile Get Input LOC Lock LOF Open Output Random Read Reset Seek Unlock // Graphics Functions Add Alpha Circle Color Custom Draw Flip Get ImageConvertRow ImageCreate ImageDestroy ImageInfo Line Paint Palette PCopy PMap Point PReset PSet Put RGB RGBA Screen ScreenControl ScreenCopy ScreenEvent ScreenInfo ScreenGLProc ScreenList ScreenLock ScreenPtr ScreenRes ScreenSet ScreenSync ScreenUnlock Trans View Window // Hardware Access Inp Out Wait Com Lpt LPos LPrint // Mathematical Abs Acos Asin Atan2 Atn Cos Exp Fix Frac Int Log Ramdomize Rnd Sgn Sin Sqr Tan // Memory Allocate CAllocate Clear Deallocate Fre Peek Poke Reallocate // Miscellaneous Data OffSetOf Restore SizeOf Swap TypeOff // Multithreading CondBroading CondCrate CondDestroy CondSignal CondWait MutexCreate MutexDestroy MutexLock ThreadCrete ThreadWait // Operation System / Shell Chain ChDir Command CurDir Dir Environ Exec ExePath FileAttr FileCopy FileDate FileExist FileLen Kill MkDir Name RmDir Run SetEnviron Shell System Title // String Asc Bin Chr CVD CVI CVL CVLonInt CVS CVShort Format Hex MKD MKI MKL MKLongInt NKS MKShort Oct Str Val ValInt ValLng ValUInt ValULng WBin WChr WHex WOct WStr // String Functions InStr InStrRev LCase Left Len LSet LTrim Mid Right RSet RTrim Space Trim UCase WSpace // User Input GetJoystick GetKey GetMouse Inkey MultiKey SetMouse Stick Strig WInput //////////////////////////////////////////////////////////////////////////////////// // bitwise and short circuit operators KeyWords4: AND //(Conjunction) ANDALSO //(Short circuit conjunction) EQV //(Equivalence) IMP //(Implication) NOT //(Complement) OR //(Disjunction, Inclusive Or) ORELSE //(Short circuit inclusive disjunction) XOR //(Exclusive Or) SHL //(Shift-left) SHR //(Shift-right) MOD //(Modulus) ////////////////////////////////////////////////////////////////////////////// // compiler switches and intrinsic defines KeyWords5: err DefByte DefDbl DefInt DefLng DefLongInt DefShort DefSng DefStr DefUByte DefUInt DefULongInt DefUShort // platform informations __FB_WIN32__ __FB_LINUX__ __FB_DOS__ __FB_CYGWIN__ __FB_FREEBSD__ __FB_XBOX__ __FB_BIGENDIAN__ __FB_SSE__ // version informations __FB_VERSION__ __FB_VER_MAJOR__ __FB_VER_MINOR__ __FB_PATCH__ __FB_MIN_VERSION__ __FB_BUILD_DATE__ __FB_SIGNATURE__ // command line switches __FB_MAIN__ __FB_DEBUG__ __FB_ERR__ __FB_LANG__ __FB_MT__ __FB_OUT_DLL__ __FB_OUT_EXE__ __FB_OUT_LIB__ __FB_OUT_OBJ__ // environment information __FB_ARGC__ __FB_ARGV__ __FB_DATE__ __FB_TIME__ __FB_PATH__ // context (FreeBASIC) specific information __FILE__ __FILE_NQ__ __FUNCTION__ __FUNCTION_NQ__ __LINE__ __FB_OPTION_BYVAL__ __FB_OPTION_DYNAMIC__ __FB_OPTION_ESCAPE__ __FB_OPTION_GOSUB__ __FB_OPTION_EXPLICIT__ __FB_OPTION_PRIVATE__ ////////////////////////////////////////////////////////////////////////////// // string delimiter: StringBegChar - string begin char // StringEndChar - string end char // MultilineStrings - enables multiline strings, as perl // has it StringBegChar: " StringEndChar: " MultilineStrings: 0 ////////////////////////////////////////////////////////////////////////////// // use preprocessor: 0 - no // 1 - yes // note: if yes, '#' and statements after it will be // highlighted with Preprocessor defined colors UsePreprocessor: 1 ////////////////////////////////////////////////////////////////////////////// // highlight line: 0 - no // 1 - yes // note: if yes, current line will be highlighted CurrLineHighlighted: 0 ////////////////////////////////////////////////////////////////////////////// // colors // note: first value is foreground, second is background color // and third (optional) represents font attribute: // B - bold // I - italic // U - underline // S - strike out // attributes can be combined: eg. B or BI // as value, it could be used any standard windows color: // clBlack, clMaroon, clGreen, clOlive, clNavy, // clPurple, clTeal, clGray, clSilver, clRed, clLime, // clYellow, clBlue, clFuchsia, clAqua, clLtGray, // clDkGray, clWhite, clScrollBar, clBackground, // clActiveCaption, clInactiveCaption, clMenu, clWindow, // clWindowFrame, clMenuText, clWindowText, clCaptionText, // clActiveBorder, clInactiveBorder, clAppWorkSpace, // clHighlight, clHighlightText, clBtnFace, clBtnShadow, // clGrayText, clBtnText, clInactiveCaptionText, // clBtnHighlight, cl3DDkShadow, cl3DLight, clInfoText, // clInfoBk // as value, it could be used hex numeric constant too: // $BBGGRR - BB: blue, GG: green, RR: red, eg: $FF6A00 SpaceCol: clWindowText clWindow Keyword1Col: clBlue clWindow Keyword2Col: $00C000C0 clWindow Keyword3Col: clPurple clWindow IdentifierCol: clWindowText clWindow CommentCol: clGreen clWindow I NumberCol: clGreen clWindow StringCol: clWindowText $00FFFFC0 IU SymbolCol: clRed clWindow PreprocessorCol: clRed clWindow SelectionCol: $000000C0 $00C0FFFF CurrentLineCol: clBlack clYellow OverrideTxtFgColor: 0 BlockAutoindent: 0 BlockBegStr: BlockEndStr: MatchedBracesCol: clWindowText clLime Keyword4Col: clFuchsia clWindow Keyword5Col: $000000C0 clWindow B