module volta.ir.token

Code Map

module volta.ir.token;


enum _tokenToString;

enum TokenType
{
	None,
	Begin,
	End,
	DocComment,
	BackwardsDocComment,
	Identifier,
	StringLiteral,
	CharacterLiteral,
	IntegerLiteral,
	FloatLiteral,
	Abstract,
	Alias,
	Align,
	Asm,
	Assert,
	Auto,
	Body,
	Bool,
	Break,
	Byte,
	Case,
	Cast,
	Catch,
	Cdouble,
	Cent,
	Cfloat,
	Char,
	Class,
	Const,
	Continue,
	Creal,
	Dchar,
	Debug,
	Default,
	Delegate,
	Delete,
	Deprecated,
	Dg,
	Do,
	Double,
	Else,
	Enum,
	Export,
	Extern,
	F32,
	F64,
	False,
	Final,
	Finally,
	Float,
	For,
	Foreach,
	ForeachReverse,
	Fn,
	Function,
	Global,
	Goto,
	I8,
	I16,
	I32,
	I64,
	Idouble,
	If,
	Ifloat,
	Immutable,
	Import,
	In,
	Inout,
	Int,
	Interface,
	Invariant,
	Ireal,
	Is,
	Isize,
	Lazy,
	Local,
	Long,
	Macro,
	Mixin,
	Module,
	New,
	Nothrow,
	Null,
	Out,
	Override,
	Pragma,
	Private,
	Protected,
	Public,
	Pure,
	Real,
	Ref,
	Return,
	Scope,
	Shared,
	Short,
	Static,
	Struct,
	Super,
	Switch,
	Synchronized,
	Template,
	This,
	Throw,
	True,
	Try,
	Typedef,
	Typeid,
	Typeof,
	U8,
	U16,
	U32,
	U64,
	Ubyte,
	Ucent,
	Uint,
	Ulong,
	Union,
	Unittest,
	Ushort,
	Usize,
	VaArg,
	Version,
	Void,
	Volatile,
	Wchar,
	While,
	With,
	__File__,
	__Function__,
	__Line__,
	__Location__,
	__Pretty_Function__,
	__Thread,
	HashRun,
	//! Symbols.
	Slash,
	SlashAssign,
	Dot,
	DoubleDot,
	TripleDot,
	Ampersand,
	AmpersandAssign,
	DoubleAmpersand,
	Pipe,
	PipeAssign,
	DoublePipe,
	Dash,
	DashAssign,
	DoubleDash,
	Plus,
	PlusAssign,
	DoublePlus,
	Less,
	LessAssign,
	DoubleLess,
	DoubleLessAssign,
	LessGreater,
	LessGreaterAssign,
	Greater,
	GreaterAssign,
	DoubleGreaterAssign,
	TripleGreaterAssign,
	DoubleGreater,
	TripleGreater,
	Bang,
	BangAssign,
	BangLessGreater,
	BangLessGreaterAssign,
	BangLess,
	BangLessAssign,
	BangGreater,
	BangGreaterAssign,
	OpenParen,
	CloseParen,
	OpenBracket,
	CloseBracket,
	OpenBrace,
	CloseBrace,
	QuestionMark,
	Comma,
	Semicolon,
	Colon,
	ColonAssign,
	Dollar,
	Assign,
	DoubleAssign,
	Asterix,
	AsterixAssign,
	Percent,
	PercentAssign,
	Caret,
	CaretAssign,
	DoubleCaret,
	DoubleCaretAssign,
	Tilde,
	TildeAssign,
	At,
}

//! Holds the type, the actual string and location within the source file.
struct Token
{
public:
	type: TokenType;
	value: string;
	loc: Location;
}

fn tokenToString(token: TokenType) string { }
fn isStorageTypeToken(token: TokenType) bool { }
fn isPrimitiveTypeToken(token: TokenType) bool { }
//! Go from a string identifier to a TokenType.
fn identifierType(ident: string) TokenType { }
struct Token

Holds the type, the actual string and location within the source file.

fn identifierType(ident: string) TokenType

Go from a string identifier to a TokenType.

Side-effects: None.

Returns: Always a TokenType, for unknown ones TokenType.Identifier.