pub enum Rule {
Show 13 variants
EOI,
WHITESPACE,
integer,
identifier,
zero,
successor,
projection,
composition,
primitive,
minimization,
recursive_function,
functions,
query,
}Expand description
Grammar rules for parsing recursive functions.
Variants§
EOI
End-of-input
WHITESPACE
Rule which matches whitespaces: space, newline, tab.
integer
Rule which matches integers.
identifier
Rule which matches identifiers. They must start with letter and contain only letters or numbers.
zero
Rule which matches simple recursive function zero.
successor
Rule which matches simple recursive function successor.
projection
Rule which matches simple recursive function projection.
composition
Rule which matches recursive function compostion. Example: ($s:$p3.3).
primitive
Rule which matches primitive recursive function. Example: [$p1.1, ($s:$p3.3)].
minimization
Rule which matches minimization recursive function. Example: {subtractionAbs3, 100 }.
recursive_function
Rule which matches all possible recursive functions: zero, successor, projection, composition, primitive, minimization or identifier for identifying its function in future.
functions
Rule which matches list of recursive functions with their identifiers separated by semicolon. Example: const0 = $z; const0v2 = ($z : $p2.1);.
query
Rule which matches query to execute it contains identifier of function and arguments for calculations. Example:addition 12 57.