Свойство | Тип | Описание | |
---|---|---|---|
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 |
Метод | Описание | |
---|---|---|
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 |
Метод | Описание | |
---|---|---|
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. |
Метод | Описание | |
---|---|---|
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 | |
Результат | 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 | |
Результат | LNode |
protected ApiType ( LNode typeName ) : LNode | ||
typeName | LNode | |
Результат | LNode |
public Begin ( WList |
||
classBody | WList |
|
sourceFile | ISourceFile | |
Результат | void |
public CallRule ( RuleRef rref, bool recognizerMode ) : LNode | ||
rref | RuleRef | |
recognizerMode | bool | |
Результат | LNode |
public CallTryRecognizer ( RuleRef rref, int lookahead ) : LNode | ||
rref | RuleRef | |
lookahead | int | |
Результат | LNode |
public abstract CodeToTerminalPred ( LNode expr, string &errorMsg ) : Pred | ||
expr | LNode | |
errorMsg | string | |
Результат | Pred |
public CreateRuleMethod ( |
||
rule | ||
methodBody | VList |
|
Результат | LNode |
public CreateTryWrapperForRecognizer ( |
||
rule | ||
Результат | LNode |
protected DefaultOf ( LNode type, bool wantList ) : LNode | ||
type | LNode | |
wantList | bool | |
Результат | LNode |
protected static EndMayBeReachable ( LNode stmt ) : bool | ||
stmt | LNode | |
Результат | 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. |
Результат | LNode |
public abstract Example ( IPGTerminalSet set ) : string | ||
set | IPGTerminalSet | |
Результат | string |
public ExampleChar ( IPGTerminalSet set ) : char? | ||
set | IPGTerminalSet | |
Результат | 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". |
Результат | LNode |
public GenerateMatch ( IPGTerminalSet set, bool savingResult, bool recognizerMode ) : LNode | ||
set | IPGTerminalSet | |
savingResult | bool | |
recognizerMode | bool | |
Результат | LNode |
public abstract GenerateMatchExpr ( IPGTerminalSet set, bool savingResult, bool recognizerMode ) : LNode | ||
set | IPGTerminalSet | |
savingResult | bool | |
recognizerMode | bool | |
Результат | LNode |
protected abstract GenerateSetDecl ( IPGTerminalSet set, Symbol setName ) : LNode | ||
set | IPGTerminalSet | |
setName | Symbol | |
Результат | LNode |
protected GenerateSetDecl ( IPGTerminalSet set ) : Symbol | ||
set | IPGTerminalSet | |
Результат | Symbol |
protected GenerateSetName ( |
||
currentRule | ||
Результат | Symbol |
public GenerateSkip ( bool savingResult ) : LNode | ||
savingResult | bool | |
Результат | LNode |
public GenerateSwitch ( IPGTerminalSet branchSets, MSet |
||
branchSets | IPGTerminalSet | |
casesToInclude | MSet |
|
branchCode | LNode | |
defaultBranch | LNode | |
laVar | LNode | |
Результат | LNode |
public GenerateTest ( IPGTerminalSet set, LNode laVar ) : LNode | ||
set | IPGTerminalSet | |
laVar | LNode | |
Результат | 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. |
Результат | LNode |
protected GetCases ( IPGTerminalSet set ) : IEnumerable |
||
set | IPGTerminalSet | |
Результат | IEnumerable |
protected GetRelativeCostForSwitch ( IPGTerminalSet set ) : int | ||
set | IPGTerminalSet | |
Результат | int |
public MakeInitializedVarDecl ( LNode type, bool wantList, Symbol varName ) : LNode | ||
type | LNode | |
wantList | bool | |
varName | Symbol | |
Результат | LNode |
public Optimize ( IPGTerminalSet set, IPGTerminalSet dontcare ) : IPGTerminalSet | ||
set | IPGTerminalSet | |
dontcare | IPGTerminalSet | |
Результат | IPGTerminalSet |
public ResolveAlias ( LNode expr ) : LNode | ||
expr | LNode | |
Результат | LNode |
public SetListInitializer ( LNode varDecl ) : void | ||
varDecl | LNode | |
Результат | void |
public ShouldGenerateSwitch ( IPGTerminalSet sets, MSet |
||
sets | IPGTerminalSet | |
casesToInclude | MSet |
|
hasErrorBranch | bool | |
Результат | bool |
public VisitInput ( LNode stmt, IMessageSink sink ) : LNode | ||
stmt | LNode | |
sink | IMessageSink | |
Результат | LNode |
protected static Symbol _MatchExceptRange | ||
Результат | Symbol |
protected static Symbol _TryMatchExcept | ||
Результат | Symbol |
protected static Symbol _TryMatchExceptRange | ||
Результат | Symbol |
protected static Symbol _TryMatchRange | ||
Результат | Symbol |
protected Dictionary |
||
Результат | LNode>.Dictionary |