StaticChecker class

LG managed code checker.

Extends

AbstractParseTreeVisitor<Diagnostic[]>

Constructors

StaticChecker(Templates)

Creates a new instance of the StaticChecker class.

Methods

check()

Return error messages list.

visitIfElseBody(IfElseBodyContext)

Visit a parse tree produced by the ifElseBody labeled alternative in LGTemplateParser.body.

visitNormalTemplateBody(NormalTemplateBodyContext)

Visit a parse tree produced by LGTemplateParser.normalTemplateBody.

visitNormalTemplateString(NormalTemplateStringContext)

Visit a parse tree produced by LGTemplateParser.normalTemplateString.

visitStructuredTemplateBody(StructuredTemplateBodyContext)

Visit a parse tree produced by LGTemplateParser.structuredTemplateBody.

visitSwitchCaseBody(SwitchCaseBodyContext)

Visit a parse tree produced by the switchCaseBody labeled alternative in LGTemplateParser.body.

Inherited Methods

visit(ParseTree)

{@inheritDoc} The default implementation calls <xref:ParseTree%23accept> on the specified tree.

visitChildren(RuleNode)

{@inheritDoc} The default implementation initializes the aggregate result to defaultResult(). Before visiting each child, it calls shouldVisitNextChild; if the result is false no more children are visited and the current aggregate result is returned. After visiting a child, the aggregate result is updated by calling aggregateResult with the previous aggregate result and the result of visiting the child.

The default implementation is not safe for use in visitors that modify the tree structure. Visitors that modify the tree should override this method to behave properly in respect to the specific algorithm in use.

visitErrorNode(ErrorNode)

{@inheritDoc} The default implementation returns the result of defaultResult.

visitTerminal(TerminalNode)

{@inheritDoc} The default implementation returns the result of defaultResult.

Constructor Details

StaticChecker(Templates)

Creates a new instance of the StaticChecker class.

new StaticChecker(templates: Templates)

Parameters

templates
Templates

(xref:botbuilder-lg.Templates) to be checked.

Method Details

check()

Return error messages list.

function check(): Diagnostic[]

Returns

Report result.

visitIfElseBody(IfElseBodyContext)

Visit a parse tree produced by the ifElseBody labeled alternative in LGTemplateParser.body.

function visitIfElseBody(context: IfElseBodyContext): Diagnostic[]

Parameters

context
IfElseBodyContext

The parse tree.

Returns

The result of visiting if-else body.

visitNormalTemplateBody(NormalTemplateBodyContext)

Visit a parse tree produced by LGTemplateParser.normalTemplateBody.

function visitNormalTemplateBody(context: NormalTemplateBodyContext): Diagnostic[]

Parameters

context
NormalTemplateBodyContext

The parse tree.

Returns

The result of visiting normal template body.

visitNormalTemplateString(NormalTemplateStringContext)

Visit a parse tree produced by LGTemplateParser.normalTemplateString.

function visitNormalTemplateString(context: NormalTemplateStringContext): Diagnostic[]

Parameters

context
NormalTemplateStringContext

The parse tree.

Returns

The result of visiting normal template string.

visitStructuredTemplateBody(StructuredTemplateBodyContext)

Visit a parse tree produced by LGTemplateParser.structuredTemplateBody.

function visitStructuredTemplateBody(context: StructuredTemplateBodyContext): Diagnostic[]

Parameters

context
StructuredTemplateBodyContext

The parse tree.

Returns

The result of visiting structured template body.

visitSwitchCaseBody(SwitchCaseBodyContext)

Visit a parse tree produced by the switchCaseBody labeled alternative in LGTemplateParser.body.

function visitSwitchCaseBody(context: SwitchCaseBodyContext): Diagnostic[]

Parameters

context
SwitchCaseBodyContext

The parse tree.

Returns

The result of visiting switch-case body.

Inherited Method Details

visit(ParseTree)

{@inheritDoc} The default implementation calls <xref:ParseTree%23accept> on the specified tree.

function visit(tree: ParseTree): Diagnostic[]

Parameters

tree

ParseTree

Returns

Inherited From AbstractParseTreeVisitor.visit

visitChildren(RuleNode)

{@inheritDoc} The default implementation initializes the aggregate result to defaultResult(). Before visiting each child, it calls shouldVisitNextChild; if the result is false no more children are visited and the current aggregate result is returned. After visiting a child, the aggregate result is updated by calling aggregateResult with the previous aggregate result and the result of visiting the child.

The default implementation is not safe for use in visitors that modify the tree structure. Visitors that modify the tree should override this method to behave properly in respect to the specific algorithm in use.

function visitChildren(node: RuleNode): Diagnostic[]

Parameters

node

RuleNode

Returns

Inherited From AbstractParseTreeVisitor.visitChildren

visitErrorNode(ErrorNode)

{@inheritDoc} The default implementation returns the result of defaultResult.

function visitErrorNode(node: ErrorNode): Diagnostic[]

Parameters

node

ErrorNode

Returns

Inherited From AbstractParseTreeVisitor.visitErrorNode

visitTerminal(TerminalNode)

{@inheritDoc} The default implementation returns the result of defaultResult.

function visitTerminal(node: TerminalNode): Diagnostic[]

Parameters

node

TerminalNode

Returns

Inherited From AbstractParseTreeVisitor.visitTerminal