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
파일 보기 프로젝트 열기: spring-projects/spring-net

보호된 프로퍼티들

프로퍼티 타입 설명
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