C# 클래스 Loyc.Syntax.ParsingService

Extension methods for IParsingService.
파일 보기 프로젝트 열기: qwertie/ecsharp

Private Properties

프로퍼티 타입 설명
ExtensionMatches bool
InitRegisteredLanguages IParsingService>.Map
Single LNode

공개 메소드들

메소드 설명
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.

비공개 메소드들

메소드 설명
ExtensionMatches ( string ext, string fn ) : bool
InitRegisteredLanguages ( ) : IParsingService>.Map
Single ( IListSource e ) : LNode

메소드 상세

GetServiceForFileName() 공개 정적인 메소드

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
리턴 IParsingService

Parse() 공개 정적인 메소드

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
리턴 IListSource

Parse() 공개 정적인 메소드

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
리턴 IListSource

ParseFile() 공개 정적인 메소드

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
리턴 IListSource

ParseSingle() 공개 정적인 메소드

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
리턴 LNode

ParseSingle() 공개 정적인 메소드

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
리턴 LNode

PushCurrent() 공개 정적인 메소드

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
리턴 PushedCurrent

Register() 공개 정적인 메소드

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)
리턴 int

SetDefault() 공개 정적인 메소드

public static SetDefault ( IParsingService newValue ) : SavedValue
newValue IParsingService
리턴 SavedValue

Tokenize() 공개 정적인 메소드

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

Tokenize() 공개 정적인 메소드

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
리턴 ILexer

TokenizeFile() 공개 정적인 메소드

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

Unregister() 공개 정적인 메소드

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)
리턴 int