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
tokensIReadOnlyList<string>The tokens of the statement before the name (Tokenize(string)).
Returns
Is(string, string)
Whether a token is the keyword keyword, in any case.
public static bool Is(this string token, string keyword)
Parameters
Returns
IsWord(string)
Whether a token is a word: a name, or a keyword.
public static bool IsWord(string token)
Parameters
tokenstringThe token.
Returns
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
textstringThe text of the line, up to where the name is written.
Returns
Tokenize(string)
The tokens of statement.
public static IReadOnlyList<string> Tokenize(string statement)
Parameters
statementstringThe statement, up to where the name is written.