ScriptStack 1.0.5
Loading...
Searching...
No Matches
ScriptStack.Compiler.Token Class Reference

A lexical token or simply token is a string with an assigned and thus identified meaning. More...

Public Member Functions

 Token (TokenType tokenType, object lexeme, int line, int column, String sourceLine)
override string ToString ()

Properties

TokenType Type [get]
object Lexeme [get]
int Line [get]
int Column [get]
string Text [get]

Private Attributes

TokenType tokenType
object lexeme
int line
int column
String text

Detailed Description

A lexical token or simply token is a string with an assigned and thus identified meaning.

Definition at line 100 of file Token.cs.

Constructor & Destructor Documentation

◆ Token()

ScriptStack.Compiler.Token.Token ( TokenType tokenType,
object lexeme,
int line,
int column,
String sourceLine )

Definition at line 115 of file Token.cs.

116 {
117 this.tokenType = tokenType;
118 this.lexeme = lexeme;
119 this.line = line;
120 this.column = Math.Max(0, column - lexeme.ToString().Length - 1);
121 this.text = sourceLine;
122 }

References column, lexeme, line, and tokenType.

Member Function Documentation

◆ ToString()

override string ScriptStack.Compiler.Token.ToString ( )

Definition at line 124 of file Token.cs.

125 {
126 return "Token(" + tokenType + ", \"" + lexeme.ToString() + "\")";
127 }

References lexeme, and tokenType.

Member Data Documentation

◆ column

int ScriptStack.Compiler.Token.column
private

Definition at line 108 of file Token.cs.

Referenced by Token().

◆ lexeme

object ScriptStack.Compiler.Token.lexeme
private

Definition at line 106 of file Token.cs.

Referenced by Token(), and ToString().

◆ line

int ScriptStack.Compiler.Token.line
private

Definition at line 107 of file Token.cs.

Referenced by Token().

◆ text

String ScriptStack.Compiler.Token.text
private

Definition at line 109 of file Token.cs.

◆ tokenType

TokenType ScriptStack.Compiler.Token.tokenType
private

Definition at line 105 of file Token.cs.

Referenced by Token(), and ToString().

Property Documentation

◆ Column

int ScriptStack.Compiler.Token.Column
get

Definition at line 148 of file Token.cs.

149 {
150 get { return column; }
151 }

◆ Lexeme

◆ Line

int ScriptStack.Compiler.Token.Line
get

Definition at line 143 of file Token.cs.

144 {
145 get { return line; }
146 }

Referenced by ScriptStack.Compiler.Parser.InsertDebugInfo().

◆ Text

string ScriptStack.Compiler.Token.Text
get

Definition at line 153 of file Token.cs.

154 {
155 get { return text; }
156 }

Referenced by ScriptStack.Compiler.Parser.InsertDebugInfo().

◆ Type

TokenType ScriptStack.Compiler.Token.Type
get

Definition at line 133 of file Token.cs.

134 {
135 get { return tokenType; }
136 }

Referenced by ScriptStack.Compiler.Parser.AccessChainAssignment(), ScriptStack.Compiler.Parser.And(), ScriptStack.Compiler.Parser.Arithmetic(), ScriptStack.Compiler.Parser.ArrayAssignment(), ScriptStack.Compiler.Parser.Atom(), ScriptStack.Compiler.Parser.BinaryAnd(), ScriptStack.Compiler.Parser.BinaryNot(), ScriptStack.Compiler.Parser.BinaryNotAssign(), ScriptStack.Compiler.Parser.BinaryOr(), ScriptStack.Compiler.Parser.BitwiseAnd(), ScriptStack.Compiler.Parser.BitwiseOr(), ScriptStack.Compiler.Parser.BitwiseXor(), ScriptStack.Compiler.Parser.BraceArray(), ScriptStack.Compiler.Parser.BracketArray(), ScriptStack.Compiler.Parser.Break(), ScriptStack.Compiler.Parser.Continue(), ScriptStack.Compiler.Parser.ExpectIdentifier(), ScriptStack.Compiler.Parser.For(), ScriptStack.Compiler.Parser.ForEach(), ScriptStack.Compiler.Parser.FunctionDeclaration(), ScriptStack.Compiler.Parser.If(), ScriptStack.Compiler.Parser.IsAccessChainAssignment(), ScriptStack.Compiler.Parser.IsMember(), ScriptStack.Compiler.Parser.IsPointer(), ScriptStack.Compiler.Parser.LocalVariableDeclaration(), ScriptStack.Compiler.Parser.LockedStatementList(), ScriptStack.Compiler.Parser.MemberAssignment(), ScriptStack.Compiler.Parser.Notify(), ScriptStack.Compiler.Parser.Or(), ScriptStack.Compiler.Parser.ParseScript(), ScriptStack.Compiler.Parser.PostDecrement(), ScriptStack.Compiler.Parser.PostIncrement(), ScriptStack.Compiler.Parser.PreDecrement(), ScriptStack.Compiler.Parser.PreIncrement(), ScriptStack.Compiler.Parser.ReadComma(), ScriptStack.Compiler.Parser.ReadIdentifier(), ScriptStack.Compiler.Parser.ReadLeftBrace(), ScriptStack.Compiler.Parser.ReadLeftBracket(), ScriptStack.Compiler.Parser.ReadLeftParenthesis(), ScriptStack.Compiler.Parser.ReadPeriod(), ScriptStack.Compiler.Parser.ReadRightBrace(), ScriptStack.Compiler.Parser.ReadRightBracket(), ScriptStack.Compiler.Parser.ReadRightParenthesis(), ScriptStack.Compiler.Parser.ReadSemicolon(), ScriptStack.Compiler.Parser.Relation(), ScriptStack.Compiler.Parser.Return(), ScriptStack.Compiler.Parser.Run(), ScriptStack.Compiler.Parser.ShiftLeft(), ScriptStack.Compiler.Parser.ShiftRight(), ScriptStack.Compiler.Parser.Statement(), ScriptStack.Compiler.Parser.Switch(), ScriptStack.Compiler.Parser.Term(), ScriptStack.Compiler.Parser.VariableAssignment(), ScriptStack.Compiler.Parser.VariableDeclaration(), ScriptStack.Compiler.Parser.Wait(), ScriptStack.Compiler.Parser.While(), ScriptStack.Compiler.Parser.Xor(), and ScriptStack.Compiler.Parser.Yield().


The documentation for this class was generated from the following file: