Class SupportedLanguage
A language the platform serves: what it is called to a client, which files are written in it, and what the environment it runs in is like - which is what tells one dialect of the family from another.
public class SupportedLanguage
- Inheritance
-
SupportedLanguage
- Inherited Members
Remarks
The platform is one implementation of the MS-VBAL semantics for several members of the BASIC family (SupportedLanguages), and a language is the dialect table behind it: the pieces a dialect decides stay behind this type rather than being re-decided wherever they matter.
Constructors
SupportedLanguage(string, string, params string[])
Creates the definition of a language.
public SupportedLanguage(string id, string name, params string[] fileTypes)
Parameters
idstringThe language identifier a client names the language by (
languageId).namestringWhat the language is called.
fileTypesstring[]The patterns of the files written in it.
Properties
FileTypes
The patterns of the files written in the language.
public string[] FileTypes { get; }
Property Value
- string[]
FilterString
The patterns of the files written in the language, as a document filter pattern.
public string FilterString { get; }
Property Value
HasBarePrint
Whether a Print statement with no file number - Print "x" - is a statement of the language.
public bool HasBarePrint { get; init; }
Property Value
Remarks
In VB6 it is the Print member of the form or report it is written in, so it exists only where there is one. A BASIC has it as its
own: it writes to the output of the program.
In VBA Print is a reserved identifier: it is illegal as the name of anything, it has no semantics, and it is not a recognized statement
inside a procedure. Only the Immediate window accepts a bare Print, where it writes what Debug.Print does - and the Immediate window
is not procedure scope.
HasOptionExplicit
Whether the language has the Option Explicit directive (MS-VBAL §5.2.1.3), with which a module requires that every
name it uses is declared.
public bool HasOptionExplicit { get; init; }
Property Value
Remarks
VBA and VB6 do. A BASIC does not: a variable is whatever a line first assigns, which is what makes it a language to type in a line at a time, and a module of it cannot state a directive that it has no way to write. Whether a module states it is not something to have an opinion about, then.
Id
The language identifier a client names the language by (languageId).
public string Id { get; }
Property Value
ImplicitDeclarationScope
Where the variable that a reference to an undeclared name declares lives (MS-VBAL §5.6.10).
public ImplicitDeclarationScope ImplicitDeclarationScope { get; init; }
Property Value
Remarks
Procedure - a local of the procedure - is VBA's and VB6's. Module is a BASIC's: a variable of the module, so that what one line assigns the next one reads.
ImplicitReferences
The libraries every project of the language references without its project file listing them, by name, in their order of reference precedence: after the standard library, and before the references the project file lists (RD-VBAL §2.3.1.3).
public IReadOnlyList<string> ImplicitReferences { get; init; }
Property Value
Remarks
The standard library (VBA) is every language's, and is none of them. A VB6 project also has the Visual Basic runtime objects and procedures
(VBRUN, the third type library of MSVBVM60.DLL): the constants of its forms and controls (vbFixedSingle, vbTwips,
vbHourglass, vbChecked) and its PropertyBag; and the Visual Basic objects and procedures (VB, VB6.OLB): its forms,
controls and App, Screen and Printer. A .vbp lists neither, and the VB6 IDE does not let a project remove them. A name
both the standard library and VBRUN declare is the standard library's: vbCancel is 2, where VBRUN's is 0.
Name
What the language is called.
public string Name { get; }
Property Value
UsesClassicBasicSyntax
Whether the language is written in the syntax of classic BASIC: a Rem comment and the Error statement are how it writes a comment and raises an
error, and not relics of the language it descends from.
public bool UsesClassicBasicSyntax { get; init; }
Property Value
Remarks
A BASIC does, since that is what it is. VBA and VB6 keep both for backward compatibility only: ' is the comment, and Err.Raise raises an error
(MS-VBAL §5.4.4.3).
Methods
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
ToTextDocumentSelector()
The selector of the documents written in the language.
public TextDocumentSelector ToTextDocumentSelector()