C# Class Antlr4.Runtime.Atn.LexerCustomAction

Executes a custom lexer action by calling Antlr4.Runtime.Recognizer{Symbol, ATNInterpreter}.Action(Antlr4.Runtime.RuleContext, int, int) with the rule and action indexes assigned to the custom action. The implementation of a custom action is added to the generated code for the lexer in an override of Antlr4.Runtime.Recognizer{Symbol, ATNInterpreter}.Action(Antlr4.Runtime.RuleContext, int, int) when the grammar is compiled.

This class may represent embedded actions created with the {...} syntax in ANTLR 4, as well as actions created for lexer commands where the command argument could not be evaluated when the grammar was compiled.

Inheritance: ILexerAction
Show file Open project: sharwell/antlr4cs Class Usage Examples

Public Methods

Method Description
Equals ( object obj ) : bool
Execute ( Lexer lexer ) : void

Custom actions are implemented by calling Antlr4.Runtime.Recognizer{Symbol, ATNInterpreter}.Action(Antlr4.Runtime.RuleContext, int, int) with the appropriate rule and action indexes.

GetHashCode ( ) : int
LexerCustomAction ( int ruleIndex, int actionIndex ) : Antlr4.Runtime

Constructs a custom lexer action with the specified rule and action indexes.

Method Details

Equals() public method

public Equals ( object obj ) : bool
obj object
return bool

Execute() public method

Custom actions are implemented by calling Antlr4.Runtime.Recognizer{Symbol, ATNInterpreter}.Action(Antlr4.Runtime.RuleContext, int, int) with the appropriate rule and action indexes.

public Execute ( Lexer lexer ) : void
lexer Lexer
return void

GetHashCode() public method

public GetHashCode ( ) : int
return int

LexerCustomAction() public method

Constructs a custom lexer action with the specified rule and action indexes.
public LexerCustomAction ( int ruleIndex, int actionIndex ) : Antlr4.Runtime
ruleIndex int /// The rule index to use for calls to /// /// . ///
actionIndex int /// The action index to use for calls to /// /// . ///
return Antlr4.Runtime