C# 클래스 idTech4.Text.idLexer

Lexicographical parser.
A number directly following the escape character '\' in a string is assumed to be in decimal format instead of octal. Binary numbers of the form 0b.. or 0B.. can also be used.
파일 보기 프로젝트 열기: iainmckay/idtech4.net 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
DefaultPunctuation idTech4.Text.LexerPunctuation[]

공개 메소드들

메소드 설명
CheckTokenString ( string str ) : bool

Checks if the next token matches the given string.

CheckTokenType ( TokenType type, TokenSubType subType ) : idToken

Reads the token when a token with the given type is available.

Error ( string format ) : void
ExpectAnyToken ( ) : idToken
ExpectTokenString ( string str ) : bool
ExpectTokenType ( TokenType type, TokenSubType subType ) : idToken
GetPunctuationFromID ( TokenSubType id ) : string
LoadFile ( string fileName, bool osPath = false ) : bool
LoadMemory ( string text, string name ) : bool

Load a script from the given memory.

LoadMemory ( string text, string name, int startLine ) : bool

Load a script from the given memory and a specified line offset, so source strings extracted from a file can still refer to proper line numbers in the file.

Parse1DMatrix ( int elementCount ) : float[]
Parse2DMatrix ( int y, int x ) : ].float[
ParseBool ( ) : bool

Parses a bool.

ParseFloat ( ) : float

Parses a floating point number.

ParseFloat ( bool &errorFlag ) : float

Parses a floating point number.

If errorFlag is NULL, a non-numeric token will issue an Error(). If it isn't NULL, it will issue a Warning() and set *errorFlag = true.

ParseInt ( ) : int

Parses an int.

ParseRestOfLine ( ) : string
ReadToken ( ) : idToken

Reads the next token.

ReadTokenOnLine ( ) : idToken

Read a token only if on the same line.

SkipBracedSection ( ) : bool

Skips until a matching close brace is found.

SkipBracedSection ( bool parseFirstBrace ) : bool

Skips until a matching close brace is found.

SkipRestOfLine ( ) : bool

Skip the rest of the current line.

SkipUntilString ( string str ) : bool
Warning ( string format ) : void
idLexer ( ) : System
idLexer ( LexerOptions options ) : System

비공개 메소드들

메소드 설명
CheckString ( string str ) : bool
GetBufferCharacter ( int position ) : char
ParseFloat ( bool &errorFlag, bool useErrorFlag ) : float
ReadEscapeCharacter ( char &escapeCharacter ) : bool

Reads two strings with only a white space between them as one string.

ReadName ( idToken token ) : bool
ReadNumber ( idToken token ) : bool
ReadPunctuation ( idToken token ) : bool
ReadString ( idToken token, char quote ) : bool
ReadWhiteSpace ( ) : bool

Reads spaces, tabs, C-like comments, etc.

When a newline character is found the scripts line counter is increased.

메소드 상세

CheckTokenString() 공개 메소드

Checks if the next token matches the given string.
public CheckTokenString ( string str ) : bool
str string
리턴 bool

CheckTokenType() 공개 메소드

Reads the token when a token with the given type is available.
public CheckTokenType ( TokenType type, TokenSubType subType ) : idToken
type TokenType
subType TokenSubType
리턴 idToken

Error() 공개 메소드

public Error ( string format ) : void
format string
리턴 void

ExpectAnyToken() 공개 메소드

public ExpectAnyToken ( ) : idToken
리턴 idToken

ExpectTokenString() 공개 메소드

public ExpectTokenString ( string str ) : bool
str string
리턴 bool

ExpectTokenType() 공개 메소드

public ExpectTokenType ( TokenType type, TokenSubType subType ) : idToken
type TokenType
subType TokenSubType
리턴 idToken

GetPunctuationFromID() 공개 메소드

public GetPunctuationFromID ( TokenSubType id ) : string
id TokenSubType
리턴 string

LoadFile() 공개 메소드

public LoadFile ( string fileName, bool osPath = false ) : bool
fileName string
osPath bool
리턴 bool

LoadMemory() 공개 메소드

Load a script from the given memory.
public LoadMemory ( string text, string name ) : bool
text string
name string
리턴 bool

LoadMemory() 공개 메소드

Load a script from the given memory and a specified line offset, so source strings extracted from a file can still refer to proper line numbers in the file.
public LoadMemory ( string text, string name, int startLine ) : bool
text string
name string
startLine int
리턴 bool

Parse1DMatrix() 공개 메소드

public Parse1DMatrix ( int elementCount ) : float[]
elementCount int
리턴 float[]

Parse2DMatrix() 공개 메소드

public Parse2DMatrix ( int y, int x ) : ].float[
y int
x int
리턴 ].float[

ParseBool() 공개 메소드

Parses a bool.
public ParseBool ( ) : bool
리턴 bool

ParseFloat() 공개 메소드

Parses a floating point number.
public ParseFloat ( ) : float
리턴 float

ParseFloat() 공개 메소드

Parses a floating point number.
If errorFlag is NULL, a non-numeric token will issue an Error(). If it isn't NULL, it will issue a Warning() and set *errorFlag = true.
public ParseFloat ( bool &errorFlag ) : float
errorFlag bool
리턴 float

ParseInt() 공개 메소드

Parses an int.
public ParseInt ( ) : int
리턴 int

ParseRestOfLine() 공개 메소드

public ParseRestOfLine ( ) : string
리턴 string

ReadToken() 공개 메소드

Reads the next token.
public ReadToken ( ) : idToken
리턴 idToken

ReadTokenOnLine() 공개 메소드

Read a token only if on the same line.
public ReadTokenOnLine ( ) : idToken
리턴 idToken

SkipBracedSection() 공개 메소드

Skips until a matching close brace is found.
public SkipBracedSection ( ) : bool
리턴 bool

SkipBracedSection() 공개 메소드

Skips until a matching close brace is found.
public SkipBracedSection ( bool parseFirstBrace ) : bool
parseFirstBrace bool
리턴 bool

SkipRestOfLine() 공개 메소드

Skip the rest of the current line.
public SkipRestOfLine ( ) : bool
리턴 bool

SkipUntilString() 공개 메소드

public SkipUntilString ( string str ) : bool
str string
리턴 bool

Warning() 공개 메소드

public Warning ( string format ) : void
format string
리턴 void

idLexer() 공개 메소드

public idLexer ( ) : System
리턴 System

idLexer() 공개 메소드

public idLexer ( LexerOptions options ) : System
options LexerOptions
리턴 System

프로퍼티 상세

DefaultPunctuation 공개적으로 정적으로 프로퍼티

public static LexerPunctuation[],idTech4.Text DefaultPunctuation
리턴 idTech4.Text.LexerPunctuation[]