C# Class Loyc.LLParserGenerator.Rule

Represents an LLLPG rule, which is a Predicate plus a Name and optional attributes (e.g. token, private, etc.).
Mostrar archivo Open project: qwertie/ecsharp Class Usage Examples

Public Properties

Property Type Description
Basis LNode
EndOfRule EndOfRule
FullLLk bool?
IsExternal bool
IsPrivate bool?
IsRecognizer bool
IsToken bool
K int
Name Symbol
Pred Pred
ReturnType LNode
TryWrapperName LNode
_recognizer Rule

Public Methods

Method Description
CreateMethod ( VList methodBody ) : LNode

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.

GetMethodSignature ( ) : LNode

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

MakeRecognizerVersion ( ) : Rule
MakeRecognizerVersion ( LNode prototype ) : Rule
MakeRecognizerVersion ( Symbol newName ) : Rule
Rule ( LNode basis, Symbol name, Pred pred, bool isStartingRule = true ) : System
ToString ( ) : string
TryWrapperNeeded ( ) : void
operator ( ) : Alts
operator ( ) : Pred

Private Methods

Method Description
MakeRecognizerVersion ( LNode prototype, Symbol newName ) : Rule

Method Details

CreateMethod() public method

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.
public CreateMethod ( VList methodBody ) : LNode
methodBody VList The parsing code that was generated for this rule.
return LNode

GetMethodSignature() public method

Returns Basis if it's a method signature; otherwise constructs a default signature.
public GetMethodSignature ( ) : LNode
return LNode

MakeRecognizerVersion() public method

public MakeRecognizerVersion ( ) : Rule
return Rule

MakeRecognizerVersion() public method

public MakeRecognizerVersion ( LNode prototype ) : Rule
prototype LNode
return Rule

MakeRecognizerVersion() public method

public MakeRecognizerVersion ( Symbol newName ) : Rule
newName Symbol
return Rule

Rule() public method

public Rule ( LNode basis, Symbol name, Pred pred, bool isStartingRule = true ) : System
basis LNode
name Symbol
pred Pred
isStartingRule bool
return System

ToString() public method

public ToString ( ) : string
return string

TryWrapperNeeded() public method

public TryWrapperNeeded ( ) : void
return void

operator() public static method

public static operator ( ) : Alts
return Alts

operator() public static method

public static operator ( ) : Pred
return Pred

Property Details

Basis public_oe property

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.
public LNode Basis
return LNode

EndOfRule public_oe property

public EndOfRule EndOfRule
return EndOfRule

FullLLk public_oe property

public bool? FullLLk
return bool?

IsExternal public_oe property

public bool IsExternal
return bool

IsPrivate public_oe property

public bool? IsPrivate
return bool?

IsRecognizer public_oe property

public bool IsRecognizer
return bool

IsToken public_oe property

public bool IsToken
return bool

K public_oe property

public int K
return int

Name public_oe property

public Symbol Name
return Symbol

Pred public_oe property

public Pred Pred
return Pred

ReturnType public_oe property

public LNode ReturnType
return LNode

TryWrapperName public_oe property

public LNode TryWrapperName
return LNode

_recognizer public_oe property

public Rule,Loyc.LLParserGenerator _recognizer
return Rule