Enhanced C#
Language of your choice: library documentation
|
Represents an LLLPG rule, which is a Predicate plus a Name and optional attributes (e.g. token, private, etc.). More...
Represents an LLLPG rule, which is a Predicate plus a Name and optional attributes (e.g. token, private, etc.).
Public fields | |
LNode | Basis |
A node that contains the original code of the rule, or, if the rule was created programmatically, the method prototype (e.g. #fn(int, Rule, #(#var(int, arg))) , which means int Rule(int arg) ). This can be null, in which case the default prototype is void Rule(); , or if the rule is a starting rule or token, public void Rule(); . More... | |
LNode | ReturnType |
readonly EndOfRule | EndOfRule |
Symbol | Name |
Pred | Pred |
bool | IsToken |
bool | IsExternal |
bool? | IsPrivate |
bool? | FullLLk |
int | K |
bool | IsRecognizer |
LNode | TryWrapperName |
Rule | _recognizer |
Properties | |
bool | HasRecognizerVersion [get] |
Public Member Functions | |
Rule (LNode basis, Symbol name, Pred pred, bool isStartingRule=true) | |
Rule | MakeRecognizerVersion () |
Rule | MakeRecognizerVersion (Symbol newName) |
Rule | MakeRecognizerVersion (LNode prototype) |
void | TryWrapperNeeded () |
override string | ToString () |
LNode | GetMethodSignature () |
Returns Basis if it's a method signature; otherwise constructs a default signature. More... | |
LNode | CreateMethod (LNodeList methodBody) |
Creates the default method definition to wrap around the body of the rule, which has already been generated. Returns Basis with the specified new method body. If Basis is null, a simple default method signature is used, e.g. public void R() {...} where R is the rule name. More... | |
Static Public Member Functions | |
static Alts | operator| (Rule a, Pred b) |
static Alts | operator| (Pred a, Rule b) |
static Alts | operator| (Rule a, Rule b) |
static Alts | operator/ (Rule a, Pred b) |
static Alts | operator/ (Pred a, Rule b) |
static Alts | operator/ (Rule a, Rule b) |
static Pred | operator+ (Rule a, char b) |
static Pred | operator+ (char a, Rule b) |
static Pred | operator+ (Rule a, LNode b) |
static Pred | operator+ (LNode a, Rule b) |
static implicit | operator Rule (RuleRef rref) |
static implicit | operator RuleRef (Rule rule) |
Creates the default method definition to wrap around the body of the rule, which has already been generated. Returns Basis with the specified new method body. If Basis is null, a simple default method signature is used, e.g. public void R() {...}
where R is the rule name.
methodBody | The parsing code that was generated for this rule. |
References Loyc.Syntax.LNode.Args, Loyc.LLParserGenerator.Rule.GetMethodSignature(), Loyc.Syntax.CodeSymbols.Missing, Loyc.Syntax.CodeSymbols.Return, and Loyc.Syntax.LNode.WithArgs().
Referenced by Loyc.LLParserGenerator.CodeGenHelperBase.CreateRuleMethod().
|
inline |
Returns Basis if it's a method signature; otherwise constructs a default signature.
References Loyc.Syntax.LNode.Args, Loyc.LLParserGenerator.Rule.Basis, Loyc.Syntax.LNode.Calls(), and Loyc.Syntax.LNode.WithArgs().
Referenced by Loyc.LLParserGenerator.Rule.CreateMethod(), and Loyc.LLParserGenerator.CodeGenHelperBase.CreateTryWrapperForRecognizer().
LNode Loyc.LLParserGenerator.Rule.Basis |
A node that contains the original code of the rule, or, if the rule was created programmatically, the method prototype (e.g. #fn(int, Rule, #(#var(int, arg)))
, which means int Rule(int arg)
). This can be null, in which case the default prototype is void Rule();
, or if the rule is a starting rule or token, public void Rule();
.
The Basis is also used to provide an error location.
Referenced by Loyc.LLParserGenerator.CodeGenHelperBase.CallRule(), and Loyc.LLParserGenerator.Rule.GetMethodSignature().