pub enum Rule {
Show 246 variants
EOI,
COMMENT,
WHITESPACE,
Id,
IdAt,
IdInfix,
IdList,
IdInfixList,
Number,
MCRL2Spec,
DataSpec,
ActSpec,
ActDecl,
SortSpec,
SortDecl,
SortExpr,
SortExprPrimary,
SortExprBool,
SortExprPos,
SortExprNat,
SortExprInt,
SortExprReal,
SortExprList,
SortExprSet,
SortExprBag,
SortExprFSet,
SortExprFBag,
SortExprParens,
SortExprStruct,
SortExprInfix,
SortExprFunction,
SortExprProduct,
ConstrDecl,
ConstrDeclList,
SortProduct,
DataExpr,
DataExprUnit,
DataExprPrefix,
DataExprForall,
DataExprExists,
DataExprLambda,
DataExprNegation,
DataExprMinus,
DataExprSize,
DataExprPrimary,
DataExprTrue,
DataExprFalse,
DataExprEmptyList,
DataExprEmptySet,
DataExprEmptyBag,
DataExprListEnum,
DataExprBagEnum,
DataExprSetBagComp,
DataExprSetEnum,
DataExprBrackets,
DataExprPostfix,
DataExprUpdate,
DataExprApplication,
DataExprWhr,
DataExprInfix,
DataExprImpl,
DataExprDisj,
DataExprConj,
DataExprEq,
DataExprNeq,
DataExprLeq,
DataExprSnoc,
DataExprLess,
DataExprGeq,
DataExprGreater,
DataExprIn,
DataExprCons,
DataExprConcat,
DataExprAdd,
DataExprSubtract,
DataExprDiv,
DataExprIntDiv,
DataExprMod,
DataExprMult,
DataExprAt,
DataExprList,
Assignment,
AssignmentList,
VarDecl,
VarsDecl,
VarsDeclList,
BagEnumElt,
BagEnumEltList,
Action,
ActIdSet,
MultActId,
MultActIdList,
MultActIdSet,
ProjDecl,
ProjDeclList,
CommExpr,
CommExprList,
CommExprSet,
RenExpr,
RenExprList,
RenExprSet,
ProcExpr,
ProcExprPrimary,
ProcExprDelta,
ProcExprTau,
ProcExprBlock,
ProcExprAllow,
ProcExprHide,
ProcExprRename,
ProcExprComm,
ProcExprBrackets,
ProcExprId,
ProcExprPrefix,
ProcExprSum,
ProcExprDist,
ProcExprIfThen,
ProcExprIf,
ProcExprInfix,
ProcExprChoice,
ProcExprLeftMerge,
ProcExprParallel,
ProcExprSeq,
ProcExprUntil,
ProcExprSync,
ProcExprPostfix,
ProcExprAt,
ProcExprNoIf,
ProcExprNoIfInfix,
ProcDecl,
ProcSpec,
Init,
IdsDecl,
ConsSpec,
MapSpec,
GlobVarSpec,
VarSpec,
EqnSpec,
EqnDecl,
StateFrmSpec,
FormSpec,
StateFrmSpecElt,
StateFrm,
StateFrmPrimary,
StateFrmBrackets,
StateFrmTrue,
StateFrmFalse,
StateFrmDelay,
StateFrmYaled,
StateFrmId,
StateFrmDataValExpr,
StateFrmPrefix,
StateFrmMu,
StateFrmNu,
StateFrmInf,
StateFrmSup,
StateFrmSum,
StateFrmForall,
StateFrmExists,
StateFrmBox,
StateFrmDiamond,
StateFrmUnaryMinus,
StateFrmNegation,
StateFrmLeftConstantMultiply,
StateFrmInfix,
StateFrmAddition,
StateFrmImplication,
StateFrmDisjunction,
StateFrmConjunction,
StateFrmPostfix,
StateFrmRightConstantMultiply,
RegFrm,
RegFrmPrimary,
RegFrmBackets,
RegFrmInfix,
RegFrmAlternative,
RegFrmComposition,
RegFrmPostfix,
RegFrmIteration,
RegFrmPlus,
ActFrm,
ActFrmPrimary,
ActFrmBrackets,
ActFrmTrue,
ActFrmFalse,
ActFrmPrefix,
ActFrmNegation,
ActFrmForall,
ActFrmExists,
ActFrmInfix,
ActFrmImplies,
ActFrmUnion,
ActFrmIntersect,
ActFrmPostfix,
ActFrmAt,
MultAct,
MultiActTau,
ActionList,
DataValExpr,
StateVarDecl,
StateVarAssignment,
StateVarAssignmentList,
ActionRenameSpec,
ActionRenameRuleSpec,
ActionRenameRule,
ActionRenameRuleRHS,
FixedPointOperator,
FixedPointMu,
FixedPointNu,
PbesSpec,
PbesEqnSpec,
PbesEqnDecl,
PropVarDecl,
PropVarInst,
PbesInit,
PbesExpr,
PbesExprPrimary,
PbesExprParens,
PbesExprTrue,
PbesExprFalse,
PbesExprPrefix,
PbesExprForall,
PbesExprExists,
PbesExprNegation,
PbesExprInfix,
PbesExprImplies,
PbesExprConj,
PbesExprDisj,
PresSpec,
PresEqnSpec,
PresEqnDecl,
PresExpr,
PresExprPrimary,
PresExprParens,
PresExprEqinf,
PresExprEqninf,
PresExprCondsm,
PresExprCondeq,
PresExprPrefix,
PresExprInf,
PresExprSup,
PresExprSum,
PresExprLeftConstantMultiply,
PresExprInfix,
PresExprAdd,
PresExprPostfix,
PresExprRightConstMultiply,
}Expand description
This contains the grammar for .mcrl2 specifications.
Considerations for PEG parsers
AFTER parsing we can use a PrattParser to define the associativity and precedence of operators for rules of the following shape:
expr = { prefix* ~ primary ~ postfix* ~ (infix ~ prefix* ~ primary ~ postfix* )* }
The | operator defines a choice operator and does not mean OR with backtracking. This means the following rules
Expr = { “Bool” ~ ASCII_ALPHANUMERIC* }
Will match the expression “Boolean” by eating up “Bool” and leaving “ean” as the remaining. However, this is undesirable since this should be an identifier Boolean. This is resolved by only allowing keywords to match whenever it is not by something that is part of an identifier.
Variants§
EOI
End-of-input
COMMENT
This is a silent rule eating all the comments.
WHITESPACE
This is a silent rule eating all the white space in the input.
Id
Identifiers
IdAt
Internal identifiers that can start with at “@”.
IdInfix
Identifiers that can also be the allowed infix operators.
IdList
List of identifiers
IdInfixList
List of identifiers
Number
Numbers
MCRL2Spec
Parsing an mCRL2 specification
DataSpec
Parsing an mCRL2 specification
ActSpec
Action specification
ActDecl
Declaration of actions
SortSpec
Sort specification
SortDecl
SortExpr
A general sort expression with infix operators.
SortExprPrimary
A single sort expression
SortExprBool
SortExprPos
SortExprNat
SortExprInt
SortExprReal
SortExprList
SortExprSet
SortExprBag
SortExprFSet
SortExprFBag
SortExprParens
SortExprStruct
SortExprInfix
SortExprFunction
SortExprProduct
ConstrDecl
Constructor declaration
ConstrDeclList
Constructor declaration list
SortProduct
A single sort A -> B -> …
DataExpr
Data Expression
DataExprUnit
Data Expressions without infix operators
DataExprPrefix
DataExprForall
DataExprExists
DataExprLambda
DataExprNegation
DataExprMinus
DataExprSize
DataExprPrimary
DataExprTrue
DataExprFalse
DataExprEmptyList
DataExprEmptySet
DataExprEmptyBag
DataExprListEnum
DataExprBagEnum
DataExprSetBagComp
DataExprSetEnum
DataExprBrackets
DataExprPostfix
DataExprUpdate
DataExprApplication
DataExprWhr
DataExprInfix
DataExprImpl
DataExprDisj
DataExprConj
DataExprEq
DataExprNeq
DataExprLeq
DataExprSnoc
DataExprLess
DataExprGeq
DataExprGreater
DataExprIn
DataExprCons
DataExprConcat
DataExprAdd
DataExprSubtract
DataExprDiv
DataExprIntDiv
DataExprMod
DataExprMult
DataExprAt
DataExprList
List of data expressions
Assignment
Assignment x = expression
AssignmentList
List of assignments
VarDecl
Typed variable
VarsDecl
Typed variables
VarsDeclList
Individually typed variables
BagEnumElt
Bag element with multiplicity
BagEnumEltList
Elements in a finite bag
Action
Action, process instantiation
ActIdSet
Action set
MultActId
Multi-action label
MultActIdList
MultActIdSet
Multi-action label set
ProjDecl
Domain with optional projection
ProjDeclList
Declaration of projection functions
CommExpr
Action synchronization
CommExprList
Action synchronizations
CommExprSet
Action synchronization set
RenExpr
Action renaming
RenExprList
Multiple action renamings
RenExprSet
An action renaming set.
ProcExpr
ProcExprPrimary
Single Process expressions
ProcExprDelta
ProcExprTau
ProcExprBlock
ProcExprAllow
ProcExprHide
ProcExprRename
ProcExprComm
ProcExprBrackets
ProcExprId
ProcExprPrefix
ProcExprSum
ProcExprDist
ProcExprIfThen
ProcExprIf
ProcExprInfix
ProcExprChoice
ProcExprLeftMerge
ProcExprParallel
ProcExprSeq
ProcExprUntil
ProcExprSync
ProcExprPostfix
ProcExprAt
ProcExprNoIf
ProcExprNoIfInfix
ProcDecl
ProcSpec
Process specification
Init
Initial process
IdsDecl
Typed parameters
ConsSpec
Declaration of constructors
MapSpec
Declaration of mappings
GlobVarSpec
Declaration of global variables
VarSpec
Declaration of variables
EqnSpec
Definition of equations
EqnDecl
Conditional equation
StateFrmSpec
Single state formula or state formula specification
FormSpec
StateFrmSpecElt
StateFrm
StateFrmPrimary
StateFrmBrackets
StateFrmTrue
StateFrmFalse
StateFrmDelay
StateFrmYaled
StateFrmId
StateFrmDataValExpr
StateFrmPrefix
StateFrmMu
StateFrmNu
StateFrmInf
StateFrmSup
StateFrmSum
StateFrmForall
StateFrmExists
StateFrmBox
StateFrmDiamond
StateFrmUnaryMinus
StateFrmNegation
StateFrmLeftConstantMultiply
StateFrmInfix
StateFrmAddition
StateFrmImplication
StateFrmDisjunction
StateFrmConjunction
StateFrmPostfix
StateFrmRightConstantMultiply
RegFrm
Regular formulas. To guard for the ambiguity of a + b and a+ we use a negative premise
RegFrmPrimary
RegFrmBackets
RegFrmInfix
RegFrmAlternative
RegFrmComposition
RegFrmPostfix
RegFrmIteration
RegFrmPlus
ActFrm
ActFrmPrimary
ActFrmBrackets
ActFrmTrue
ActFrmFalse
ActFrmPrefix
ActFrmNegation
ActFrmForall
ActFrmExists
ActFrmInfix
ActFrmImplies
ActFrmUnion
ActFrmIntersect
ActFrmPostfix
ActFrmAt
MultAct
MultiActTau
ActionList
DataValExpr
Marked data exression
StateVarDecl
State variable declaration
StateVarAssignment
Typed variable with initial value
StateVarAssignmentList
Typed variable list
ActionRenameSpec
Action rename specification
ActionRenameRuleSpec
Action rename rule section
ActionRenameRule
Conditional action renaming
ActionRenameRuleRHS
FixedPointOperator
FixedPointMu
FixedPointNu
PbesSpec
Parameterised boolean equations systems
PbesEqnSpec
PbesEqnDecl
PropVarDecl
PropVarInst
PbesInit
PbesExpr
PbesExprPrimary
PbesExprParens
PbesExprTrue
PbesExprFalse
PbesExprPrefix
PbesExprForall
PbesExprExists
PbesExprNegation
PbesExprInfix
PbesExprImplies
PbesExprConj
PbesExprDisj
PresSpec
Parameterised boolean equations systems
PresEqnSpec
PresEqnDecl
PresExpr
PresExprPrimary
PresExprParens
PresExprEqinf
PresExprEqninf
PresExprCondsm
PresExprCondeq
PresExprPrefix
PresExprInf
PresExprSup
PresExprSum
PresExprLeftConstantMultiply
PresExprInfix
PresExprAdd
PresExprPostfix
PresExprRightConstMultiply
Implementations§
Trait Implementations§
Source§impl Ord for Rule
impl Ord for Rule
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl Parser<Rule> for Mcrl2Parser
impl Parser<Rule> for Mcrl2Parser
Source§impl PartialOrd for Rule
impl PartialOrd for Rule
impl Copy for Rule
impl Eq for Rule
impl StructuralPartialEq for Rule
Auto Trait Implementations§
impl Freeze for Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnsafeUnpin for Rule
impl UnwindSafe for Rule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> SliceDst for T
impl<T> SliceDst for T
Source§fn layout_for(_length: usize) -> Result<Layout, LayoutError>
fn layout_for(_length: usize) -> Result<Layout, LayoutError>
length elements for this DST.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.