40 lines
5.2 KiB
XML
40 lines
5.2 KiB
XML
<lexer>
|
|
<config>
|
|
<name>Dax</name>
|
|
<alias>dax</alias>
|
|
<filename>*.dax</filename>
|
|
</config>
|
|
<rules>
|
|
<state name="root">
|
|
<rule pattern="\s+"><token type="TextWhitespace"/></rule>
|
|
<rule pattern="--.*\n?"><token type="CommentSingle"/></rule>
|
|
<rule pattern="//.*\n?"><token type="CommentSingle"/></rule>
|
|
<rule pattern="/\*"><token type="CommentMultiline"/><push state="multiline-comments"/></rule>
|
|
<rule pattern="(CONTAINS|CONTAINSROW|CUSTOMDATA|ISAFTER|ISBLANK|ISERROR|ISEVEN|ISINSCOPE|ISLOGICAL|ISNONTEXT|ISNUMBER|ISODD|ISONORAFTER|ISSELECTEDMEASURE|ISSUBTOTAL|ISTEXT|LOOKUPVALUE|NONVISUAL|SELECTEDMEASURE|SELECTEDMEASURENAME|USERNAME|USEROBJECTID|USERPRINCIPALNAME|TOJSON|TOCSV|EVALUATEANDLOG|USERCULTURE|WINDOW|PARTITIONBY|ORDERBY|OFFSET|INDEX|ROWNUMBER|MATCHBY|ACCRINT|ACCRINTM|AMORDEGRC|AMORLINC|COUPDAYBS|COUPDAYS|COUPDAYSNC|COUPNCD|COUPNUM|COUPPCD|CUMIPMT|CUMPRINC|DB|DDB|DISC|DOLLARDE|DOLLARFR|DURATION|EFFECT|FV|INTRATE|IPMT|ISPMT|MDURATION|NOMINAL|NPER|ODDFPRICE|ODDFYIELD|ODDLPRICE|ODDLYIELD|PDURATION|PMT|PPMT|PRICE|PRICEDISC|PRICEMAT|PV|RATE|RECEIVED|RRI|SLN|SYD|TBILLEQ|TBILLPRICE|TBILLYIELD|VDB|YIELD|YIELDDISC|YIELDMAT|ALL|ALLCROSSFILTERED|ALLEXCEPT|ALLNOBLANKROW|ALLSELECTED|CALCULATE|CALCULATETABLE|CROSSFILTER|EARLIER|EARLIEST|FILTER|FILTERS|HASONEFILTER|HASONEVALUE|ISCROSSFILTERED|ISFILTERED|KEEPFILTERS|RELATED|RELATEDTABLE|REMOVEFILTERS|SELECTEDVALUE|SUBSTITUTEWITHINDEX|USERELATIONSHIP|VALUES|CLOSINGBALANCEMONTH|CLOSINGBALANCEQUARTER|CLOSINGBALANCEYEAR|DATEADD|DATESBETWEEN|DATESINPERIOD|DATESMTD|DATESQTD|DATESYTD|ENDOFMONTH|ENDOFQUARTER|ENDOFYEAR|FIRSTDATE|FIRSTNONBLANK|FIRSTNONBLANKVALUE|LASTDATE|LASTNONBLANK|LASTNONBLANKVALUE|NEXTDAY|NEXTMONTH|NEXTQUARTER|NEXTYEAR|OPENINGBALANCEMONTH|OPENINGBALANCEQUARTER|OPENINGBALANCEYEAR|PARALLELPERIOD|PREVIOUSDAY|PREVIOUSMONTH|PREVIOUSQUARTER|PREVIOUSYEAR|SAMEPERIODLASTYEAR|STARTOFMONTH|STARTOFQUARTER|STARTOFYEAR|TOTALMTD|TOTALQTD|TOTALYTD|RETURN|ABS|ACOS|ACOSH|ACOT|ACOTH|ASIN|ASINH|ATAN|ATANH|CEILING|COMBIN|COMBINA|COS|COSH|COT|COTH|CURRENCY|DEGREES|DIVIDE|EVEN|EXP|FACT|FLOOR|GCD|INT|ISO.CEILING|LCM|LN|LOG|LOG10|MOD|MROUND|ODD|PI|POWER|PRODUCT|PRODUCTX|QUOTIENT|RADIANS|RAND|RANDBETWEEN|ROUND|ROUNDDOWN|ROUNDUP|SIGN|SQRT|SUM|SUMX|TRUNC|BLANK|COMBINEVALUES|CONCATENATE|CONCATENATEX|CONTAINSSTRING|CONTAINSSTRINGEXACT|EXACT|FIND|FIXED|FORMAT|LEFT|LEN|LOWER|MID|REPLACE|REPT|RIGHT|SEARCH|SUBSTITUTE|TRIM|UNICHAR|UNICODE|UPPER|VALUE|LINEST|LINESTX|CONVERT|DATATABLE|ERROR|EXCEPT|GENERATESERIES|GROUPBY|INTERSECT|ISEMPTY|NATURALINNERJOIN|NATURALLEFTOUTERJOIN|SELECTEDMEASUREFORMATSTRING|SUMMARIZECOLUMNS|Table Constructor|TREATAS|UNION|VAR|PATH|PATHCONTAINS|PATHITEM|PATHITEMREVERSE|PATHLENGTH|ADDCOLUMNS|ADDMISSINGITEMS|CURRENTGROUP|DETAILROWS|DISTINCT|ROLLUP|ROLLUPADDISSUBTOTAL|ROLLUPGROUP|ROLLUPISSUBTOTAL|EXTERNALMEASURE|PMT|PPMT|PRICE|PRICEDISC|PRICEMAT|PV|RATE|RECEIVED|RRI|SLN|SYD|TBILLEQ|TBILLPRICE|TBILLYIELD|VDB|YIELD|YIELDDISC|YIELDMAT|CALENDAR|CALENDARAUTO|DATE|DATEDIFF|DATEVALUE|DAY|EDATE|EOMONTH|HOUR|MINUTE|MONTH|NETWORKDAYS|NOW|QUARTER|SECOND|TIME|TIMEVALUE|TODAY|UTCNOW|UTCTODAY|WEEKDAY|WEEKNUM|YEAR|YEARFRAC|APPROXIMATEDISTINCTCOUNT|AVERAGE|AVERAGEA|AVERAGEX|BETA.DIST|BETA.INV|CHISQ.DIST|CHISQ.DIST.RT|CHISQ.INV|CHISQ.INV.RT|CONFIDENCE.NORM|CONFIDENCE.T|COUNT|COUNTA|COUNTAX|COUNTBLANK|COUNTROWS|COUNTX|CROSSJOIN|DISTINCTCOUNT|DISTINCTCOUNTNOBLANK|EXPON.DIST|GENERATE|GENERATEALL|GEOMEAN|GEOMEANX|MAX|MAXA|MAXX|MEDIAN|MEDIANX|MIN|MINA|MINX|NORM.DIST|NORM.INV|NORM.S.DIST|NORM.S.INV|PERCENTILE.EXC|PERCENTILE.INC|PERCENTILEX.EXC|PERCENTILEX.INC|PERMUT|POISSON.DIST|RANK.EQ|RANKX|ROW|SAMPLE|SELECTCOLUMNS|SIN|SINH|SQRTPI|STDEV.P|STDEV.S|STDEVX.P|STDEVX.S|SUMMARIZE|T.DIST|T.DIST.2T|T.DIST.RT|T.INV|T.INV.2T|TAN|TANH|TOPN|VAR|VAR.P|VAR.S|VARX.P|VARX.S|XIRR|XNPV|RANK)\b">
|
|
<token type="NameFunction"/>
|
|
</rule>
|
|
<rule pattern="(AND|BITAND|BITLSHIFT|BITOR|BITRSHIFT|BITXOR|COALESCE|FALSE|IF|IF.EAGER|IFERROR|IN|NOT|OR|SWITCH|TRUE)\b">
|
|
<token type="NameOperator"/>
|
|
</rule>
|
|
<rule pattern="[+*/<>=!^&|,-]"><token type="Operator"/></rule>
|
|
<rule pattern="""><token type="LiteralString"/><push state="string"/></rule>
|
|
<rule pattern="'(?:[^']|'')*'(?!')(?:\[[ \w]+\])?|\w+\[[ \w]+\]"><token type="NameAttribute"/></rule>
|
|
<rule pattern="\[[ \w]+\]"><token type="NameAttribute"/></rule>
|
|
<rule pattern="(?<!\w)(\d+\.?\d*|\.\d+\b)"><token type="LiteralNumber"/></rule>
|
|
<rule pattern="[\[\](){}`,.]"><token type="Punctuation"/></rule>
|
|
<rule pattern=".*\n"><token type="Text"/></rule>
|
|
</state>
|
|
<state name="multiline-comments">
|
|
<rule pattern="/\*"><token type="CommentMultiline"/><push state="multiline-comments"/></rule>
|
|
<rule pattern="\*/"><token type="CommentMultiline"/><pop depth="1"/></rule>
|
|
<rule pattern="[^/*]+"><token type="CommentMultiline"/></rule>
|
|
<rule pattern="[/*]"><token type="CommentMultiline"/></rule>
|
|
</state>
|
|
<state name="string">
|
|
<rule pattern=""""><token type="LiteralStringEscape"/></rule>
|
|
<rule pattern="""><token type="LiteralString"/><pop depth="1"/></rule>
|
|
<rule pattern="[^"]+"><token type="LiteralString"/></rule>
|
|
</state>
|
|
</rules>
|
|
</lexer>
|