Octal_digitContext class

Extends

ParserRuleContext

Constructors

Properties

Inherited Properties

altNumber

Set the outer alternative number for this context node. Default implementation does nothing to avoid backing field overhead for trees that don't need it. Create a subclass of ParserRuleContext with backing field and set option contextSuperClass. @since 4.5.3

childCount
children

If we are debugging or building a parse tree for a visitor, we need to track all of the tokens and rule invocations associated with this rule's context. This is empty for parsing w/o tree constr. operation because we don't the need to track the details about how we parse this rule.

exception

The exception that forced this rule to return. If the rule successfully completed, this is undefined.

invokingState
isEmpty

A context is empty if there is no invoking state; meaning nobody called current context.

parent
payload
ruleContext
sourceInterval
start

Get the initial token in this context. Note that the range from start to stop is inclusive, so for rules that do not consume anything (for example, zero length or error productions) this token may exceed stop.

stop

Get the final token in this context. Note that the range from start to stop is inclusive, so for rules that do not consume anything (for example, zero length or error productions) this token may precede start.

text

Return the combined text of all child nodes. This method only considers tokens which have been added to the parse tree. Since tokens on hidden channels (e.g. whitespace or comments) are not added to the parse trees, they will not appear in the output of this method.

Methods

Inherited Methods

addAnyChild<T>(T)

Add a parse tree node to this as a child. Works for internal and leaf nodes. Does not set parent link; other add methods must do that. Other addChild methods call this. We cannot set the parent pointer of the incoming node because the existing interfaces do not have a setParent() method and I don't want to break backward compatibility for this.

@since 4.7

addChild(RuleContext)
addChild(TerminalNode)

Add a token leaf node child and force its parent to be this node.

addChild(Token)

Add a child to this node based upon matchedToken. It creates a TerminalNodeImpl rather than using [Token)](xref:Parser%23createTerminalNode(ParserRuleContext%2C). I'm leaving this in for compatibility but the parser doesn't use this anymore.

addErrorNode(ErrorNode)

Add an error node child and force its parent to be this node.

addErrorNode(Token)

Add a child to this node based upon badToken. It creates a ErrorNode rather than using [Token)](xref:Parser%23createErrorNode(ParserRuleContext%2C). I'm leaving this in for compatibility but the parser doesn't use this anymore.

copyFrom(ParserRuleContext)

COPY a ctx (I'm deliberately not using copy constructor) to avoid confusion with creating node with parent. Does not copy children (except error leaves). This is used in the generated parser code to flip a generic XContext node for rule X to a YContext for alt label Y. In that sense, it is not really a generic copy function.

If we do an error sync() at start of a rule, we might add error nodes to the generic XContext so this function must copy those nodes to the YContext as well else they are lost!

depth()
emptyContext()
getChild(number)
getChild<T>(number, { })
getChildContext(RuleContext, number)
getRuleContext<T>(number, { })
getRuleContexts<T>({ })
getToken(number, number)
getTokens(number)
removeLastChild()

Used by enterOuterAlt to toss out a RuleContext previously added as we entered a rule. If we have # label, we will need to remove generic ruleContext object.

setParent(RuleContext)
toInfoString(Parser)

Used for rule context info debugging during parse-time, not so much for ATN debugging

toString()
toString(Recognizer<any, any> | undefined)
toString(Recognizer<any, any> | undefined, RuleContext | undefined)
toString(string[] | undefined)
toString(string[] | undefined, RuleContext | undefined)
toStringTree()
toStringTree(Parser)

Print out a whole tree, not just a node, in LISP format (root child1 .. childN). Print just a node if this is a leaf. We have to know the recognizer so we can get rule names.

toStringTree(string[] | undefined)

Print out a whole tree, not just a node, in LISP format (root child1 .. childN). Print just a node if this is a leaf.

tryGetChild<T>(number, { })
tryGetRuleContext<T>(number, { })
tryGetToken(number, number)

Constructor Details

Octal_digitContext(ParserRuleContext | undefined, number)

TypeScript
new Octal_digitContext(parent: ParserRuleContext | undefined, invokingState: number)

Parameters

parent

ParserRuleContext | undefined

invokingState

number

Property Details

ruleIndex

TypeScript
number ruleIndex

Property Value

number

Inherited Property Details

altNumber

Set the outer alternative number for this context node. Default implementation does nothing to avoid backing field overhead for trees that don't need it. Create a subclass of ParserRuleContext with backing field and set option contextSuperClass. @since 4.5.3

TypeScript
altNumber: number

Property Value

number

Inherited From RuleContext.altNumber

childCount

TypeScript
childCount: number

Property Value

number

Inherited From ParserRuleContext.childCount

children

If we are debugging or building a parse tree for a visitor, we need to track all of the tokens and rule invocations associated with this rule's context. This is empty for parsing w/o tree constr. operation because we don't the need to track the details about how we parse this rule.

TypeScript
children?: ParseTree[]

Property Value

ParseTree[]

Inherited From ParserRuleContext.children

exception

The exception that forced this rule to return. If the rule successfully completed, this is undefined.

TypeScript
exception?: RecognitionException

Property Value

RecognitionException

Inherited From ParserRuleContext.exception

invokingState

TypeScript
invokingState: number

Property Value

number

Inherited From RuleContext.invokingState

isEmpty

A context is empty if there is no invoking state; meaning nobody called current context.

TypeScript
isEmpty: boolean

Property Value

boolean

Inherited From RuleContext.isEmpty

parent

TypeScript
parent: ParserRuleContext | undefined

Property Value

ParserRuleContext | undefined

Inherited From ParserRuleContext.parent

payload

TypeScript
payload: RuleContext

Property Value

RuleContext

Inherited From RuleContext.payload

ruleContext

TypeScript
ruleContext: this

Property Value

this

Inherited From ParserRuleContext.ruleContext

sourceInterval

TypeScript
sourceInterval: Interval

Property Value

Interval

Inherited From ParserRuleContext.sourceInterval

start

Get the initial token in this context. Note that the range from start to stop is inclusive, so for rules that do not consume anything (for example, zero length or error productions) this token may exceed stop.

TypeScript
start: Token

Property Value

Token

Inherited From ParserRuleContext.start

stop

Get the final token in this context. Note that the range from start to stop is inclusive, so for rules that do not consume anything (for example, zero length or error productions) this token may precede start.

TypeScript
stop: Token | undefined

Property Value

Token | undefined

Inherited From ParserRuleContext.stop

text

Return the combined text of all child nodes. This method only considers tokens which have been added to the parse tree. Since tokens on hidden channels (e.g. whitespace or comments) are not added to the parse trees, they will not appear in the output of this method.

TypeScript
text: string

Property Value

string

Inherited From RuleContext.text

Method Details

accept<Result>(CommonRegexVisitor<Result>)

TypeScript
function accept<Result>(visitor: CommonRegexVisitor<Result>): Result

Parameters

visitor

CommonRegexVisitor<Result>

Returns

Result

D0()

TypeScript
function D0(): TerminalNode | undefined

Returns

TerminalNode | undefined

D1()

TypeScript
function D1(): TerminalNode | undefined

Returns

TerminalNode | undefined

D2()

TypeScript
function D2(): TerminalNode | undefined

Returns

TerminalNode | undefined

D3()

TypeScript
function D3(): TerminalNode | undefined

Returns

TerminalNode | undefined

D4()

TypeScript
function D4(): TerminalNode | undefined

Returns

TerminalNode | undefined

D5()

TypeScript
function D5(): TerminalNode | undefined

Returns

TerminalNode | undefined

D6()

TypeScript
function D6(): TerminalNode | undefined

Returns

TerminalNode | undefined

D7()

TypeScript
function D7(): TerminalNode | undefined

Returns

TerminalNode | undefined

enterRule(CommonRegexListener)

TypeScript
function enterRule(listener: CommonRegexListener)

Parameters

exitRule(CommonRegexListener)

TypeScript
function exitRule(listener: CommonRegexListener)

Parameters

Inherited Method Details

addAnyChild<T>(T)

Add a parse tree node to this as a child. Works for internal and leaf nodes. Does not set parent link; other add methods must do that. Other addChild methods call this. We cannot set the parent pointer of the incoming node because the existing interfaces do not have a setParent() method and I don't want to break backward compatibility for this.

@since 4.7

TypeScript
function addAnyChild<T>(t: T): T

Parameters

t

T

Returns

T

Inherited From ParserRuleContext.addAnyChild

addChild(RuleContext)

TypeScript
function addChild(ruleInvocation: RuleContext)

Parameters

ruleInvocation

RuleContext

Inherited From ParserRuleContext.addChild

addChild(TerminalNode)

Add a token leaf node child and force its parent to be this node.

TypeScript
function addChild(t: TerminalNode)

Parameters

t

TerminalNode

Inherited From ParserRuleContext.addChild

addChild(Token)

Warning

This API is now deprecated.

Use another overload instead.

Add a child to this node based upon matchedToken. It creates a TerminalNodeImpl rather than using [Token)](xref:Parser%23createTerminalNode(ParserRuleContext%2C). I'm leaving this in for compatibility but the parser doesn't use this anymore.

TypeScript
function addChild(matchedToken: Token): TerminalNode

Parameters

matchedToken

Token

Returns

TerminalNode

Inherited From ParserRuleContext.addChild

addErrorNode(ErrorNode)

Add an error node child and force its parent to be this node.

TypeScript
function addErrorNode(errorNode: ErrorNode): ErrorNode

Parameters

errorNode

ErrorNode

Returns

ErrorNode

Inherited From ParserRuleContext.addErrorNode

addErrorNode(Token)

Warning

This API is now deprecated.

Use another overload instead.

Add a child to this node based upon badToken. It creates a ErrorNode rather than using [Token)](xref:Parser%23createErrorNode(ParserRuleContext%2C). I'm leaving this in for compatibility but the parser doesn't use this anymore.

TypeScript
function addErrorNode(badToken: Token): ErrorNode

Parameters

badToken

Token

Returns

ErrorNode

Inherited From ParserRuleContext.addErrorNode

copyFrom(ParserRuleContext)

COPY a ctx (I'm deliberately not using copy constructor) to avoid confusion with creating node with parent. Does not copy children (except error leaves). This is used in the generated parser code to flip a generic XContext node for rule X to a YContext for alt label Y. In that sense, it is not really a generic copy function.

If we do an error sync() at start of a rule, we might add error nodes to the generic XContext so this function must copy those nodes to the YContext as well else they are lost!

TypeScript
function copyFrom(ctx: ParserRuleContext)

Parameters

ctx

ParserRuleContext

Inherited From ParserRuleContext.copyFrom

depth()

TypeScript
function depth(): number

Returns

number

Inherited From RuleContext.depth

emptyContext()

TypeScript
static function emptyContext(): ParserRuleContext

Returns

ParserRuleContext

Inherited From ParserRuleContext.emptyContext

getChild(number)

TypeScript
function getChild(i: number): ParseTree

Parameters

i

number

Returns

ParseTree

Inherited From ParserRuleContext.getChild

getChild<T>(number, { })

TypeScript
function getChild<T>(i: number, ctxType: {  }): T

Parameters

i

number

ctxType

{ }

Returns

T

Inherited From ParserRuleContext.getChild

getChildContext(RuleContext, number)

TypeScript
static function getChildContext(parent: RuleContext, invokingState: number): RuleContext

Parameters

parent

RuleContext

invokingState

number

Returns

RuleContext

Inherited From RuleContext.getChildContext

getRuleContext<T>(number, { })

TypeScript
function getRuleContext<T>(i: number, ctxType: {  }): T

Parameters

i

number

ctxType

{ }

Returns

T

Inherited From ParserRuleContext.getRuleContext

getRuleContexts<T>({ })

TypeScript
function getRuleContexts<T>(ctxType: {  }): T[]

Parameters

ctxType

{ }

Returns

T[]

Inherited From ParserRuleContext.getRuleContexts

getToken(number, number)

TypeScript
function getToken(ttype: number, i: number): TerminalNode

Parameters

ttype

number

i

number

Returns

TerminalNode

Inherited From ParserRuleContext.getToken

getTokens(number)

TypeScript
function getTokens(ttype: number): TerminalNode[]

Parameters

ttype

number

Returns

TerminalNode[]

Inherited From ParserRuleContext.getTokens

removeLastChild()

Used by enterOuterAlt to toss out a RuleContext previously added as we entered a rule. If we have # label, we will need to remove generic ruleContext object.

TypeScript
function removeLastChild()

Inherited From ParserRuleContext.removeLastChild

setParent(RuleContext)

TypeScript
function setParent(parent: RuleContext)

Parameters

parent

RuleContext

Inherited From RuleContext.setParent

toInfoString(Parser)

Used for rule context info debugging during parse-time, not so much for ATN debugging

TypeScript
function toInfoString(recognizer: Parser): string

Parameters

recognizer

Parser

Returns

string

Inherited From ParserRuleContext.toInfoString

toString()

TypeScript
function toString(): string

Returns

string

Inherited From RuleContext.toString

toString(Recognizer<any, any> | undefined)

TypeScript
function toString(recog: Recognizer<any, any> | undefined): string

Parameters

recog

Recognizer<any, any> | undefined

Returns

string

Inherited From RuleContext.toString

toString(Recognizer<any, any> | undefined, RuleContext | undefined)

TypeScript
function toString(recog: Recognizer<any, any> | undefined, stop: RuleContext | undefined): string

Parameters

recog

Recognizer<any, any> | undefined

stop

RuleContext | undefined

Returns

string

Inherited From RuleContext.toString

toString(string[] | undefined)

TypeScript
function toString(ruleNames: string[] | undefined): string

Parameters

ruleNames

string[] | undefined

Returns

string

Inherited From RuleContext.toString

toString(string[] | undefined, RuleContext | undefined)

TypeScript
function toString(ruleNames: string[] | undefined, stop: RuleContext | undefined): string

Parameters

ruleNames

string[] | undefined

stop

RuleContext | undefined

Returns

string

Inherited From RuleContext.toString

toStringTree()

TypeScript
function toStringTree(): string

Returns

string

Inherited From RuleContext.toStringTree

toStringTree(Parser)

Print out a whole tree, not just a node, in LISP format (root child1 .. childN). Print just a node if this is a leaf. We have to know the recognizer so we can get rule names.

TypeScript
function toStringTree(recog: Parser): string

Parameters

recog

Parser

Returns

string

Inherited From RuleContext.toStringTree

toStringTree(string[] | undefined)

Print out a whole tree, not just a node, in LISP format (root child1 .. childN). Print just a node if this is a leaf.

TypeScript
function toStringTree(ruleNames: string[] | undefined): string

Parameters

ruleNames

string[] | undefined

Returns

string

Inherited From RuleContext.toStringTree

tryGetChild<T>(number, { })

TypeScript
function tryGetChild<T>(i: number, ctxType: {  }): T | undefined

Parameters

i

number

ctxType

{ }

Returns

T | undefined

Inherited From ParserRuleContext.tryGetChild

tryGetRuleContext<T>(number, { })

TypeScript
function tryGetRuleContext<T>(i: number, ctxType: {  }): T | undefined

Parameters

i

number

ctxType

{ }

Returns

T | undefined

Inherited From ParserRuleContext.tryGetRuleContext

tryGetToken(number, number)

TypeScript
function tryGetToken(ttype: number, i: number): TerminalNode | undefined

Parameters

ttype

number

i

number

Returns

TerminalNode | undefined

Inherited From ParserRuleContext.tryGetToken