Class ZeroOrMoreRule
Denotes that another rule can occur an arbitrary number of times
public class ZeroOrMoreRule : Rule
- Inheritance
-
ZeroOrMoreRule
- Inherited Members
Constructors
ZeroOrMoreRule()
Creates a new instance
public ZeroOrMoreRule()
ZeroOrMoreRule(FormattedRule)
Creates a new instance
public ZeroOrMoreRule(FormattedRule innerRule)
Parameters
innerRule
FormattedRulethe inner rule
ZeroOrMoreRule(Rule)
Creates a new instance
public ZeroOrMoreRule(Rule innerRule)
Parameters
innerRule
Rulethe inner rule
Properties
FormattingInstructions
Gets or sets the formatting instructions
public FormattingInstruction[] FormattingInstructions { get; set; }
Property Value
InnerRule
Gets or sets the inner rule
public Rule InnerRule { get; set; }
Property Value
Methods
Accept(RuleApplication, List<RuleApplication>, ParseContext)
Decides whether the provided rule application shall be accepted
protected bool Accept(RuleApplication ruleApplication, List<RuleApplication> ruleApplications, ParseContext context)
Parameters
ruleApplication
RuleApplicationthe rule application that shall be accepted
ruleApplications
List<RuleApplication>the rule applications accepted so far
context
ParseContextthe parse context in which the rule applications shall be accepted
Returns
- bool
true, if the rule application shall be accepted, otherwise false
CanStartWith(Rule, List<Rule>)
Indicates whether the rule could start with the given other rule
protected override bool CanStartWith(Rule rule, List<Rule> trace)
Parameters
Returns
- bool
true, if the rule could start with the given other rule, otherwise false
CanSynthesize(object, ParseContext, SynthesisPlan)
Determines whether the current rule can synthesize rule applications for the given semantic element
public override bool CanSynthesize(object semanticElement, ParseContext context, SynthesisPlan synthesisPlan)
Parameters
semanticElement
objectthe semantic element
context
ParseContextthe context in which the rule is synthesized
synthesisPlan
SynthesisPlanthe plan of the synthesis
Returns
- bool
true, if a rule application can be synthesized, otherwise false
CreateEpsilonRuleApplication(RuleApplication)
Creates a new rule application at the given position
public override RuleApplication CreateEpsilonRuleApplication(RuleApplication position)
Parameters
position
RuleApplicationanother rule application at the desired position
Returns
- RuleApplication
A new rule application
HasFoldingKind(out string)
Returns the folding kind for a rule if one is defined for the rule
public override bool HasFoldingKind(out string kind)
Parameters
kind
stringThe folding kind of the rule
Returns
- bool
True, if a folding kind is defined for the rule
IsEpsilonAllowed(List<Rule>)
Determines whether the rule could capture empty input
protected override bool IsEpsilonAllowed(List<Rule> trace)
Parameters
Returns
- bool
true, if the rule can be expanded to an empty string, otherwise false
Match(ParseContext, RecursionContext, ref ParsePosition)
Matches the the context at the provided position
public override RuleApplication Match(ParseContext context, RecursionContext recursionContext, ref ParsePosition position)
Parameters
context
ParseContextthe context in which the rule is matched
recursionContext
RecursionContextthe recursion context of the matching
position
ParsePositionthe position in the input
Returns
- RuleApplication
the rule application for the provided position
Synthesize(object, ParsePosition, ParseContext)
Synthesizes a rule application for the given semantic element
public override RuleApplication Synthesize(object semanticElement, ParsePosition position, ParseContext context)
Parameters
semanticElement
objectposition
ParsePositionthe parse position at which the element should be synthesized
context
ParseContextthe parse context
Returns
- RuleApplication
a rule application
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.