Execute() public method

Execute the actions encapsulated by this executor within the context of a particular Antlr4.Runtime.Lexer .

This method calls Antlr4.Runtime.IIntStream.Seek(int) to set the position of the input Antlr4.Runtime.ICharStream prior to calling ILexerAction.Execute(Antlr4.Runtime.Lexer) on a position-dependent action. Before the method returns, the input position will be restored to the same position it was in when the method was invoked.

public Execute ( Lexer lexer, ICharStream input, int startIndex ) : void
lexer Lexer The lexer instance.
input ICharStream /// The input stream which is the source for the current token. /// When this method is called, the current /// /// for /// /// should be the start of the following token, i.e. 1 /// character past the end of the current token. ///
startIndex int /// The token start index. This value may be passed to /// /// to set the /// /// position to the beginning /// of the token. ///
return void
示例#1
0
 protected internal virtual void Accept(ICharStream input, LexerActionExecutor lexerActionExecutor, int startIndex, int index, int line, int charPos)
 {
     // seek to after last char in token
     input.Seek(index);
     this._line = line;
     this.charPositionInLine = charPos;
     if (lexerActionExecutor != null && recog != null)
     {
         lexerActionExecutor.Execute(recog, input, startIndex);
     }
 }
示例#2
0
        protected void Accept(ICharStream input, LexerActionExecutor lexerActionExecutor,
                              int startIndex, int index, int line, int charPos)
        {
            if (debug)
            {
                ConsoleWriteLine("ACTION " + lexerActionExecutor);
            }

            // seek to after last char in token
            input.Seek(index);
            this.thisLine           = line;
            this.charPositionInLine = charPos;

            if (lexerActionExecutor != null && recog != null)
            {
                lexerActionExecutor.Execute(recog, input, startIndex);
            }
        }
示例#3
0
 protected internal virtual void Accept(ICharStream input, LexerActionExecutor lexerActionExecutor, int startIndex, int index, int line, int charPos)
 {
     // seek to after last char in token
     input.Seek(index);
     this.line = line;
     this.charPositionInLine = charPos;
     if (lexerActionExecutor != null && recog != null)
     {
         lexerActionExecutor.Execute(recog, input, startIndex);
     }
 }
示例#4
0
        protected void Accept(ICharStream input, LexerActionExecutor lexerActionExecutor,
							  int startIndex, int index, int line, int charPos)
        {
            if (debug)
            {
                Console.WriteLine("ACTION " + lexerActionExecutor);
            }

            // seek to after last char in token
            input.Seek(index);
            this.thisLine = line;
            this.charPositionInLine = charPos;

            if (lexerActionExecutor != null && recog != null)
            {
                lexerActionExecutor.Execute(recog, input, startIndex);
            }
        }