![]() |
Paradox Game Engine
v1.0.0 beta06
|
Public Member Functions | |
bool | FlagIsSet (LanguageFlags flag) |
virtual LanguageData | CreateLanguageData () |
Grammar () | |
Grammar (bool caseSensitive) | |
void | MarkReservedWords (params string[] reservedWords) |
void | RegisterOperators (int precedence, params string[] opSymbols) |
void | RegisterOperators (int precedence, Associativity associativity, params string[] opSymbols) |
void | RegisterOperators (int precedence, params BnfTerm[] opTerms) |
void | RegisterOperators (int precedence, Associativity associativity, params BnfTerm[] opTerms) |
void | RegisterBracePair (string openBrace, string closeBrace) |
void | MarkPunctuation (params string[] symbols) |
void | MarkPunctuation (params BnfTerm[] terms) |
void | MarkTransient (params NonTerminal[] nonTerminals) |
void | MarkMemberSelect (params string[] symbols) |
void | MarkNotReported (params BnfTerm[] terms) |
void | MarkNotReported (params string[] symbols) |
virtual void | CreateTokenFilters (LanguageData language, TokenFilterList filters) |
virtual Token | TryMatch (ParsingContext context, ISourceStream source) |
virtual string | GetParseNodeCaption (ParseTreeNode node) |
virtual void | CreateAstNode (ParsingContext context, ParseTreeNode nodeInfo) |
virtual void | OnScannerSelectTerminal (ParsingContext context) |
Override this method to help scanner select a terminal to create token when there are more than one candidates for an input char. Context.CurrentTerminals contains candidate terminals; leave a single terminal in this list as the one to use. More... | |
virtual void | OnResolvingConflict (ConflictResolutionArgs args) |
Override this method to provide custom conflict resolution; for example, custom code may decide proper shift or reduce action based on preview of tokens ahead. More... | |
virtual void | OnGrammarDataConstructed (LanguageData language) |
virtual void | OnLanguageDataConstructed (LanguageData language) |
virtual string | ConstructParserErrorMessage (ParsingContext context, StringSet expectedTerms) |
virtual void | ReportParseError (ParsingContext context) |
KeyTerm | ToTerm (string text) |
KeyTerm | ToTerm (string text, string name) |
Static Public Member Functions | |
static BnfExpression | MakePlusRule (NonTerminal listNonTerminal, BnfTerm listMember) |
static BnfExpression | MakePlusRule (NonTerminal listNonTerminal, BnfTerm delimiter, BnfTerm listMember, TermListOptions options) |
static BnfExpression | MakePlusRule (NonTerminal listNonTerminal, BnfTerm delimiter, BnfTerm listMember) |
static BnfExpression | MakeStarRule (NonTerminal listNonTerminal, BnfTerm listMember) |
static BnfExpression | MakeStarRule (NonTerminal listNonTerminal, BnfTerm delimiter, BnfTerm listMember) |
static BnfExpression | MakeStarRule (NonTerminal listNonTerminal, BnfTerm delimiter, BnfTerm listMember, TermListOptions options) |
Public Attributes | |
readonly bool | CaseSensitive = true |
Gets case sensitivity of the grammar. Read-only, true by default. Can be set to false only through a parameter to grammar constructor. More... | |
readonly StringComparer | LanguageStringComparer |
string | Delimiters = null |
string | WhitespaceChars = " \t\r\n\v" |
string | LineTerminators = "\n\r\v" |
LanguageFlags | LanguageFlags = LanguageFlags.Default |
TermReportGroupList | TermReportGroups = new TermReportGroupList() |
readonly TerminalSet | NonGrammarTerminals = new TerminalSet() |
readonly TerminalSet | FallbackTerminals = new TerminalSet() |
Type | DefaultNodeType |
NonTerminal | Root |
The main root entry for the grammar. More... | |
Func< Scanner > | ScannerBuilder |
NonTerminalSet | SnippetRoots = new NonTerminalSet() |
string | GrammarComments |
CultureInfo | DefaultCulture = CultureInfo.InvariantCulture |
string | ConsoleTitle |
string | ConsoleGreeting |
string | ConsolePrompt |
string | ConsolePromptMoreInput |
readonly Terminal | Empty = new Terminal("EMPTY") |
readonly Terminal | NewLine = new Terminal("LF") |
readonly Terminal | Indent = new Terminal("INDENT", TokenCategory.Outline, TermFlags.IsNonScanner) |
readonly Terminal | Dedent = new Terminal("DEDENT", TokenCategory.Outline, TermFlags.IsNonScanner) |
readonly Terminal | Eos = new Terminal("EOS", Resources.LabelEosLabel, TokenCategory.Outline, TermFlags.IsNonScanner) |
readonly Terminal | Eof = new Terminal("EOF", TokenCategory.Outline) |
readonly Terminal | LineStartTerminal = new Terminal("LINE_START", TokenCategory.Outline) |
readonly Terminal | SyntaxError = new Terminal("SYNTAX_ERROR", TokenCategory.Error, TermFlags.IsNonScanner) |
KeyTermTable | KeyTerms |
Protected Member Functions | |
GrammarHint | PreferShiftHere () |
GrammarHint | ReduceHere () |
GrammarHint | ResolveInCode () |
TokenPreviewHint | ReduceIf (string symbol) |
TokenPreviewHint | ShiftIf (string symbol) |
GrammarHint | ImplyPrecedenceHere (int precedence) |
GrammarHint | ImplyPrecedenceHere (int precedence, Associativity associativity) |
void | AddTermsReportGroup (string alias, params string[] symbols) |
Creates a terminal reporting group, so all terminals in the group will be reported as a single "alias" in syntex error messages like "Syntax error, expected: [list of terms]" More... | |
void | AddTermsReportGroup (string alias, params Terminal[] terminals) |
Creates a terminal reporting group, so all terminals in the group will be reported as a single "alias" in syntex error messages like "Syntax error, expected: [list of terms]" More... | |
void | AddToNoReportGroup (params string[] symbols) |
Adds symbols to a group with no-report type, so symbols will not be shown in expected lists in syntax error messages. More... | |
void | AddToNoReportGroup (params Terminal[] terminals) |
Adds symbols to a group with no-report type, so symbols will not be shown in expected lists in syntax error messages. More... | |
void | AddOperatorReportGroup (string alias) |
Adds a group and an alias for all operator symbols used in the grammar. More... | |
Properties | |
NonTerminal | NewLinePlus [get] |
NonTerminal | NewLineStar [get] |
static Grammar | CurrentGrammar [get] |
Definition at line 20 of file Grammar.cs.
Irony.Parsing.Grammar.Grammar | ( | ) |
Definition at line 96 of file Grammar.cs.
Irony.Parsing.Grammar.Grammar | ( | bool | caseSensitive | ) |
Definition at line 98 of file Grammar.cs.
References Irony.Resources.MsgDefaultConsoleGreeting, and Irony.Resources.MsgDefaultConsoleTitle.
|
protected |
Adds a group and an alias for all operator symbols used in the grammar.
alias | An alias for operator symbols. |
Definition at line 397 of file Grammar.cs.
|
protected |
Creates a terminal reporting group, so all terminals in the group will be reported as a single "alias" in syntex error messages like "Syntax error, expected: [list of terms]"
alias | An alias for all terminals in the group. |
symbols | Symbols to be included into the group. |
Definition at line 367 of file Grammar.cs.
|
protected |
Creates a terminal reporting group, so all terminals in the group will be reported as a single "alias" in syntex error messages like "Syntax error, expected: [list of terms]"
alias | An alias for all terminals in the group. |
terminals | Terminals to be included into the group. |
Definition at line 376 of file Grammar.cs.
|
protected |
Adds symbols to a group with no-report type, so symbols will not be shown in expected lists in syntax error messages.
symbols | Symbols to exclude. |
Definition at line 383 of file Grammar.cs.
|
protected |
Adds symbols to a group with no-report type, so symbols will not be shown in expected lists in syntax error messages.
symbols | Symbols to exclude. |
Definition at line 390 of file Grammar.cs.
|
virtual |
Definition at line 245 of file Grammar.cs.
References Irony.Resources.ErrParserUnexpInput.
|
virtual |
Definition at line 216 of file Grammar.cs.
|
virtual |
Reimplemented in SiliconStudio.Shaders.Grammar.Hlsl.HlslGrammar.
Definition at line 91 of file Grammar.cs.
|
virtual |
Definition at line 192 of file Grammar.cs.
bool Irony.Parsing.Grammar.FlagIsSet | ( | LanguageFlags | flag | ) |
Definition at line 42 of file Grammar.cs.
Referenced by Irony.Parsing.ImpliedSymbolTerminal.Init(), and Irony.Parsing.IdentifierTerminal.Init().
|
virtual |
Definition at line 201 of file Grammar.cs.
References Irony.Parsing.NonTerminal.GetNodeCaption(), Irony.Parsing.ParseTreeNode.IsError, Irony.Parsing.ParserState.Name, Irony.Parsing.ParseTreeNode.Term, and Irony.Parsing.ParseTreeNode.Token.
|
protected |
Definition at line 348 of file Grammar.cs.
|
protected |
Definition at line 351 of file Grammar.cs.
|
static |
Definition at line 274 of file Grammar.cs.
|
static |
Definition at line 278 of file Grammar.cs.
References Irony.Parsing.BnfTerm.Name.
|
static |
Definition at line 290 of file Grammar.cs.
|
static |
Definition at line 299 of file Grammar.cs.
|
static |
Definition at line 303 of file Grammar.cs.
|
static |
Definition at line 307 of file Grammar.cs.
References Irony.Parsing.BnfTerm.Name.
void Irony.Parsing.Grammar.MarkMemberSelect | ( | params string[] | symbols | ) |
Definition at line 174 of file Grammar.cs.
void Irony.Parsing.Grammar.MarkNotReported | ( | params BnfTerm[] | terms | ) |
Definition at line 180 of file Grammar.cs.
void Irony.Parsing.Grammar.MarkNotReported | ( | params string[] | symbols | ) |
Definition at line 184 of file Grammar.cs.
void Irony.Parsing.Grammar.MarkPunctuation | ( | params string[] | symbols | ) |
Definition at line 156 of file Grammar.cs.
void Irony.Parsing.Grammar.MarkPunctuation | ( | params BnfTerm[] | terms | ) |
Definition at line 163 of file Grammar.cs.
void Irony.Parsing.Grammar.MarkReservedWords | ( | params string[] | reservedWords | ) |
Definition at line 114 of file Grammar.cs.
void Irony.Parsing.Grammar.MarkTransient | ( | params NonTerminal[] | nonTerminals | ) |
Definition at line 169 of file Grammar.cs.
|
virtual |
Definition at line 236 of file Grammar.cs.
|
virtual |
Definition at line 239 of file Grammar.cs.
|
virtual |
Override this method to provide custom conflict resolution; for example, custom code may decide proper shift or reduce action based on preview of tokens ahead.
Definition at line 231 of file Grammar.cs.
|
virtual |
Override this method to help scanner select a terminal to create token when there are more than one candidates for an input char. Context.CurrentTerminals contains candidate terminals; leave a single terminal in this list as the one to use.
Definition at line 225 of file Grammar.cs.
|
protected |
Definition at line 333 of file Grammar.cs.
|
protected |
Definition at line 336 of file Grammar.cs.
|
protected |
Definition at line 342 of file Grammar.cs.
void Irony.Parsing.Grammar.RegisterBracePair | ( | string | openBrace, |
string | closeBrace | ||
) |
Definition at line 147 of file Grammar.cs.
void Irony.Parsing.Grammar.RegisterOperators | ( | int | precedence, |
params string[] | opSymbols | ||
) |
Definition at line 123 of file Grammar.cs.
void Irony.Parsing.Grammar.RegisterOperators | ( | int | precedence, |
Associativity | associativity, | ||
params string[] | opSymbols | ||
) |
Definition at line 127 of file Grammar.cs.
void Irony.Parsing.Grammar.RegisterOperators | ( | int | precedence, |
params BnfTerm[] | opTerms | ||
) |
Definition at line 136 of file Grammar.cs.
void Irony.Parsing.Grammar.RegisterOperators | ( | int | precedence, |
Associativity | associativity, | ||
params BnfTerm[] | opTerms | ||
) |
Definition at line 139 of file Grammar.cs.
|
virtual |
Definition at line 250 of file Grammar.cs.
References Irony.Parsing.ParsingContext.CurrentParserInput, Irony.Resources.ErrNoClosingBrace, Irony.Resources.ErrUnexpEof, Irony.Resources.ErrUnexpIndent, Irony.Parsing.ParsingContext.OpenBraces, and Irony.Parsing.ParseTreeNode.Term.
|
protected |
Definition at line 339 of file Grammar.cs.
|
protected |
Definition at line 345 of file Grammar.cs.
KeyTerm Irony.Parsing.Grammar.ToTerm | ( | string | text | ) |
Definition at line 460 of file Grammar.cs.
Referenced by Irony.Parsing.BnfExpression.operator BnfExpression(), Irony.Parsing.BnfTerm.operator+(), and Irony.Parsing.BnfTerm.operator|().
KeyTerm Irony.Parsing.Grammar.ToTerm | ( | string | text, |
string | name | ||
) |
Definition at line 463 of file Grammar.cs.
|
virtual |
Definition at line 196 of file Grammar.cs.
readonly bool Irony.Parsing.Grammar.CaseSensitive = true |
Gets case sensitivity of the grammar. Read-only, true by default. Can be set to false only through a parameter to grammar constructor.
Definition at line 27 of file Grammar.cs.
Referenced by Irony.Parsing.QuotedValueLiteral.ReadBody(), Irony.Parsing.ConstantTerminal.TryMatch(), and Irony.Parsing.KeyTerm.TryMatch().
string Irony.Parsing.Grammar.ConsoleGreeting |
Definition at line 83 of file Grammar.cs.
string Irony.Parsing.Grammar.ConsolePrompt |
Definition at line 84 of file Grammar.cs.
string Irony.Parsing.Grammar.ConsolePromptMoreInput |
Definition at line 85 of file Grammar.cs.
string Irony.Parsing.Grammar.ConsoleTitle |
Definition at line 82 of file Grammar.cs.
readonly Terminal Irony.Parsing.Grammar.Dedent = new Terminal("DEDENT", TokenCategory.Outline, TermFlags.IsNonScanner) |
Definition at line 417 of file Grammar.cs.
CultureInfo Irony.Parsing.Grammar.DefaultCulture = CultureInfo.InvariantCulture |
Definition at line 79 of file Grammar.cs.
Type Irony.Parsing.Grammar.DefaultNodeType |
Definition at line 62 of file Grammar.cs.
string Irony.Parsing.Grammar.Delimiters = null |
Definition at line 32 of file Grammar.cs.
Definition at line 412 of file Grammar.cs.
Definition at line 425 of file Grammar.cs.
Referenced by Irony.Parsing.TokenPreviewHint.Match(), Irony.Parsing.DefaultScanner.NextToken(), and Irony.Parsing.DefaultScanner.VsReadToken().
readonly Terminal Irony.Parsing.Grammar.Eos = new Terminal("EOS", Resources.LabelEosLabel, TokenCategory.Outline, TermFlags.IsNonScanner) |
Definition at line 421 of file Grammar.cs.
readonly TerminalSet Irony.Parsing.Grammar.FallbackTerminals = new TerminalSet() |
Definition at line 60 of file Grammar.cs.
string Irony.Parsing.Grammar.GrammarComments |
Definition at line 77 of file Grammar.cs.
readonly Terminal Irony.Parsing.Grammar.Indent = new Terminal("INDENT", TokenCategory.Outline, TermFlags.IsNonScanner) |
Definition at line 416 of file Grammar.cs.
KeyTermTable Irony.Parsing.Grammar.KeyTerms |
Definition at line 458 of file Grammar.cs.
Referenced by SiliconStudio.Shaders.Grammar.ShaderLanguageData.ShaderLanguageData().
LanguageFlags Irony.Parsing.Grammar.LanguageFlags = LanguageFlags.Default |
Definition at line 40 of file Grammar.cs.
readonly StringComparer Irony.Parsing.Grammar.LanguageStringComparer |
Definition at line 28 of file Grammar.cs.
readonly Terminal Irony.Parsing.Grammar.LineStartTerminal = new Terminal("LINE_START", TokenCategory.Outline) |
Definition at line 428 of file Grammar.cs.
string Irony.Parsing.Grammar.LineTerminators = "\n\r\v" |
Definition at line 37 of file Grammar.cs.
Definition at line 415 of file Grammar.cs.
readonly TerminalSet Irony.Parsing.Grammar.NonGrammarTerminals = new TerminalSet() |
Definition at line 52 of file Grammar.cs.
NonTerminal Irony.Parsing.Grammar.Root |
The main root entry for the grammar.
Definition at line 68 of file Grammar.cs.
Func<Scanner> Irony.Parsing.Grammar.ScannerBuilder |
Definition at line 70 of file Grammar.cs.
NonTerminalSet Irony.Parsing.Grammar.SnippetRoots = new NonTerminalSet() |
Alternative roots for parsing code snippets.
Definition at line 75 of file Grammar.cs.
Referenced by Irony.Parsing.StringLiteral.Init().
readonly Terminal Irony.Parsing.Grammar.SyntaxError = new Terminal("SYNTAX_ERROR", TokenCategory.Error, TermFlags.IsNonScanner) |
Definition at line 431 of file Grammar.cs.
TermReportGroupList Irony.Parsing.Grammar.TermReportGroups = new TermReportGroupList() |
Definition at line 46 of file Grammar.cs.
string Irony.Parsing.Grammar.WhitespaceChars = " \t\r\n\v" |
Definition at line 34 of file Grammar.cs.
Referenced by Irony.Parsing.DefaultScanner.NextToken().
|
staticget |
Definition at line 488 of file Grammar.cs.
Referenced by Irony.Parsing.BnfExpression.operator BnfExpression(), Irony.Parsing.BnfTerm.operator+(), and Irony.Parsing.BnfTerm.operator|().
|
get |
Definition at line 433 of file Grammar.cs.
|
get |
Definition at line 444 of file Grammar.cs.