object RuleParser
Concrete syntax parser for the rule DSL. The parsed grammar is defined as follows:
ident = [a-zA-Z] [a-zA-Z0-9_-]* str = '"' <any character with " and \ escaped> '"' regex = '/' <any character with / and \ escaped> '/' file = ruleset* ruleset = 'ruleset' 'for' filename '{' rule ('or' rule)* '}' filename = 'agency' | 'stops' | 'routes' | 'trips' | 'stop_times' | 'calendar' | 'calendar_dates' | 'fare_attributes' | 'fare_rules' | 'shapes' | 'frequencies' | 'transfers' | 'pathways' | 'levels' | 'feed_info' | 'translations' | 'attributions' rule = 'rule' ident '{' 'when' matcher 'then' action '}' matcher = '(' matcher ')' | '!' factor | 'any' | variable 'exists' | value valueMatcher | matcher 'and' matcher | matcher 'or' matcher valueMatcher = '==' value | 'in' '[' value* ']' | 'matches' regex action = 'delete' | transformation ('then' transformation)* | log transformation = 'set' 'row' '[' str ']' 'to' value | 'search' regex 'in' 'row' '[' str ']' 'and' 'replace' 'by' value log = 'debug' '(' expr ')' | 'info' '(' expr ')' | 'warning' '(' expr ')' | 'error' '(' expr ')' expr = ident '(' (expr (',' expr)*)? ')' | value | expr + expr value = str | variable variable = 'row' '[' value ']' | 'ctx' '[' value ']' ('[' value ']')*
For matchers, operators have natural precendence: ! has precedence over and which as precedence over or. This
means that !m1 and m2 or m3 is equivalent to ((!m1) and m2) or m3. Combinators are left associative.
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- RuleParser
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val action: Parser[Action[Id]]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- val expr: Parser[Expr[Id]]
- val file: Parser0[List[RuleSet[Id]]]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val log: Parser[(LogLevel, Expr[Id])]
- val matcher: Parser[Matcher]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- val rule: Parser[Rule[Id]]
- val ruleset: Parser[RuleSet[Id]]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- val transformation: Parser[Transformation[Id]]
- def transformations: Parser[NonEmptyList[Transformation[Id]]]
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated