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 | 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 (VList< LNode > 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.CodeSymbols.Missing.
|
inline |
Returns Basis if it's a method signature; otherwise constructs a default signature.
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().