Table of Contents

Class CompletionStatement

Namespace
RDCore.SDK.Model.Symbols.Completion
Assembly
RDCore.SDK.dll

The statement a name is being written in, as tokens: what a completion list needs to know of the code before the name - which statement it is, and where in it.

public static class CompletionStatement
Inheritance
CompletionStatement
Inherited Members

Remarks

The tokens are a lexer's, and not the parser's: the statement is not finished, and need not parse. A word is a name or a keyword, with the type hint it has; a string literal is "", whatever is in it; a number is its digits; any other character is a token of its own, but for the two-character operators :=, <=, >= and <>.

Methods

Expectation(IReadOnlyList<string>)

What comes next after tokens.

public static CompletionExpectation Expectation(IReadOnlyList<string> tokens)

Parameters

tokens IReadOnlyList<string>

The tokens of the statement before the name (Tokenize(string)).

Returns

CompletionExpectation

Is(string, string)

Whether a token is the keyword keyword, in any case.

public static bool Is(this string token, string keyword)

Parameters

token string

The token.

keyword string

The keyword.

Returns

bool

IsWord(string)

Whether a token is a word: a name, or a keyword.

public static bool IsWord(string token)

Parameters

token string

The token.

Returns

bool

StatementOf(string)

The statement the end of text is in: after the last : that separates statements, the Then or the Else of a single-line If, and the line number or the label the line starts with.

public static string StatementOf(string text)

Parameters

text string

The text of the line, up to where the name is written.

Returns

string

Tokenize(string)

The tokens of statement.

public static IReadOnlyList<string> Tokenize(string statement)

Parameters

statement string

The statement, up to where the name is written.

Returns

IReadOnlyList<string>