Table of Contents

Class MSSQLParser

Namespace
Alternet.Syntax.Parsers.Advanced
Assembly
Alternet.Syntax.Parsers.Advanced.v9.dll

Represents a class that performs syntax and lexical analysis of specified Microsoft Sql code text.

[ToolboxBitmap(typeof(CsParser), "Images.MSSQLParser.Icon.bmp")]
public class MSSQLParser : SyntaxParser, IComponent, IDisposable, ISyntaxParser, IParser, ILexer, INotify, IUpdate, IImport
Inheritance
MSSQLParser
Implements

Examples

Here is how to declare a MSSQLParser and assign it to the edit control from the C# code:

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        var parser = new Alternet.Syntax.Parsers.Advanced.MSSQLParser();
        var edit = new Alternet.Editor.SyntaxEdit();
        edit.Parent = this;
        edit.Lexer = parser;

        string fileName = "myfile.txt";
        if (System.IO.File.Exists(fileName))
        {
            parser.FileName = fileName;
            edit.LoadFile(fileName);
        }
    }
}

Here is how to declare a MSSQLParser and assign it to the edit control from the Visual Basic code:

Partial Public Class Form1
    Inherits Form

    Public Sub New()
        InitializeComponent()
    End Sub

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
        Dim parser = New Alternet.Syntax.Parsers.Advanced.MSSQLParser()
        Dim edit = New Alternet.Editor.SyntaxEdit()
        edit.Parent = Me
        edit.Lexer = parser
        Dim fileName As String = "myfile.txt"

        If System.IO.File.Exists(fileName) Then
            parser.FileName = fileName
            edit.LoadFile(fileName)
        End If
    End Sub
End Class

Remarks

MSSQLParser is a non-visual component designed to perform syntax highlighting for SQL language. This parser supports full syntax analysis of the Microsoft SQL code. When linked to the SyntaxEdit or TextEditor controls, this parser drives additional features such as code completion, code outlining, code formatting, and underlying syntax errors and warnings.

Here are some of the essential features provided by the MSSQLParser:

  • Syntax Highlighting
  • IntelliSense (Code completion)
  • Code Outlining
  • Structure guidelines
  • Formatting a selected block of text or the whole document.

Constructors

MSSQLParser()

Initializes a new instance of the MSSQLParser class with default settings.

Fields

lexCommentEndProc
lexCommentProc
lexDefineEndProc
lexDefineProc
lexIdentifierProc
lexNumberProc
lexStringEndProc
lexStringProc
lexSymbolProc
lexWhitespaceProc
prevPosition
savePrevPosition

Properties

CaseSensitive

Gets or sets a boolean value that indicates whether SqlParser should perform case-sensitive analysis of its content.

Methods

AddAttribute(ISyntaxAttribute)
AddNode(ISyntaxNode)
ClearStack()
CreateExpressionNode(Point, string, int, ISyntaxNode, bool)
CreateRepository()

Creates ICodeCompletionRepository to perform code completion functionality for this parser.

Expected(MsSqlLexerToken)
Expected(MsSqlLexerToken, MsSqlLexerToken)
Expected(MsSqlLexerToken[])
Expected(int)
GetCompletionType(char)

Obtains type of code completion window from specifies char parameter.

GetLexerStyle(int)
GetSingleLineComment()

Gets the string that represents start symbol of single line comment.

IdentifierExpected()
InitLexer()
InitStyles()
IsDatatypeToken(int)
IsDateOrIntervalToken(int)
IsQueryToken(int)
IsReswordToken(int)
IsValidToken(int)
LexComment()
LexCommentEnd()
LexDefine()
LexDefineEnd()
LexIdentifier()
LexNumber()
LexString()
LexStringEnd()
LexStringEnd(char)
LexSymbol()
LexWhitespace()
MoveNext()
ParseAdditiveExpression(ref ISyntaxNode)
ParseAlias(ref ISyntaxNode)
ParseAndExpression(ref ISyntaxNode)
ParseArgumentList(ref ISyntaxNode)
ParseColumnAliasList()
ParseColumnList()
ParseColumnName(out string)
ParseComputeClause()
ParseComputeStatement()
ParseDirective()
ParseEqualityExpression(ref ISyntaxNode)
ParseExecProc()
ParseExpression(ref ISyntaxNode)
ParseExpressionList(ref ISyntaxNode)
ParseForStatement()
ParseFromStatement()
ParseGroupbyStatement()
ParseHavingStatement()
ParseIdentifier(out string)
ParseIdentifier(out string, bool)
ParseIdentifierList(out string)
ParseInclusiveOrExpression(ref ISyntaxNode)
ParseIntoStatement()
ParseInvocationExpression(ref ISyntaxNode)
ParseMemberAccess(ref ISyntaxNode)
ParseMultiplicativeExpression(ref ISyntaxNode)
ParseOptionStatement()
ParseOrderColumn()
ParseOrderbyStatement()
ParseParenthesizedExpression(ref ISyntaxNode)
ParsePrefixedUnaryExpression(ref ISyntaxNode)
ParsePrimaryExpression(ref ISyntaxNode)
ParseQualifiedIdentifier(out string)
ParseQueryExpression()
ParseQueryHint()
ParseQuerySpecification()
ParseRelationalExpression(ref ISyntaxNode)
ParseSearchCondition()
ParseSearchConditionList()
ParseSelectItem()
ParseSelectList()
ParseSelectQuery()
ParseSimpleExpression(ref ISyntaxNode)
ParseStringExpression(out string)
ParseSubQuery()
ParseTableAlias(out string)
ParseTableHint()
ParseTableHintIndex()
ParseTableName(out string)
ParseTableSource()
ParseTableSourceAlias()
ParseTop()
ParseType(out string)
ParseUnit()
ParseUnitBody()
ParseWhereStatement()
ReparseText()

Reparses entire text.

ResetCodeCompletionChars()

Resets the CodeCompletionChars to the default value.

ResetOptions()

Resets Options to the default value.

RestoreState(bool)

Restores Parser state and position stored by SaveState method.

SaveState()

Saves current Parser state and position.

ShouldSerializeCodeCompletionChars()

Indicates whether the CodeCompletionChars property should be persisted.

ShouldSerializeOptions()

Indicates whether the Options property should be persisted.

SyntaxError()
SyntaxError(int)
SyntaxError(string)
TryParseColumnName(out string)
TryParsePostPrimaryExpression(ref ISyntaxNode)
TryParseWithStatement()