; queryfunc.abnf - tismet query
; Generated by genfuncs 1.0.0

;----------------------------------------------------------------------------
; Functions
;----------------------------------------------------------------------------
func =/ fn-absolute { End }
fn-absolute = %s"absolute(" arg-path-or-func ")" { Start }

func =/ fn-aggregate { End }
fn-aggregate = %s"aggregate(" arg-path-or-func "," arg-aggFunc ")" { Start }

func =/ fn-alias { End }
fn-alias = %s"alias(" arg-path-or-func "," arg-string ")" { Start }

func =/ fn-aliasSub { End }
fn-aliasSub = %s"aliasSub(" arg-path-or-func "," arg-string "," arg-string ")" { Start }

func =/ fn-averageAbove { End }
fn-averageAbove = %s"averageAbove(" arg-path-or-func "," arg-num ")" { Start }

func =/ fn-averageBelow { End }
fn-averageBelow = %s"averageBelow(" arg-path-or-func "," arg-num ")" { Start }

func =/ fn-averageSeries / fn-avg { End }
fn-averageSeries = %s"averageSeries(" arg-path-or-func *( "," arg-path-or-func ) ")" { Start }
fn-avg = %s"avg(" arg-path-or-func *( "," arg-path-or-func ) ")" { Start, As fn-averageSeries }

func =/ fn-color { End }
fn-color = %s"color(" arg-path-or-func "," arg-string ")" { Start }

func =/ fn-consolidateBy { End }
fn-consolidateBy = %s"consolidateBy(" arg-path-or-func "," arg-aggFunc ")" { Start }

func =/ fn-countSeries { End }
fn-countSeries = %s"countSeries(" arg-path-or-func *( "," arg-path-or-func ) ")" { Start }

func =/ fn-currentAbove { End }
fn-currentAbove = %s"currentAbove(" arg-path-or-func "," arg-num ")" { Start }

func =/ fn-currentBelow { End }
fn-currentBelow = %s"currentBelow(" arg-path-or-func "," arg-num ")" { Start }

func =/ fn-derivative { End }
fn-derivative = %s"derivative(" arg-path-or-func ")" { Start }

func =/ fn-diffSeries { End }
fn-diffSeries = %s"diffSeries(" arg-path-or-func *( "," arg-path-or-func ) ")" { Start }

func =/ fn-drawAsInfinite { End }
fn-drawAsInfinite = %s"drawAsInfinite(" arg-path-or-func ")" { Start }

func =/ fn-filterSeries { End }
fn-filterSeries = %s"filterSeries(" arg-path-or-func "," arg-aggFunc "," arg-operator "," arg-num ")" { Start }

func =/ fn-firstSeries { End }
fn-firstSeries = %s"firstSeries(" arg-path-or-func *( "," arg-path-or-func ) ")" { Start }

func =/ fn-group { End }
fn-group = %s"group(" arg-path-or-func *( "," arg-path-or-func ) ")" { Start }

func =/ fn-highest { End }
fn-highest = %s"highest(" arg-path-or-func [ "," arg-num ] [ "," arg-aggFunc ] ")" { Start }

func =/ fn-highestAverage { End }
fn-highestAverage = %s"highestAverage(" arg-path-or-func "," arg-num ")" { Start }

func =/ fn-highestCurrent { End }
fn-highestCurrent = %s"highestCurrent(" arg-path-or-func "," arg-num ")" { Start }

func =/ fn-highestMax { End }
fn-highestMax = %s"highestMax(" arg-path-or-func "," arg-num ")" { Start }

func =/ fn-invert { End }
fn-invert = %s"invert(" arg-path-or-func ")" { Start }

func =/ fn-isNonNull { End }
fn-isNonNull = %s"isNonNull(" arg-path-or-func ")" { Start }

func =/ fn-keepLastValue { End }
fn-keepLastValue = %s"keepLastValue(" arg-path-or-func [ "," arg-num ] ")" { Start }

func =/ fn-lastSeries { End }
fn-lastSeries = %s"lastSeries(" arg-path-or-func *( "," arg-path-or-func ) ")" { Start }

func =/ fn-legendValue { End }
fn-legendValue = %s"legendValue(" arg-path-or-func *( "," arg-string ) ")" { Start }

func =/ fn-lineWidth { End }
fn-lineWidth = %s"lineWidth(" arg-path-or-func "," arg-num ")" { Start }

func =/ fn-logarithm { End }
fn-logarithm = %s"logarithm(" arg-path-or-func [ "," arg-num ] ")" { Start }

func =/ fn-lowest { End }
fn-lowest = %s"lowest(" arg-path-or-func [ "," arg-num ] [ "," arg-aggFunc ] ")" { Start }

func =/ fn-lowestAverage { End }
fn-lowestAverage = %s"lowestAverage(" arg-path-or-func "," arg-num ")" { Start }

func =/ fn-lowestCurrent { End }
fn-lowestCurrent = %s"lowestCurrent(" arg-path-or-func "," arg-num ")" { Start }

func =/ fn-maximumAbove { End }
fn-maximumAbove = %s"maximumAbove(" arg-path-or-func "," arg-num ")" { Start }

func =/ fn-maximumBelow { End }
fn-maximumBelow = %s"maximumBelow(" arg-path-or-func "," arg-num ")" { Start }

func =/ fn-maxSeries { End }
fn-maxSeries = %s"maxSeries(" arg-path-or-func *( "," arg-path-or-func ) ")" { Start }

func =/ fn-medianSeries { End }
fn-medianSeries = %s"medianSeries(" arg-path-or-func *( "," arg-path-or-func ) ")" { Start }

func =/ fn-minimumAbove { End }
fn-minimumAbove = %s"minimumAbove(" arg-path-or-func "," arg-num ")" { Start }

func =/ fn-minimumBelow { End }
fn-minimumBelow = %s"minimumBelow(" arg-path-or-func "," arg-num ")" { Start }

func =/ fn-minSeries { End }
fn-minSeries = %s"minSeries(" arg-path-or-func *( "," arg-path-or-func ) ")" { Start }

func =/ fn-movingAverage { End }
fn-movingAverage = %s"movingAverage(" arg-path-or-func "," (arg-num / arg-string) [ "," arg-num ] ")" { Start }

func =/ fn-multiplySeries { End }
fn-multiplySeries = %s"multiplySeries(" arg-path-or-func *( "," arg-path-or-func ) ")" { Start }

func =/ fn-nonNegativeDerivative { End }
fn-nonNegativeDerivative = %s"nonNegativeDerivative(" arg-path-or-func [ "," arg-num ] ")" { Start }

func =/ fn-offset { End }
fn-offset = %s"offset(" arg-path-or-func "," arg-num ")" { Start }

func =/ fn-pow { End }
fn-pow = %s"pow(" arg-path-or-func "," arg-num ")" { Start }

func =/ fn-rangeSeries { End }
fn-rangeSeries = %s"rangeSeries(" arg-path-or-func *( "," arg-path-or-func ) ")" { Start }

func =/ fn-removeAboveValue { End }
fn-removeAboveValue = %s"removeAboveValue(" arg-path-or-func "," arg-num ")" { Start }

func =/ fn-removeBelowValue { End }
fn-removeBelowValue = %s"removeBelowValue(" arg-path-or-func "," arg-num ")" { Start }

func =/ fn-scale { End }
fn-scale = %s"scale(" arg-path-or-func "," arg-num ")" { Start }

func =/ fn-scaleToSeconds { End }
fn-scaleToSeconds = %s"scaleToSeconds(" arg-path-or-func "," arg-num ")" { Start }

func =/ fn-squareRoot { End }
fn-squareRoot = %s"squareRoot(" arg-path-or-func ")" { Start }

func =/ fn-stddevSeries { End }
fn-stddevSeries = %s"stddevSeries(" arg-path-or-func *( "," arg-path-or-func ) ")" { Start }

func =/ fn-sumSeries / fn-sum { End }
fn-sumSeries = %s"sumSeries(" arg-path-or-func *( "," arg-path-or-func ) ")" { Start }
fn-sum = %s"sum(" arg-path-or-func *( "," arg-path-or-func ) ")" { Start, As fn-sumSeries }

func =/ fn-timeShift { End }
fn-timeShift = %s"timeShift(" arg-path-or-func "," arg-string ")" { Start }

;----------------------------------------------------------------------------
; Enumeration arguments
;----------------------------------------------------------------------------
arg-aggFunc = *WSP (DQUOTE enum-aggFunc DQUOTE / "'" enum-aggFunc "'") *WSP
enum-aggFunc =/ %s"average" { As string, Start+, End+ }
enum-aggFunc =/ %s"avg" { As string, Start+, End+ }
enum-aggFunc =/ %s"count" { As string, Start+, End+ }
enum-aggFunc =/ %s"diff" { As string, Start+, End+ }
enum-aggFunc =/ %s"first" { As string, Start+, End+ }
enum-aggFunc =/ %s"last" { As string, Start+, End+ }
enum-aggFunc =/ %s"current" { As string, Start+, End+ }
enum-aggFunc =/ %s"max" { As string, Start+, End+ }
enum-aggFunc =/ %s"median" { As string, Start+, End+ }
enum-aggFunc =/ %s"min" { As string, Start+, End+ }
enum-aggFunc =/ %s"multiply" { As string, Start+, End+ }
enum-aggFunc =/ %s"range" { As string, Start+, End+ }
enum-aggFunc =/ %s"rangeOf" { As string, Start+, End+ }
enum-aggFunc =/ %s"stddev" { As string, Start+, End+ }
enum-aggFunc =/ %s"sum" { As string, Start+, End+ }
enum-aggFunc =/ %s"total" { As string, Start+, End+ }

arg-operator = *WSP (DQUOTE enum-operator DQUOTE / "'" enum-operator "'") *WSP
enum-operator =/ %s"eq" { As string, Start+, End+ }
enum-operator =/ %s"=" { As string, Start+, End+ }
enum-operator =/ %s"ne" { As string, Start+, End+ }
enum-operator =/ %s"!=" { As string, Start+, End+ }
enum-operator =/ %s"<>" { As string, Start+, End+ }
enum-operator =/ %s"gt" { As string, Start+, End+ }
enum-operator =/ %s">" { As string, Start+, End+ }
enum-operator =/ %s"ge" { As string, Start+, End+ }
enum-operator =/ %s">=" { As string, Start+, End+ }
enum-operator =/ %s"lt" { As string, Start+, End+ }
enum-operator =/ %s"<" { As string, Start+, End+ }
enum-operator =/ %s"le" { As string, Start+, End+ }
enum-operator =/ %s"<=" { As string, Start+, End+ }

