Skip to content

Instantly share code, notes, and snippets.

@lionelyoung
Created December 6, 2017 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lionelyoung/c1d1a5dff88628e217e299a950f8d64f to your computer and use it in GitHub Desktop.
Save lionelyoung/c1d1a5dff88628e217e299a950f8d64f to your computer and use it in GitHub Desktop.
easylanguage-mode
;; easylanguage mode
;; https://www.emacswiki.org/emacs/GenericMode
;; too many members for the default specpdlsize
;; still missing some options, processed via
;; #!/bin/sh
;; cat $1 | awk '{ print $1 }' | tr -d ";" | grep = | cut -f1 -d= | sort -u | while read x; do echo -n "\"$x\" "; done
(setq max-specpdl-size 6000)
(define-generic-mode 'easylanguage-mode
;; comments
'("//")
;; keywords
'("IF" "BEGIN" "END" "THEN" "AND" "INPUTS" "ARRAY" "VARS" "OPEN" "HIGH" "LOW" "CLOSE" "FOR" "TO" "ELSE" "TRUE" "FALSE"
"#BEGINALERT"
"#BEGINCMTRY"
"#BEGINCMTRYORALERT"
"#END"
"#EVENTS"
"A"
"AB_AddCell"
"AB_GetCellChar"
"AB_GetCellColor"
"AB_GetCellDate"
"AB_GetCellTime"
"AB_GetCellValue"
"AB_GetNumCells"
"AB_GetZoneHigh"
"AB_GetZoneLow"
"AB_High"
"AB_Low"
"AB_RemoveCell"
"AB_RowHeight"
"AB_SetActiveCell"
"AB_SetRowHeight"
"AB_SetZone"
"ARRAYSIZE"
"ARRAYSTARTADDR"
"ASK"
"ASSET"
"ASSETTYPE"
"ASSETVOLATILITY"
"AUTOSESSION"
"Above"
"AbsValue"
"ActivityData"
"AddToMovieChain"
"Ago"
"Alert"
"AlertEnabled"
"All"
"An"
"And"
"Arctangent"
"Array"
"Array_Compare"
"Array_Copy"
"Array_GetMaxIndex"
"Array_GetType"
"Array_SetMaxIndex"
"Array_SetValRange"
"Array_Sort"
"Array_Sum"
"AsType"
"AskDate"
"AskDateEX"
"AskExch"
"AskSize"
"AskTime"
"AskTimeEX"
"At"
"At$"
"AtCommentaryBar"
"AvgBarsEvenTrade"
"AvgBarsLosTrade"
"AvgBarsWinTrade"
"AvgEntryPrice"
"AvgList"
"BID"
"BOOL"
"BYTE"
"Bar"
"BarInterval"
"BarStatus"
"BarType"
"Bars"
"BarsSinceEntry"
"BarsSinceExit"
"BaseCurrency"
"Based"
"Begin"
"Below"
"Beta"
"Beta_Down"
"Beta_Up"
"BidDate"
"BidDateEX"
"BidDirectionNNM"
"BidExch"
"BidSize"
"BidTime"
"BidTimeEX"
"BigPointValue"
"Black"
"BlockNumber"
"Blue"
"Book_Val_Per_Share"
"BoxSize"
"Break"
"BreakEvenStopFloor"
"BreakPoint"
"Buy"
"BuyToCover"
"By"
"C"
"CALL"
"CALLCOUNT"
"CALLITMCOUNT"
"CALLOTMCOUNT"
"CALLSERIESCOUNT"
"CALLSTRIKECOUNT"
"CHAR"
"CLEARPRINTLOG"
"COARSE"
"COST"
"CallOpenInt"
"CallVolume"
"Cancel"
"Category"
"Ceiling"
"CheckAlert"
"CheckCommentary"
"ClearDebug"
"Close"
"Commentary"
"CommentaryCL"
"CommentaryEnabled"
"Commission"
"CommodityNumber"
"ComputerDateTime"
"Condition"
"Const"
"Continue"
"Contract"
"ContractMonth"
"ContractProfit"
"ContractSize"
"ContractYear"
"Contracts"
"Cosine"
"Cotangent"
"CreateLeg"
"Cross"
"Current"
"CurrentBar"
"CurrentContracts"
"CurrentDate"
"CurrentEntries"
"CurrentOpenInt"
"CurrentShares"
"CurrentTime"
"Current_Ratio"
"CustomerID"
"Cyan"
"D"
"DEFINEDLLFUNC"
"DELTA"
"DOUBLE"
"DWORD"
"DailyClose"
"DailyHigh"
"DailyLimit"
"DailyLow"
"DailyOpen"
"DailyTrades"
"DailyTradesDN"
"DailyTradesUC"
"DailyTradesUP"
"DailyVolume"
"DailyVolumeDN"
"DailyVolumeUC"
"DailyVolumeUp"
"DarkBlue"
"DarkBrown"
"DarkCyan"
"DarkGray"
"DarkGreen"
"DarkMagenta"
"DarkRed"
"Data"
"Data1-50"
"DataCompression"
"DataInUnion"
"Date"
"DateTimeToString"
"DateToJulian"
"DateToString"
"Day"
"DayFromDateTime"
"DayOfMonth"
"DayOfWeek"
"DayOfWeekFromDateTime"
"Days"
"Default"
"DefineCustField"
"DeliveryMonth"
"DeliveryYear"
"Description"
"DivYield"
"Dividend"
"DividendCount"
"DividendDate"
"DividendFreq"
"DividendTime"
"Dividend_Yield"
"Does"
"DoubleQuote"
"DownTicks"
"DownTo"
"ELDateToDateTime"
"ELTimeToDateTime"
"EL_DateStr"
"EPS"
"EPSCount"
"EPSDate"
"EPSEstimate"
"EPSTime"
"EPS_PChng_YTD"
"EPS_PChng_Y_Ago"
"EXPIRATIONSTYLE"
"EXTERNAL"
"EasyLanguageVersion"
"Else"
"EncodeDate"
"EncodeTime"
"End"
"Entry"
"EntryDate"
"EntryPrice"
"EntryTime"
"ExchListed"
"ExecOffset"
"ExitDate"
"ExitPrice"
"ExitTime"
"ExpDate"
"ExpDateEX"
"ExpStyle"
"ExpValue"
"ExpirationDate"
"FINE"
"FIRSTOPTION"
"FLOAT"
"FND"
"FNDEX"
"FUTURE"
"FUTURETYPE"
"False"
"File"
"FileAppend"
"FileDelete"
"FirstNoticeDate"
"FirstNoticeDateEX"
"Floor"
"For"
"FormatDate"
"FormatTime"
"FracPortion"
"FreeCshFlwPerShare"
"Friday"
"From"
"GAMMA"
"G_Rate_EPS_NY"
"G_Rate_Nt_In_NY"
"G_Rate_P_Net_Inc"
"GetAccount"
"GetAccountID"
"GetAccountLotSize"
"GetAccountStatus"
"GetAccountType"
"GetAllOrNone"
"GetAppInfo"
"GetBDAccountEquity"
"GetBDAccountNetWorth"
"GetBDCashBalance"
"GetBDDayTradingBuyingPower"
"GetBDMarginRequirement"
"GetBDOvernightBuyingPower"
"GetBDTradeEquity"
"GetBValue"
"GetBackgroundColor"
"GetBuyMinusSellPlus"
"GetCDRomDrive"
"GetDiscretion"
"GetExchangeName"
"GetFundData"
"GetFundDataAsBoolean"
"GetFundDataAsString"
"GetFundPeriodEndDate"
"GetFundPostDate"
"GetGValue"
"GetLastFundDataError"
"GetNOW"
"GetNonDisplay"
"GetNumAccounts"
"GetNumPositions"
"GetOpenOrderInitialMargin"
"GetPeg"
"GetPlotBGColor"
"GetPlotColor"
"GetPlotWidth"
"GetPositionAveragePrice"
"GetPositionMarketValue"
"GetPositionOpenPL"
"GetPositionQuantity"
"GetPositionSymbol"
"GetPositionTotalCost"
"GetRTAccountEquity"
"GetRTAccountNetWorth"
"GetRTCashBalance"
"GetRTCostOfPositions"
"GetRTDaytradingBuyingPower"
"GetRTInitialMargin"
"GetRTMaintMargin"
"GetRTMarginRequirement"
"GetRTOvernightBuyingPower"
"GetRTPurchasingPower"
"GetRTRealizedPL"
"GetRTTradeEquity"
"GetRTUnrealizedPL"
"GetRValue"
"GetScreenName"
"GetShaveImprove"
"GetShowOnly"
"GetStrategyName"
"GetSubscriberOnly"
"GetSymbolName"
"GetSystemName"
"GetTodaysRTTradeEquity"
"GetUnclearedDeposits"
"Gr_Rate_P_EPS"
"GradientColor"
"Green"
"GrossLoss"
"GrossProfit"
"H"
"High"
"High52Wk"
"Higher"
"HistFundExists"
"HoursFromDateTime"
"I"
"IEasyLanguageObject"
"INITIALMARGIN"
"INT"
"IVolatility"
"I_AvgEntryPrice"
"I_ClosedEquity"
"I_CurrentContracts"
"I_CurrentShares"
"I_MarketPosition"
"I_OpenEquity"
"If"
"InStr"
"IncludeSignal"
"IncludeSystem"
"InfiniteLoopDetect"
"Input"
"Inputs"
"InsideAsk"
"InsideBid"
"Inst_Percent_Held"
"IntPortion"
"IntervalType"
"IntraBarOrderGeneration"
"IntrabarPersist"
"Is"
"IsFundDataAvailable"
"IsValidFundField"
"JulianToDate"
"L"
"LEAPYear"
"LEG"
"LEGTYPE"
"LONG"
"LPBOOL"
"LPBYTE"
"LPDOUBLE"
"LPDWORD"
"LPFLOAT"
"LPINT"
"LPLONG"
"LPSTR"
"LPWORD"
"LTD"
"LTDEX"
"LargestLosTrade"
"LargestWinTrade"
"Last"
"LastCalcJDate"
"LastCalcMMTime"
"LastTradingDate"
"Last_Split_Date"
"Last_Split_Fact"
"LeftSide"
"LeftStr"
"LegacyColorToRGB"
"LegacyColorValue"
"LightGray"
"Limit"
"LiveDate"
"LiveTime"
"Log"
"LongRollAdj"
"LossCF"
"Low"
"Low52Wk"
"Lower"
"LowerStr"
"MAXGAIN"
"MAXLOSS"
"MEDIUM"
"MIVONASK"
"MIVONBID"
"MIVONCLOSE"
"MIVONRAWASK"
"MIVONRAWBID"
"MODELPOSITION"
"MODELPRICE"
"MODELRATE"
"MODELRATE2"
"MODELVOLATILITY"
"MULTIPLE"
"MYSELF"
"Magenta"
"MakeNewMovieRef"
"Margin"
"Market"
"MarketPosition"
"MaxBarsBack"
"MaxBarsForward"
"MaxConsecLosers"
"MaxConsecWinners"
"MaxContractProfit"
"MaxContracts"
"MaxContractsHeld"
"MaxEntries"
"MaxIDDrawDown"
"MaxList"
"MaxList2"
"MaxPositionLoss"
"MaxPositionProfit"
"MaxShares"
"MaxSharesHeld"
"MessageLog"
"Method"
"MidStr"
"MillisecondsFromDateTime"
"MinList"
"MinList2"
"MinMove"
"MinutesFromDateTime"
"Moc"
"Mod"
"Monday"
"MoneyMgtStopAmt"
"Month"
"MonthFromDateTime"
"NUMFUTURES"
"NUMLEGS"
"NUMOPTIONS"
"Neg"
"NetProfit"
"Net_Profit_Margin"
"NewLine"
"NewsCount"
"Next"
"NoPlot"
"Not"
"NthMaxList"
"NthMinList"
"Null"
"NumEvenTrades"
"NumLosTrades"
"NumToStr"
"NumWinTrades"
"Numeric"
"NumericArray"
"NumericArrayRef"
"NumericRef"
"NumericSeries"
"NumericSimple"
"O"
"OPTION"
"OPTIONTYPE"
"Of"
"On"
"Once"
"Open"
"OpenInt"
"OpenPositionProfit"
"Or"
"Over"
"Override"
"PERatio"
"PM_GetCellValue"
"PM_GetNumColumns"
"PM_GetRowHeight"
"PM_High"
"PM_Low"
"PM_SetCellValue"
"PM_SetHigh"
"PM_SetLow"
"PM_SetNumColumns"
"PM_SetRowHeight"
"POINTER"
"POSITION"
"POSITIONID"
"POSITIONSTATUS"
"PROFIT"
"PROTECTIVE"
"PUT"
"PUTCOUNT"
"PUTITMCOUNT"
"PUTOTMCOUNT"
"PUTSERIESCOUNT"
"PUTSTRIKECOUNT"
"Pager_DefaultName"
"Pager_Send"
"PercentProfit"
"Place"
"PlayMovieChain"
"PlaySound"
"Plot"
"Plot1-50"
"PlotPB"
"PlotPaintBar"
"Pob"
"Point"
"PointValue"
"Pos"
"PositionProfit"
"Power"
"PrevClose"
"PrevOpenInt"
"PrevVolume"
"PriceScale"
"Price_To_Book"
"Print"
"Printer"
"Product"
"ProfitCF"
"ProfitTargetStop"
"PutOpenInt"
"PutVolume"
"Quick_Ratio"
"RAWASK"
"RAWBID"
"REGULARSESSION"
"RGB"
"RGBToLegacyColor"
"RHO"
"RaiseRunTimeError"
"Random"
"Reciprocal"
"Red"
"Repeat"
"Ret_On_Avg_Equity"
"Return"
"RevSize"
"RightSide"
"RightStr"
"Round"
"RunCommand"
"SERIESCOUNT"
"SGA_Exp_By_NetSales"
"SICCode"
"STRIKE"
"STRIKECOUNT"
"STRIKEITMCOUNT"
"STRIKEOTCOUNT"
"Saturday"
"Screen"
"SecondsFromDateTime"
"Self"
"Sell"
"SellShort"
"Sess1EndTime"
"Sess1FirstBarTime"
"Sess1StartTime"
"Sess2EndTime"
"Sess2FirstBarTime"
"Sess2StartTime"
"SessionCount"
"SessionCountMS"
"SessionEndDay"
"SessionEndDayMS"
"SessionEndTime"
"SessionEndTimeMS"
"SessionStartDay"
"SessionStartDayMS"
"SessionStartTime"
"SessionStartTimeMS"
"SetAllOrNone"
"SetBreakEven"
"SetBuyMinusSellPlus"
"SetDiscretion"
"SetDollarTrailing"
"SetExitOnClose"
"SetFPCompareAccuracy"
"SetNOW"
"SetNonDisplay"
"SetPeg"
"SetPercentTrailing"
"SetPlotBGColor"
"SetPlotColor"
"SetPlotType"
"SetPlotWidth"
"SetProfitTarget"
"SetRouteName"
"SetShaveImprove"
"SetShowOnly"
"SetStopContract"
"SetStopLoss"
"SetStopPosition"
"SetStopShare"
"SetSubscriberOnly"
"Settlement"
"Share"
"Shares"
"SharesOut"
"Short"
"ShortRollAdj"
"Sign"
"Sine"
"Skip"
"Slippage"
"SnapFundExists"
"Spaces"
"Square"
"SquareRoot"
"StartDate"
"StockSplit"
"StockSplitCount"
"StockSplitDate"
"StockSplitTime"
"Stop"
"StrLen"
"StrToNum"
"String"
"StringArray"
"StringArrayRef"
"StringRef"
"StringSeries"
"StringSimple"
"StringToDate"
"StringToDateTime"
"StringToTime"
"SumList"
"Sunday"
"Switch"
"Symbol"
"SymbolName"
"SymbolRoot"
"T"
"TARGET"
"TARGETTYPE"
"THEORETICALGROSSIN"
"THEORETICALGROSSOUT"
"THEORETICALVALUE"
"THETA"
"TICKTYPE"
"TL_Delete"
"TL_GetActive"
"TL_GetAlert"
"TL_GetBeginDate"
"TL_GetBeginTime"
"TL_GetBeginVal"
"TL_GetColor"
"TL_GetEndDate"
"TL_GetEndTime"
"TL_GetEndVal"
"TL_GetExtLeft"
"TL_GetExtRight"
"TL_GetFirst"
"TL_GetNext"
"TL_GetSize"
"TL_GetStyle"
"TL_GetValue"
"TL_New"
"TL_SetAlert"
"TL_SetBegin"
"TL_SetColor"
"TL_SetEnd"
"TL_SetExtLeft"
"TL_SetExtRight"
"TL_SetSize"
"TL_SetStyle"
"Tangent"
"Text"
"Text_Delete"
"Text_GetActive"
"Text_GetColor"
"Text_GetDate"
"Text_GetFirst"
"Text_GetHStyle"
"Text_GetNext"
"Text_GetString"
"Text_GetTime"
"Text_GetVStyle"
"Text_GetValue"
"Text_New"
"Text_SetColor"
"Text_SetLocation"
"Text_SetString"
"Text_SetStyle"
"Than"
"The"
"Then"
"This"
"Thursday"
"Ticks"
"Time"
"TimeToString"
"To"
"Today"
"Tomorrow"
"Tool_Black"
"Tool_Blue"
"Tool_Cyan"
"Tool_DarkBlue"
"Tool_DarkBrown"
"Tool_DarkCyan"
"Tool_DarkGray"
"Tool_DarkGreen"
"Tool_DarkMagenta"
"Tool_DarkRed"
"Tool_DarkYellow"
"Tool_Dashed"
"Tool_Dashed2"
"Tool_Dashed3"
"Tool_Dotted"
"Tool_Green"
"Tool_LightGray"
"Tool_Magenta"
"Tool_Red"
"Tool_Solid"
"Tool_White"
"Tool_Yellow"
"Total"
"TotalBarsEvenTrades"
"TotalBarsLosTrades"
"TotalBarsWinTrades"
"TotalTrades"
"TradeDate"
"TradeDateEX"
"TradeDirectionSeries"
"TradeExch"
"TradeTime"
"TradeTimeEX"
"TradeVolume"
"TrailingStopAmt"
"TrailingStopFloor"
"TrailingStopPct"
"True"
"TrueFalse"
"TrueFalseArray"
"TrueFalseArrayRef"
"TrueFalseRef"
"TrueFalseSeries"
"TrueFalseSimple"
"TtlDbt_By_NetAssts"
"Tuesday"
"UNSIGNED"
"Under"
"Underlying"
"UnionSess1EndTime"
"UnionSess1FirstBar"
"UnionSess1StartTime"
"UnionSess2EndTime"
"UnionSess2FirstBar"
"UnionSess2StartTime"
"Units"
"UpTicks"
"UpperStr"
"V"
"VARSIZE"
"VARSTARTADDR"
"VEGA"
"VOID"
"VSBCOMMENTARY"
"VWAP"
"Value"
"Variable"
"Volume"
"WORD"
"Was"
"Wednesday"
"While"
"White"
"Year"
"YearFromDateTime"
"Yellow"
"Yesterday"
"q_Ask"
"q_AskExchange"
"q_AskSize"
"q_Bid"
"q_BidExchange"
"q_BidSize"
"q_BigPointValue"
"q_CallOpenInt"
"q_CallVolume"
"q_Category"
"q_Close"
"q_DailyLimit"
"q_Date"
"q_DateEX"
"q_DateLastAsk"
"q_DateLastAskEX"
"q_DateLastBid"
"q_DateLastBidEX"
"q_DateLastTrade"
"q_DateLastTradeEX"
"q_DownVolume"
"q_ExchangeListed"
"q_ExpirationDate"
"q_ExpirationDateEX"
"q_High"
"q_IVolatility"
"q_Last"
"q_LastTradingDate"
"q_LastTradingDateEX"
"q_Low"
"q_Margin"
"q_MinMove"
"q_MinutesDelayed"
"q_NewsCount"
"q_NumOptions"
"q_Offer"
"q_Open"
"q_OpenInterest"
"q_OptionType"
"q_PrevTotalVolume"
"q_PreviousClose"
"q_PreviousDate"
"q_PreviousOpenInterest"
"q_PreviousTime"
"q_PreviousVolume"
"q_PutOpenInt"
"q_PutVolume"
"q_StrikePrice"
"q_Time"
"q_TimeEX"
"q_TimeLastAsk"
"q_TimeLastAskEX"
"q_TimeLastBid"
"q_TimeLastBidEX"
"q_TimeLastTrade"
"q_TimeLastTradeEX"
"q_TotalVolume"
"q_TradeVolume"
"q_UnchangedVolume"
"q_UpVolume"
"q_Yield"
"stAutoSession"
"stRegularSession"
)
;; extra stuff to colorize
'(("=" . 'font-lock-constant-face)
("\\[.*\\]" . font-lock-type-face)
("\\{.*\\}" . font-variable-name-face))
;; files
'("\\.el$")
nil
"Mode for editing easylanguage config files")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment