Свойство | Type | Description | |
---|---|---|---|
F | |||
_Check | Symbol | ||
_Error | Symbol | ||
_LA | Symbol | ||
_LA0 | Symbol | ||
_Match | Symbol | ||
_MatchAny | Symbol | ||
_MatchExcept | Symbol | ||
_MatchExceptRange | Symbol | ||
_MatchRange | Symbol | ||
_Skip | Symbol | ||
_T | Symbol | ||
_TryMatch | Symbol | ||
_TryMatchExcept | Symbol | ||
_TryMatchExceptRange | Symbol | ||
_TryMatchRange | Symbol | ||
_alias | Symbol | ||
_classBody | WList |
||
_currentRule | |||
_definedAliases | LNode>.Dictionary | ||
_setNameCounter | int | ||
_underscore | Symbol |
Méthode | Description | |
---|---|---|
Begin ( WList |
||
BeginRule ( |
||
CallRule ( RuleRef rref, bool recognizerMode ) : LNode | ||
CallTryRecognizer ( RuleRef rref, int lookahead ) : LNode | ||
CodeGenHelperBase ( ) : System | ||
CodeToTerminalPred ( LNode expr, string &errorMsg ) : Pred | ||
CreateRuleMethod ( |
||
CreateTryWrapperForRecognizer ( |
See IPGCodeGenHelper.CreateTryWrapperForRecognizer for more information.
|
|
Done ( ) : void | ||
ErrorBranch ( IPGTerminalSet covered, int laIndex ) : LNode |
Generates code for the default error branch of prediction (called when there is no explicit error branch).
|
|
Example ( IPGTerminalSet set ) : string | ||
ExampleChar ( IPGTerminalSet set ) : char? | ||
GenerateAndPredCheck ( AndPred andPred, LNode code, int li ) : LNode |
Generate code to check an and-predicate during or after prediction, e.g. &!{foo} becomes !(foo) during prediction and Check(!(foo)); afterward. LLLPG substitutes $LI and $LA before it calls this method. This method can return null to suppress the Check statement. |
|
GenerateMatch ( IPGTerminalSet set, bool savingResult, bool recognizerMode ) : LNode | ||
GenerateMatchExpr ( IPGTerminalSet set, bool savingResult, bool recognizerMode ) : LNode |
Generate code to match a set, e.g.
|
|
GenerateSkip ( bool savingResult ) : LNode |
Returns
|
|
GenerateSwitch ( IPGTerminalSet branchSets, MSet |
||
GenerateTest ( IPGTerminalSet set, LNode laVar ) : LNode | ||
GetListType ( LNode type ) : LNode | ||
LA ( int k ) : LNode |
Generates code to read LA(k).
|
|
LAType ( ) : LNode |
Returns the data type of LA(k)
|
|
MakeInitializedVarDecl ( LNode type, bool wantList, Symbol varName ) : LNode | ||
Optimize ( IPGTerminalSet set, IPGTerminalSet dontcare ) : IPGTerminalSet | ||
ResolveAlias ( LNode expr ) : LNode | ||
SetListInitializer ( LNode varDecl ) : void |
Sets ListType and/or ListInitializer based on an expression. A statement like
|
|
ShouldGenerateSwitch ( IPGTerminalSet sets, MSet |
Decides whether to use a switch() and for which cases, using BaseCostForSwitch and GetRelativeCostForSwitch.
|
|
VisitInput ( LNode stmt, IMessageSink sink ) : LNode |
Méthode | Description | |
---|---|---|
ApiCall ( Symbol apiName ) : LNode |
Returns an LNode representing a call to the specified LLLPG API. For example, if the user used a "inputSource=input" option, then
|
|
ApiCall ( Symbol apiName, IEnumerable |
Returns an LNode representing a call to the specified LLLPG API. For example, if the user used a "inputSource=input" option, then
|
|
ApiType ( LNode typeName ) : LNode | ||
DefaultOf ( LNode type, bool wantList ) : LNode | ||
EndMayBeReachable ( LNode stmt ) : bool | ||
GenerateSetDecl ( IPGTerminalSet set, Symbol setName ) : LNode |
Generates a declaration for a variable that holds the set. For example, if setName is foo, a set such as [aeiouy] might use an external declaration such as |
|
GenerateSetDecl ( IPGTerminalSet set ) : Symbol | ||
GenerateSetName ( |
||
GenerateTest ( IPGTerminalSet set, LNode subject, Symbol setName ) : LNode |
Generates code to test whether a terminal is in the set. At first, LLParserGenerator calls this method with |
|
GetCases ( IPGTerminalSet set ) : IEnumerable |
Gets the literals or symbols to use for switch cases of a set (just the values, not including the case labels.)
|
|
GetRelativeCostForSwitch ( IPGTerminalSet set ) : int |
Used to help decide whether a "switch" or an if statement will be used to handle a prediction tree, and if so which branches. This method should calculate the "cost of switch" (which generally represents a code size penalty, as there is a separate case for every element of the set) and the "cost of if" (which generally represents a speed penalty) and return the difference (so that positive numbers favor "switch" and negative numbers favor "if".) If the set is inverted, return a something like -1000000 to ensure 'switch' is not used for that set. |
Méthode | Description | |
---|---|---|
AddSwitchHandler ( LNode branch, WList |
||
ForwardedArgList ( LNode args ) : VList |
||
ReplaceT ( LNode expr, LNode replacement ) : LNode | ||
VarName ( LNode varStmt ) : LNode |
protected ApiCall ( Symbol apiName ) : LNode | ||
apiName | Symbol | |
Résultat | LNode |
protected ApiCall ( Symbol apiName, IEnumerable |
||
apiName | Symbol | |
args | IEnumerable |
Parameters to the API call, or null to access a /// property or field. |
isStatic | bool | |
Résultat | LNode |
protected ApiType ( LNode typeName ) : LNode | ||
typeName | LNode | |
Résultat | LNode |
public Begin ( WList |
||
classBody | WList |
|
sourceFile | ISourceFile | |
Résultat | void |
public CallRule ( RuleRef rref, bool recognizerMode ) : LNode | ||
rref | RuleRef | |
recognizerMode | bool | |
Résultat | LNode |
public CallTryRecognizer ( RuleRef rref, int lookahead ) : LNode | ||
rref | RuleRef | |
lookahead | int | |
Résultat | LNode |
public abstract CodeToTerminalPred ( LNode expr, string &errorMsg ) : Pred | ||
expr | LNode | |
errorMsg | string | |
Résultat | Pred |
public CreateRuleMethod ( |
||
rule | ||
methodBody | VList |
|
Résultat | LNode |
public CreateTryWrapperForRecognizer ( |
||
rule | ||
Résultat | LNode |
protected DefaultOf ( LNode type, bool wantList ) : LNode | ||
type | LNode | |
wantList | bool | |
Résultat | LNode |
protected static EndMayBeReachable ( LNode stmt ) : bool | ||
stmt | LNode | |
Résultat | bool |
public ErrorBranch ( IPGTerminalSet covered, int laIndex ) : LNode | ||
covered | IPGTerminalSet | The permitted token set, which the input did not match.
/// NOTE: if the input matched but there were and-predicates that did not match,
/// this parameter will be null (e.g. the input is 'b' in |
laIndex | int | Location of unexpected input, relative to current position. |
Résultat | LNode |
public abstract Example ( IPGTerminalSet set ) : string | ||
set | IPGTerminalSet | |
Résultat | string |
public ExampleChar ( IPGTerminalSet set ) : char? | ||
set | IPGTerminalSet | |
Résultat | char? |
public GenerateAndPredCheck ( AndPred andPred, LNode code, int li ) : LNode | ||
andPred | AndPred | Predicate for which an expression has already been generated |
code | LNode | The expression to be checked |
li | int | Current lookahead amount. -1 means "prediction is /// complete, generate a Check() statement". |
Résultat | LNode |
public GenerateMatch ( IPGTerminalSet set, bool savingResult, bool recognizerMode ) : LNode | ||
set | IPGTerminalSet | |
savingResult | bool | |
recognizerMode | bool | |
Résultat | LNode |
public abstract GenerateMatchExpr ( IPGTerminalSet set, bool savingResult, bool recognizerMode ) : LNode | ||
set | IPGTerminalSet | |
savingResult | bool | |
recognizerMode | bool | |
Résultat | LNode |
protected abstract GenerateSetDecl ( IPGTerminalSet set, Symbol setName ) : LNode | ||
set | IPGTerminalSet | |
setName | Symbol | |
Résultat | LNode |
protected GenerateSetDecl ( IPGTerminalSet set ) : Symbol | ||
set | IPGTerminalSet | |
Résultat | Symbol |
protected GenerateSetName ( |
||
currentRule | ||
Résultat | Symbol |
public GenerateSkip ( bool savingResult ) : LNode | ||
savingResult | bool | |
Résultat | LNode |
public GenerateSwitch ( IPGTerminalSet branchSets, MSet |
||
branchSets | IPGTerminalSet | |
casesToInclude | MSet |
|
branchCode | LNode | |
defaultBranch | LNode | |
laVar | LNode | |
Résultat | LNode |
public GenerateTest ( IPGTerminalSet set, LNode laVar ) : LNode | ||
set | IPGTerminalSet | |
laVar | LNode | |
Résultat | LNode |
protected abstract GenerateTest ( IPGTerminalSet set, LNode subject, Symbol setName ) : LNode | ||
set | IPGTerminalSet | |
subject | LNode | Represents the variable to be tested. |
setName | Symbol | Names an external set variable to use for the test. |
Résultat | LNode |
protected GetCases ( IPGTerminalSet set ) : IEnumerable |
||
set | IPGTerminalSet | |
Résultat | IEnumerable |
protected GetRelativeCostForSwitch ( IPGTerminalSet set ) : int | ||
set | IPGTerminalSet | |
Résultat | int |
public MakeInitializedVarDecl ( LNode type, bool wantList, Symbol varName ) : LNode | ||
type | LNode | |
wantList | bool | |
varName | Symbol | |
Résultat | LNode |
public Optimize ( IPGTerminalSet set, IPGTerminalSet dontcare ) : IPGTerminalSet | ||
set | IPGTerminalSet | |
dontcare | IPGTerminalSet | |
Résultat | IPGTerminalSet |
public SetListInitializer ( LNode varDecl ) : void | ||
varDecl | LNode | |
Résultat | void |
public ShouldGenerateSwitch ( IPGTerminalSet sets, MSet |
||
sets | IPGTerminalSet | |
casesToInclude | MSet |
|
hasErrorBranch | bool | |
Résultat | bool |
public VisitInput ( LNode stmt, IMessageSink sink ) : LNode | ||
stmt | LNode | |
sink | IMessageSink | |
Résultat | LNode |
protected static Symbol _MatchExceptRange | ||
Résultat | Symbol |
protected static Symbol _TryMatchExcept | ||
Résultat | Symbol |
protected static Symbol _TryMatchExceptRange | ||
Résultat | Symbol |
protected static Symbol _TryMatchRange | ||
Résultat | Symbol |
protected Dictionary |
||
Résultat | LNode>.Dictionary |