C# Class Loyc.Syntax.ParsingService

Extension methods for IParsingService.
Afficher le fichier Open project: qwertie/ecsharp

Private Properties

Свойство Type Description
ExtensionMatches bool
InitRegisteredLanguages IParsingService>.Map
Single LNode

Méthodes publiques

Méthode Description
GetServiceForFileName ( string filename ) : IParsingService

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.

Parse ( this parser, Stream stream, string fileName, ParsingMode inputType = null, IMessageSink msgs = null, bool preserveComments = true ) : IListSource

Parses a Stream.

Parse ( this parser, UString input, IMessageSink msgs = null, ParsingMode inputType = null, bool preserveComments = true ) : IListSource

Parses a string by invoking IParsingService.Parse(ICharSource, string, IMessageSink, ParsingMode, bool) using an empty string as the file name.

ParseFile ( this parser, string fileName, IMessageSink msgs = null, ParsingMode inputType = null, bool preserveComments = true ) : IListSource

Opens the specified file and parses it.

ParseSingle ( this parser, ICharSource text, string fileName, IMessageSink msgs = null, ParsingMode inputType = null, bool preserveComments = true ) : LNode

Parses a string and expects exactly one output.

ParseSingle ( this parser, UString expr, IMessageSink msgs = null, ParsingMode inputType = null, bool preserveComments = true ) : LNode

Parses a string and expects exactly one output.

PushCurrent ( IParsingService newValue ) : PushedCurrent

Sets the current language service, returning a value suitable for use in a C# using statement, which will restore the old service.

Register ( IParsingService service, IEnumerable fileExtensions = null ) : int

Registers a parsing service.

This method does not replace existing registrations.

SetDefault ( IParsingService newValue ) : SavedValue
Tokenize ( this parser, Stream stream, string fileName, IMessageSink msgs = null ) : ILexer

Parses a Stream.

Tokenize ( this parser, UString input, IMessageSink msgs = null ) : ILexer

Parses a string by invoking IParsingService.Tokenize(ICharSource, string, IMessageSink) using an empty string as the file name.

TokenizeFile ( this parser, string fileName, IMessageSink msgs = null ) : ILexer

Opens the specified file and tokenizes it.

Unregister ( IParsingService service, IEnumerable fileExtensions = null ) : int

Unregisters a language service.

The service for a file extension is not removed unless the given service reference is equal to the registered service.

Private Methods

Méthode Description
ExtensionMatches ( string ext, string fn ) : bool
InitRegisteredLanguages ( ) : IParsingService>.Map
Single ( IListSource e ) : LNode

Method Details

GetServiceForFileName() public static méthode

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.
public static GetServiceForFileName ( string filename ) : IParsingService
filename string
Résultat IParsingService

Parse() public static méthode

Parses a Stream.
public static Parse ( this parser, Stream stream, string fileName, ParsingMode inputType = null, IMessageSink msgs = null, bool preserveComments = true ) : IListSource
parser this
stream Stream
fileName string
inputType ParsingMode
msgs IMessageSink
preserveComments bool
Résultat IListSource

Parse() public static méthode

Parses a string by invoking IParsingService.Parse(ICharSource, string, IMessageSink, ParsingMode, bool) using an empty string as the file name.
public static Parse ( this parser, UString input, IMessageSink msgs = null, ParsingMode inputType = null, bool preserveComments = true ) : IListSource
parser this
input UString
msgs IMessageSink
inputType ParsingMode
preserveComments bool
Résultat IListSource

ParseFile() public static méthode

Opens the specified file and parses it.
public static ParseFile ( this parser, string fileName, IMessageSink msgs = null, ParsingMode inputType = null, bool preserveComments = true ) : IListSource
parser this
fileName string
msgs IMessageSink
inputType ParsingMode
preserveComments bool
Résultat IListSource

ParseSingle() public static méthode

Parses a string and expects exactly one output.
The output list was empty or contained multiple nodes.
public static ParseSingle ( this parser, ICharSource text, string fileName, IMessageSink msgs = null, ParsingMode inputType = null, bool preserveComments = true ) : LNode
parser this
text ICharSource
fileName string
msgs IMessageSink
inputType ParsingMode
preserveComments bool
Résultat LNode

ParseSingle() public static méthode

Parses a string and expects exactly one output.
The output list was empty or contained multiple nodes.
public static ParseSingle ( this parser, UString expr, IMessageSink msgs = null, ParsingMode inputType = null, bool preserveComments = true ) : LNode
parser this
expr UString
msgs IMessageSink
inputType ParsingMode
preserveComments bool
Résultat LNode

PushCurrent() public static méthode

Sets the current language service, returning a value suitable for use in a C# using statement, which will restore the old service.
public static PushCurrent ( IParsingService newValue ) : PushedCurrent
newValue IParsingService new value of Current
Résultat PushedCurrent

Register() public static méthode

Registers a parsing service.
This method does not replace existing registrations.
public static Register ( IParsingService service, IEnumerable fileExtensions = null ) : int
service IParsingService Service to register.
fileExtensions IEnumerable File extensions affected (null to use the service's own list)
Résultat int

SetDefault() public static méthode

public static SetDefault ( IParsingService newValue ) : SavedValue
newValue IParsingService
Résultat SavedValue

Tokenize() public static méthode

Parses a Stream.
public static Tokenize ( this parser, Stream stream, string fileName, IMessageSink msgs = null ) : ILexer
parser this
stream Stream
fileName string
msgs IMessageSink
Résultat ILexer

Tokenize() public static méthode

Parses a string by invoking IParsingService.Tokenize(ICharSource, string, IMessageSink) using an empty string as the file name.
public static Tokenize ( this parser, UString input, IMessageSink msgs = null ) : ILexer
parser this
input UString
msgs IMessageSink
Résultat ILexer

TokenizeFile() public static méthode

Opens the specified file and tokenizes it.
public static TokenizeFile ( this parser, string fileName, IMessageSink msgs = null ) : ILexer
parser this
fileName string
msgs IMessageSink
Résultat ILexer

Unregister() public static méthode

Unregisters a language service.
The service for a file extension is not removed unless the given service reference is equal to the registered service.
public static Unregister ( IParsingService service, IEnumerable fileExtensions = null ) : int
service IParsingService Service to unregister
fileExtensions IEnumerable File extensions affected (null to use the service's own list)
Résultat int