C# Класс Spring.Expressions.Parser.antlr.debug.ParseTreeDebugParser

Specifies the behaviour required (i.e. parser modifications) specifically to support parse tree debugging and derivation.

Override the standard matching and rule entry/exit routines to build parse trees. This class is useful for 2.7.3 where you can specify a superclass like

class TinyCParser extends Parser(ParseTreeDebugParser);

Наследование: antlr.LLkParser
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
currentParseTreeRoot System.Collections.Stack
mostRecentParseTreeRoot antlr.ParseTreeRule
numberOfDerivationSteps int

Открытые методы

Метод Описание
ParseTreeDebugParser ( antlr.ParserSharedInputState state, int k_ ) : antlr
ParseTreeDebugParser ( antlr.TokenBuffer tokenBuf, int k_ ) : antlr
ParseTreeDebugParser ( TokenStream lexer, int k_ ) : antlr
ParseTreeDebugParser ( int k_ ) : antlr
getNumberOfDerivationSteps ( ) : int
getParseTree ( ) : antlr.ParseTree
match ( antlr.collections.impl.BitSet bitSet ) : void
match ( int i ) : void
matchNot ( int i ) : void
traceIn ( string s ) : void

Create a rule node, add to current tree, and make it current root

traceOut ( string s ) : void

Pop current root; back to adding to old root

Защищенные методы

Метод Описание
addCurrentTokenToParseTree ( ) : void

Adds LT(1) to the current parse subtree.

Note that the match() routines add the node before checking for correct match. This means that, upon mismatched token, there will a token node in the tree corresponding to where that token was expected. For no viable alternative errors, no node will be in the tree as nothing was matched() (the lookahead failed to predict an alternative).

Описание методов

ParseTreeDebugParser() публичный Метод

public ParseTreeDebugParser ( antlr.ParserSharedInputState state, int k_ ) : antlr
state antlr.ParserSharedInputState
k_ int
Результат antlr

ParseTreeDebugParser() публичный Метод

public ParseTreeDebugParser ( antlr.TokenBuffer tokenBuf, int k_ ) : antlr
tokenBuf antlr.TokenBuffer
k_ int
Результат antlr

ParseTreeDebugParser() публичный Метод

public ParseTreeDebugParser ( TokenStream lexer, int k_ ) : antlr
lexer TokenStream
k_ int
Результат antlr

ParseTreeDebugParser() публичный Метод

public ParseTreeDebugParser ( int k_ ) : antlr
k_ int
Результат antlr

addCurrentTokenToParseTree() защищенный Метод

Adds LT(1) to the current parse subtree.

Note that the match() routines add the node before checking for correct match. This means that, upon mismatched token, there will a token node in the tree corresponding to where that token was expected. For no viable alternative errors, no node will be in the tree as nothing was matched() (the lookahead failed to predict an alternative).

protected addCurrentTokenToParseTree ( ) : void
Результат void

getNumberOfDerivationSteps() публичный Метод

public getNumberOfDerivationSteps ( ) : int
Результат int

getParseTree() публичный Метод

public getParseTree ( ) : antlr.ParseTree
Результат antlr.ParseTree

match() публичный Метод

public match ( antlr.collections.impl.BitSet bitSet ) : void
bitSet antlr.collections.impl.BitSet
Результат void

match() публичный Метод

public match ( int i ) : void
i int
Результат void

matchNot() публичный Метод

public matchNot ( int i ) : void
i int
Результат void

traceIn() публичный Метод

Create a rule node, add to current tree, and make it current root
public traceIn ( string s ) : void
s string
Результат void

traceOut() публичный Метод

Pop current root; back to adding to old root
public traceOut ( string s ) : void
s string
Результат void

Описание свойств

currentParseTreeRoot защищенное свойство

Each new rule invocation must have it's own subtree. Tokens are added to the current root so we must have a stack of subtree roots.
protected System.Collections.Stack currentParseTreeRoot
Результат System.Collections.Stack

mostRecentParseTreeRoot защищенное свойство

Track most recently created parse subtree so that when parsing is finished, we can get to the root.
protected ParseTreeRule,antlr mostRecentParseTreeRoot
Результат antlr.ParseTreeRule

numberOfDerivationSteps защищенное свойство

For every rule replacement with a production, we bump up count.
protected int numberOfDerivationSteps
Результат int