|
Enhanced C#
Language of your choice: library documentation
|
Standard extension methods for IParsingService. More...
Standard extension methods for IParsingService.
Nested classes | |
| struct | PushedCurrent |
| Returned by PushCurrent(IParsingService). More... | |
Properties | |
| static IParsingService?? | Default [get, set] |
| Gets or sets the default language service on this thread. If no service has been assigned on this thread, returns Les2LanguageService.Value. More... | |
| static IParsingService | Current [get, set] |
| static IReadOnlyDictionary< string, IParsingService > | RegisteredLanguages [get] |
Dictionary of registered parsing services, keyed by file extension (without leading dots). The default dictionary contains one pair: ("les", LesLanguageService.Value) More... | |
Static Public Member Functions | |
| static SavedValue< IParsingService > | SetDefault (IParsingService newValue) |
| static int | Register (IParsingService service, IEnumerable< string > fileExtensions=null) |
| Registers a parsing service. More... | |
| static int | Unregister (IParsingService service, IEnumerable< string > fileExtensions=null) |
| Unregisters a language service. More... | |
| static IParsingService | GetServiceForFileName (string filename) |
| Finds the language service associated with the longest matching registered file extension. More... | |
| static PushedCurrent | PushCurrent (IParsingService newValue) |
| Sets the current language service, returning a value suitable for use in a C# using statement, which will restore the old service. More... | |
| static ILexer< Token > | Tokenize (this IParsingService parser, UString input, IMessageSink msgs=null) |
| Parses a string by invoking IParsingService.Tokenize(ICharSource, string, IMessageSink, IParsingOptions) using an empty string as the file name. More... | |
| static ILexer< Token > | Tokenize (this IParsingService parser, ICharSource text, string fileName, IMessageSink msgs=null) |
| Parses a string by invoking IParsingService.Tokenize(ICharSource, string, IMessageSink, IParsingOptions) using default options. More... | |
| static IListSource< LNode > | Parse (this IParsingService parser, UString input, IMessageSink msgs=null, ParsingMode inputType=null, bool preserveComments=true) |
| Parses a string by invoking IParsingService.Parse(ICharSource, string, IMessageSink, IParsingOptions) using an empty string as the file name. More... | |
| static IListSource< LNode > | Parse (this IParsingService parser, UString input, IMessageSink msgs, IParsingOptions options) |
| Parses a string by invoking IParsingService.Parse(ICharSource, string, IMessageSink, IParsingOptions) using an empty string as the file name. More... | |
| static IListSource< LNode > | Parse (this IParsingService parser, ICharSource text, string fileName, IMessageSink msgs=null, ParsingMode inputType=null, bool preserveComments=true) |
| static IListSource< LNode > | Parse (this IParsingService parser, ILexer< Token > input, IMessageSink msgs=null, ParsingMode mode=null, bool preserveComments=true) |
| static IListSource< LNode > | Parse (this IParsingService parser, IListSource< Token > tokens, ISourceFile file, IMessageSink msgs, ParsingMode inputType=null) |
| static LNode | ParseSingle (this IParsingService parser, UString expr, IMessageSink msgs=null, ParsingMode inputType=null, bool preserveComments=true) |
| static LNode | ParseSingle (this IParsingService parser, UString expr, IMessageSink msgs, IParsingOptions options) |
| Parses a string and expects exactly one output. More... | |
| static LNode | ParseSingle (this IParsingService parser, ICharSource text, string fileName, IMessageSink msgs=null, ParsingMode inputType=null, bool preserveComments=true) |
| static LNode | ParseSingle (this IParsingService parser, ICharSource text, string fileName, IMessageSink msgs=null, IParsingOptions options=null) |
| Parses a string and expects exactly one output. More... | |
| static IListSource< LNode > | Parse (this IParsingService parser, Stream stream, string fileName, ParsingMode inputType=null, IMessageSink msgs=null, bool preserveComments=true) |
| Parses a Stream. More... | |
| static ILexer< Token > | Tokenize (this IParsingService parser, Stream stream, string fileName, IMessageSink msgs=null) |
| Parses a Stream. More... | |
| static IListSource< LNode > | ParseFile (this IParsingService parser, string fileName, IMessageSink msgs=null, ParsingMode inputType=null, bool preserveComments=true) |
| Opens the specified file, parses the entire file, and closes the file. More... | |
| static ILexer< Token > | TokenizeFile (this IParsingService parser, string fileName, IMessageSink msgs=null) |
| Opens the specified file and tokenizes it. More... | |
|
inlinestatic |
Finds the language service associated with the longest matching registered file extension.
Returns null if there is no registered language service for the filename's extension.
References Loyc.Syntax.ParsingService.RegisteredLanguages.
Referenced by LeMP.Compiler.ProcessArguments().
|
inlinestatic |
Parses a Stream.
References Loyc.Syntax.IParsingService.Parse().
|
inlinestatic |
Parses a string by invoking IParsingService.Parse(ICharSource, string, IMessageSink, IParsingOptions) using an empty string as the file name.
References Loyc.Syntax.IParsingService.Parse().
|
inlinestatic |
Parses a string by invoking IParsingService.Parse(ICharSource, string, IMessageSink, IParsingOptions) using an empty string as the file name.
References Loyc.Syntax.IParsingService.Parse().
Referenced by Loyc.Syntax.ParsingService.ParseFile(), and Loyc.Syntax.ParsingService.ParseSingle().
|
inlinestatic |
Opens the specified file, parses the entire file, and closes the file.
References Loyc.Syntax.ParsingMode.File, and Loyc.Syntax.ParsingService.Parse().
|
inlinestatic |
Parses a string and expects exactly one output.
| InvalidOperationException | The output list was empty or contained multiple nodes. |
References Loyc.Syntax.IParsingService.Parse().
|
inlinestatic |
Parses a string and expects exactly one output.
| InvalidOperationException | The output list was empty or contained multiple nodes. |
References Loyc.Syntax.ParsingService.Parse().
|
inlinestatic |
Sets the current language service, returning a value suitable for use in a C# using statement, which will restore the old service.
| newValue | new value of Current |
|
inlinestatic |
Registers a parsing service.
| service | Service to register. |
| fileExtensions | File extensions affected (null to use the service's own list) |
This method does not replace existing registrations.
References Loyc.Collections.Map< K, V >.With().
|
inlinestatic |
Parses a string by invoking IParsingService.Tokenize(ICharSource, string, IMessageSink, IParsingOptions) using default options.
References Loyc.Syntax.IParsingService.Tokenize().
|
inlinestatic |
Parses a Stream.
References Loyc.Syntax.IParsingService.Tokenize().
|
inlinestatic |
Parses a string by invoking IParsingService.Tokenize(ICharSource, string, IMessageSink, IParsingOptions) using an empty string as the file name.
References Loyc.Syntax.IParsingService.Tokenize().
Referenced by Loyc.Syntax.ParsingService.TokenizeFile().
|
inlinestatic |
Opens the specified file and tokenizes it.
References Loyc.Syntax.ParsingService.Tokenize().
|
inlinestatic |
Unregisters a language service.
| service | Service to unregister |
| fileExtensions | File extensions affected (null to use the service's own list) |
The service for a file extension is not removed unless the given service reference is equal to the registered service.
References Loyc.Syntax.IParsingService.FileExtensions, and Loyc.Collections.Map< K, V >.Without().
|
staticgetset |
Gets or sets the default language service on this thread. If no service has been assigned on this thread, returns Les2LanguageService.Value.
|
staticget |
Dictionary of registered parsing services, keyed by file extension (without leading dots). The default dictionary contains one pair: ("les", LesLanguageService.Value)
Referenced by Loyc.Syntax.ParsingService.GetServiceForFileName().
1.8.17