qscript.compiler.misc

Some misc stuff used by the compiler

Members

Functions

checkBrackets
bool checkBrackets(TokenList tokens, LinkedList!CompileError errors)

Checks if the brackets in a tokenlist are in correct order, and are closed

decodeString
string decodeString(string s)

decodes a string. i.e, converts \t to tab, \" to ", etc The string must not be surrounded by quoation marks

encodeFunctionName
string encodeFunctionName(string name, DataType[] argTypes)

Generates a string containing Function Name, along with it's argument types. Makes it easier to differentiate b/w function overloads

matchArguments
bool matchArguments(DataType[] definedTypes, DataType[] argTypes)

matches argument types with defined argument types. Used by ASTGen

removeWhitespace
string removeWhitespace(string line, char commentStart)

removes "extra" whitespace from a string. i.e, if there are more than 1 consecutive spaces/tabs, one is removed

splitArray
Token[][] splitArray(Token[] array)

splits an array in tokens format to it's elements

strEnd
integer strEnd(string s, uinteger i)

Returns the index of the quotation mark that ends a string

tokenBracketPos
uinteger tokenBracketPos(Token[] tokens, uinteger index)

Returns index of closing/openinig bracket of the provided bracket

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

Function
struct Function

To store information about a function

Token
struct Token

Each token is stored as a Token with the type and the actual token

TokenList
struct TokenList

To store Tokens with Types where the line number of each token is required

Variables

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

INBUILT_FUNCTIONS
Function[] INBUILT_FUNCTIONS;

Inbuilt QScript functions (like length(void[]))

KEYWORDS
string[] KEYWORDS;

An array containing all keywords

OPERATORS
string[] OPERATORS;

An array containing double-operand operators

SOPERATORS
string[] SOPERATORS;

single-operand operators

Meta