forked from jasder/antlr
parent
128ec07dd3
commit
10eb1a1970
|
@ -19,7 +19,7 @@ type Lexer interface {
|
|||
pushMode(int)
|
||||
popMode() int
|
||||
setType(int)
|
||||
mode(int)
|
||||
setMode(int)
|
||||
}
|
||||
|
||||
type BaseLexer struct {
|
||||
|
@ -37,7 +37,7 @@ type BaseLexer struct {
|
|||
token Token
|
||||
hitEOF bool
|
||||
channel int
|
||||
thetype int
|
||||
thetype int
|
||||
modeStack IntStack
|
||||
mode int
|
||||
text string
|
||||
|
@ -249,6 +249,10 @@ func (b *BaseLexer) More() {
|
|||
b.thetype = LexerMore
|
||||
}
|
||||
|
||||
func (b *BaseLexer) setMode(m int) {
|
||||
b.mode = m
|
||||
}
|
||||
|
||||
func (b *BaseLexer) pushMode(m int) {
|
||||
if LexerATNSimulatorDebug {
|
||||
fmt.Println("pushMode " + strconv.Itoa(m))
|
||||
|
|
|
@ -232,7 +232,7 @@ func NewLexerModeAction(mode int) *LexerModeAction {
|
|||
// <p>This action is implemented by calling {@link Lexer//mode} with the
|
||||
// value provided by {@link //getMode}.</p>
|
||||
func (l *LexerModeAction) execute(lexer Lexer) {
|
||||
lexer.mode(l.mode)
|
||||
lexer.setMode(l.mode)
|
||||
}
|
||||
|
||||
func (l *LexerModeAction) Hash() string {
|
||||
|
|
Loading…
Reference in New Issue