C# 클래스 Jurassic.Compiler.Lexer

Converts a JavaScript source file into a series of tokens.
상속: IDisposable
파일 보기 프로젝트 열기: paulbartrum/jurassic 1 사용 예제들

공개 메소드들

메소드 설명
Dispose ( ) : void

Cleans up any resources used by the lexer.

Lexer ( ScriptEngine engine, ScriptSource source ) : System

Creates a Lexer instance with the given source of text.

NextToken ( ) : Jurassic.Compiler.Token

Reads the next token from the reader.

ReadStringLiteral ( int firstChar ) : Jurassic.Compiler.Token

Reads a string literal.

비공개 메소드들

메소드 설명
IsHexDigit ( int c ) : bool

Determines if the given character is valid in a hexidecimal number.

IsIdentifierChar ( int c ) : bool

Determines if the given character is valid as a character of an identifier.

IsIdentifierStartChar ( int c ) : bool

Determines if the given character is valid as the first character of an identifier.

IsLineTerminator ( int c ) : bool

Determines if the given character is a line terminator.

IsNumericLiteralStartChar ( int c ) : bool

Determines if the given character is valid as the first character of a numeric literal.

IsPunctuatorStartChar ( int c ) : bool

Determines if the given character is valid as the first character of a punctuator.

IsStringLiteralStartChar ( int c ) : bool

Determines if the given character is valid as the first character of a string literal.

IsWhiteSpace ( int c ) : bool

Determines if the given character is whitespace.

ReadDivideCommentOrRegularExpression ( ) : Jurassic.Compiler.Token

Reads a divide operator ('/' or '/='), a comment ('//' or '/*'), or a regular expression literal.

ReadExtendedUnicodeSequence ( ) : string

Reads an extended unicode escape sequence in the form "\u{20BB7}".

ReadHexEscapeSequence ( int digitCount ) : char

Reads a hexidecimal number with the given number of digits and turns it into a character.

ReadIdentifier ( int firstChar ) : Jurassic.Compiler.Token

Reads an identifier token.

ReadInteger ( double initialValue, int &digitsRead ) : double

Reads an integer value.

ReadLineTerminator ( int firstChar ) : Jurassic.Compiler.Token

Reads a line terminator (a newline).

ReadMultiLineComment ( ) : Jurassic.Compiler.Token

Reads past a multi-line comment.

ReadNextChar ( ) : int

Reads the next character from the input stream.

ReadNumericLiteral ( int firstChar ) : Jurassic.Compiler.Token

Reads a numeric literal token.

ReadOctalEscapeSequence ( int stringDelimiter, int firstDigit ) : char

Reads an octal number turns it into a single-byte character.

ReadPunctuator ( int firstChar ) : Jurassic.Compiler.Token

Reads a punctuation token.

ReadRegularExpression ( ) : Jurassic.Compiler.Token

Reads a regular expression literal.

ReadSingleLineComment ( ) : Jurassic.Compiler.Token

Reads past a single line comment.

ReadWhiteSpace ( ) : Jurassic.Compiler.Token

Reads past whitespace.

메소드 상세

Dispose() 공개 메소드

Cleans up any resources used by the lexer.
public Dispose ( ) : void
리턴 void

Lexer() 공개 메소드

Creates a Lexer instance with the given source of text.
public Lexer ( ScriptEngine engine, ScriptSource source ) : System
engine ScriptEngine The associated script engine.
source ScriptSource The source of javascript code.
리턴 System

NextToken() 공개 메소드

Reads the next token from the reader.
public NextToken ( ) : Jurassic.Compiler.Token
리턴 Jurassic.Compiler.Token

ReadStringLiteral() 공개 메소드

Reads a string literal.
public ReadStringLiteral ( int firstChar ) : Jurassic.Compiler.Token
firstChar int The first character of the string literal.
리턴 Jurassic.Compiler.Token