qscript.compiler.compiler

All the compiler modules packaged into one, this one module should be used to compile scripts.

Public Imports

qscript.qscript
public import qscript.qscript : Library;

Members

Aliases

FunctionCallCodeGenFunc
alias FunctionCallCodeGenFunc = void delegate(string name, DataType[] argTypes, NaBytecode bytecode)

Function called to generate bytecode for a call to a macro function

VariableCodeGenFunc
alias VariableCodeGenFunc = void delegate(string name, NaBytecode bytecode)

Function called to generate bytecode for accessing a macro variable

Classes

QSCompiler
class QSCompiler

all the compiler modules wrapped into a single class. This is all that should be needed to compile scripts

Enums

CodeGenFlags
enum CodeGenFlags

Flags passed to bytecode generating functions

Visibility
enum Visibility

Visibility Specifiers

Functions

canImplicitCast
bool canImplicitCast(DataType.Type type1, DataType.Type type2)
bool canImplicitCast(DataType type1, DataType type2)

Checks if a type can be implicitly casted to another type. does not work for custom types, returns false

commaSeparate
string[] commaSeparate(string str)

comma separates a string.

visibility
Visibility visibility(string s)

Structs

CompileError
struct CompileError

Used by compiler's functions to return error

DataType
struct DataType

used to store data types for data at compile time

Enum
struct Enum

To store information about a enum

Function
struct Function

To store information about a function

Struct
struct Struct

To store information about a struct

Variable
struct Variable

To store information about a global variable

Variables

AVAILABLE_DATA_TYPES
DataType.Type[] AVAILABLE_DATA_TYPES;

only these data types are currently available

BOOL_OPERATORS
string[] BOOL_OPERATORS;

An array containing all bool-operators (operators that return true/false)

DATA_TYPES
string[] DATA_TYPES;

data types

IDENT_CHARS
char[] IDENT_CHARS;

An array containing all chars that an identifier can contain

IMPLICIT_CAST_TYPES
DataType.Type[][] IMPLICIT_CAST_TYPES;

Stores what types can be converted to what other types implicitly.

KEYWORDS
string[] KEYWORDS;

An array containing all keywords

NUMERICAL_DATA_TYPES
DataType.Type[] NUMERICAL_DATA_TYPES;

Stores numerical data types (where numbers are stored)

OPERATORS
string[] OPERATORS;

An array containing double-operand operators

OPERATOR_FUNCTIONS
string[string] OPERATOR_FUNCTIONS;

function names corresponding to operators

SOPERATORS
string[] SOPERATORS;

single-operand operators

VISIBILITY_SPECIFIERS
string[] VISIBILITY_SPECIFIERS;

Visibility Specifier keywords

Meta