C# Class MichaelReukauff.Lexer.Lexer

Lexer class.
Mostrar archivo Open project: mreu/ProtobufLanguageService Class Usage Examples

Public Methods

Method Description
Analyze ( ) : void

Analyze the text. Fills the error and token lists.

AnalyzeForCommentsOnly ( ) : void

Analyze for comments only.

Lexer ( string text ) : System

Initializes a new instance of the Lexer class.

Private Methods

Method Description
AddNewError ( int offset, int length, string message, string text = "", CodeType codeType = CodeType.Text ) : void

Add a new error.

AddNewError ( string message, CodeType codeType = CodeType.Text ) : void

Add a new error.

AddNewToken ( CodeType codeType ) : void

Add a new token.

AddNewToken ( Token token ) : void

Add a new token.

AddNewToken ( int offset, int length, string text, CodeType codeType ) : void

Add a new token.

EatComments ( ) : void

Eat all comments from the matches, so we get a clean list wihtout any comments. Put the whole comment into one token.

GetExponent ( ) : bool>.Tuple

Get the E-part of a floating number.

GetFloatNumber ( ) : string

Read a possible floating number from the token collection. float numbers can be in the following formats: nnnn n.nnn n.nnnE+n n.nnnE-n plus a sign in front of the number.

GetString ( string error ) : bool

Get the string from the matches collection.

IncrementIndex ( bool ignoreNewLine = false ) : bool

Increment the index of the match collection by one.

ParseDefault ( Field field ) : bool

Parse the "default" of a message field.

ParseEnum ( bool isTopLevel ) : bool

Parse enum entry.

ParseExtend ( ) : bool

Parse the extend message.

ParseFieldOption ( ) : bool

Parse an option field.

ParseFieldOptions ( Field field ) : bool

Parse field options.

ParseImport ( ) : bool

Parse the import keyword.

ParseMap ( ) : bool

Parse a map.

ParseMessage ( bool isTopLevel ) : bool

Parse a message.

ParseMessageExtensions ( ) : bool

Parse the extension inside a message.

ParseMessageField ( ) : bool

Parse a message field.

ParseOneOf ( ) : bool

Parse a oneof.

ParseOneOfField ( ) : bool

Parse a oneof field.

ParseOption ( bool isTopLevel ) : bool

Parse the option.

ParsePackage ( ) : bool

Parse the package top level statement.

ParseRpc ( ) : bool

Parse the PRC entry.

ParseService ( ) : bool

Parse the service entry.

ParseSyntax ( ) : bool

Parse the option.

ParseTopLevelStatement ( ) : void

Parse top level statement. Must be message, enum, service, extend, import, package or option.

SetOffsetinErrors ( ) : void

Set the line offset in all errors.

Method Details

Analyze() public method

Analyze the text. Fills the error and token lists.
public Analyze ( ) : void
return void

AnalyzeForCommentsOnly() public method

Analyze for comments only.
public AnalyzeForCommentsOnly ( ) : void
return void

Lexer() public method

Initializes a new instance of the Lexer class.
public Lexer ( string text ) : System
text string /// The text to parse. ///
return System