Enhanced C#
Loyc library documentation
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Public fields | Properties | Public Member Functions | Static Public Member Functions | List of all members
Loyc.LLParserGenerator.Rule Class Reference

Represents an LLLPG rule, which is a Predicate plus a Name and optional attributes (e.g. token, private, etc.). More...


Source file:

Remarks

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 IsStartingRule
 
bool IsExternal
 
bool IsInline
 
bool IsPrivate
 
bool FullLLk
 
int K
 
LNode TryWrapperName
 
bool HasRecognizerVersion => _recognizer != null || IsRecognizer
 
Rule Recognizer => _recognizer
 

Properties

bool IsRecognizer [get, set]
 

Public Member Functions

 Rule (LNode basis, Symbol name, Pred pred, bool isStartingRule=true, bool isRecognizer=false)
 
Rule GetOrMakeRecognizerVersion ()
 
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...
 

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)
 

Member Function Documentation

LNode Loyc.LLParserGenerator.Rule.GetMethodSignature ( )
inline

Returns Basis if it's a method signature; otherwise constructs a default signature.

Member Data Documentation

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().