pub struct TLAParser {}Expand description
Parser for supported subset of TLA+
This parser is designed to parse TLA+ specifications that fall into the translatable fragment
Implementations§
Source§impl TLAParser
impl TLAParser
Sourcefn parse_specification_and_add_expressions<'a>(
&self,
pair: Vec<Pair<'a, Rule>>,
builder: ELTLSpecificationBuilder<'a, GeneralThresholdAutomaton>,
ctx: TLAParsingContext<'_>,
) -> Result<ELTLSpecificationBuilder<'a, GeneralThresholdAutomaton>, Error>
fn parse_specification_and_add_expressions<'a>( &self, pair: Vec<Pair<'a, Rule>>, builder: ELTLSpecificationBuilder<'a, GeneralThresholdAutomaton>, ctx: TLAParsingContext<'_>, ) -> Result<ELTLSpecificationBuilder<'a, GeneralThresholdAutomaton>, Error>
Parse specification list into ltl expressions
fn parse_ta_and_return_ltl_pairs<'a>( &self, input: &'a str, ) -> Result<(GeneralThresholdAutomaton, Vec<Pair<'a, Rule>>, TLAParsingContext<'a>), Error>
Sourcefn validate_module_imports<'a>(
pairs: &mut Pairs<'a, Rule>,
pair: Pair<'a, Rule>,
) -> Pair<'a, Rule>
fn validate_module_imports<'a>( pairs: &mut Pairs<'a, Rule>, pair: Pair<'a, Rule>, ) -> Pair<'a, Rule>
Validate the imports appearing in the TLA file
This function will not fail, it will only produce warnings on TLC compatibility
Sourcefn parse_constant_declaration<'a>(
pairs: &mut Pairs<'a, Rule>,
pair: Pair<'a, Rule>,
builder: GeneralThresholdAutomatonBuilder,
) -> Result<(Pair<'a, Rule>, GeneralThresholdAutomatonBuilder), Error>
fn parse_constant_declaration<'a>( pairs: &mut Pairs<'a, Rule>, pair: Pair<'a, Rule>, builder: GeneralThresholdAutomatonBuilder, ) -> Result<(Pair<'a, Rule>, GeneralThresholdAutomatonBuilder), Error>
Parses all constant declarations
This block will parse all consecutive constant_declarations pairs.
Every such block is CONSTANT declaration and declares the parameters
of a threshold automaton.
Additionally, the constants NbOfCorrProcesses and Processes should
be declared.
Sourcefn parse_assume_declaration<'a>(
pair: Pair<'a, Rule>,
builder: InitializedGeneralThresholdAutomatonBuilder,
ctx: &mut TLAParsingContext<'_>,
) -> Result<InitializedGeneralThresholdAutomatonBuilder, Error>
fn parse_assume_declaration<'a>( pair: Pair<'a, Rule>, builder: InitializedGeneralThresholdAutomatonBuilder, ctx: &mut TLAParsingContext<'_>, ) -> Result<InitializedGeneralThresholdAutomatonBuilder, Error>
Parse and validate an ASSUME block, i.e. a resilience condition
This function parses one ASSUME definition, but there can be
potentially multiple ones
Sourcefn parse_variable_declaration<'a>(
pairs: &mut Pairs<'a, Rule>,
pair: Pair<'a, Rule>,
builder: GeneralThresholdAutomatonBuilder,
) -> Result<(Pair<'a, Rule>, GeneralThresholdAutomatonBuilder), Error>
fn parse_variable_declaration<'a>( pairs: &mut Pairs<'a, Rule>, pair: Pair<'a, Rule>, builder: GeneralThresholdAutomatonBuilder, ) -> Result<(Pair<'a, Rule>, GeneralThresholdAutomatonBuilder), Error>
Parse a variable declaration, i.e. the VARIABLE / VARIABLES
declaration of of a TLA file
This declaration needs to declare all shared variables of the resulting TA, as well as the variable ‘ProcessesLocations’ which is the function from process identifiers to their current location.
Sourcefn parse_type_ok<'a>(
pairs: &mut Pairs<'a, Rule>,
pair: Pair<'a, Rule>,
builder: GeneralThresholdAutomatonBuilder,
) -> Result<(Pair<'a, Rule>, InitializedGeneralThresholdAutomatonBuilder), Error>
fn parse_type_ok<'a>( pairs: &mut Pairs<'a, Rule>, pair: Pair<'a, Rule>, builder: GeneralThresholdAutomatonBuilder, ) -> Result<(Pair<'a, Rule>, InitializedGeneralThresholdAutomatonBuilder), Error>
Parse the TypeOk block into the set of locations and validates that it
declares a type for all shared variables, that should be declared as
type ‘Nat’.
Sourcefn parse_initial_constraint_declaration<'a>(
pairs: &mut Pairs<'a, Rule>,
pair: Pair<'a, Rule>,
builder: InitializedGeneralThresholdAutomatonBuilder,
ctx: &mut TLAParsingContext<'_>,
) -> Result<(Option<Pair<'a, Rule>>, InitializedGeneralThresholdAutomatonBuilder), Error>
fn parse_initial_constraint_declaration<'a>( pairs: &mut Pairs<'a, Rule>, pair: Pair<'a, Rule>, builder: InitializedGeneralThresholdAutomatonBuilder, ctx: &mut TLAParsingContext<'_>, ) -> Result<(Option<Pair<'a, Rule>>, InitializedGeneralThresholdAutomatonBuilder), Error>
Parse the initial constraints of an Init block
Sourcefn parse_int_macro_declarations<'a>(
pairs: &mut Pairs<'a, Rule>,
pair: Option<Pair<'a, Rule>>,
ctx: &mut TLAParsingContext<'a>,
) -> Option<Pair<'a, Rule>>
fn parse_int_macro_declarations<'a>( pairs: &mut Pairs<'a, Rule>, pair: Option<Pair<'a, Rule>>, ctx: &mut TLAParsingContext<'a>, ) -> Option<Pair<'a, Rule>>
Parse all consecutive declaration of integer macros
Sourcefn parse_rule_declarations<'a>(
pairs: &mut Pairs<'a, Rule>,
pair: Pair<'a, Rule>,
builder: InitializedGeneralThresholdAutomatonBuilder,
ctx: &mut TLAParsingContext<'a>,
) -> Result<(Option<Pair<'a, Rule>>, InitializedGeneralThresholdAutomatonBuilder), Error>
fn parse_rule_declarations<'a>( pairs: &mut Pairs<'a, Rule>, pair: Pair<'a, Rule>, builder: InitializedGeneralThresholdAutomatonBuilder, ctx: &mut TLAParsingContext<'a>, ) -> Result<(Option<Pair<'a, Rule>>, InitializedGeneralThresholdAutomatonBuilder), Error>
Parse all consecutive declarations of rules
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TLAParser
impl RefUnwindSafe for TLAParser
impl Send for TLAParser
impl Sync for TLAParser
impl Unpin for TLAParser
impl UnwindSafe for TLAParser
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> 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 more