public final class LexerChannelAction extends Object implements LexerAction
channel lexer action by calling
Lexer.setChannel(int) with the assigned channel.| 构造器和说明 |
|---|
LexerChannelAction(int channel)
Constructs a new
channel action with the specified channel value. |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
equals(Object obj) |
void |
execute(Lexer lexer)
Execute the lexer action in the context of the specified
Lexer. |
LexerActionType |
getActionType()
Gets the serialization type of the lexer action.
|
int |
getChannel()
Gets the channel to use for the
Token created by the lexer. |
int |
hashCode() |
boolean |
isPositionDependent()
Gets whether the lexer action is position-dependent.
|
String |
toString() |
public LexerChannelAction(int channel)
channel action with the specified channel value.channel - The channel value to pass to Lexer.setChannel(int).public int getChannel()
Token created by the lexer.Token created by the lexer.public LexerActionType getActionType()
getActionType 在接口中 LexerActionLexerActionType.CHANNEL.public boolean isPositionDependent()
CharStream
index at the time the action is executed.
Many lexer commands, including type, skip, and
more, do not check the input index during their execution.
Actions like this are position-independent, and may be stored more
efficiently as part of the ATNConfig.getLexerActionExecutor().
isPositionDependent 在接口中 LexerActionfalse.public void execute(@NotNull
Lexer lexer)
Lexer.
For position-dependent actions, the input stream must already be positioned correctly prior to calling this method.
This action is implemented by calling Lexer.setChannel(int) with the
value provided by getChannel().
execute 在接口中 LexerActionlexer - The lexer instance.Copyright © 1992–2022 Daniel Sun. All rights reserved.