Token AddToken(string value, TokenType tokentype, bool resolved, string originalvalue) { CurrentToken = new Token(value, tokentype, CurrentToken, resolved); CurrentToken.Line = Assembler.currentLine; tokens.Add(CurrentToken); TokenizerEventArgs e = new TokenizerEventArgs(CurrentChar, CurrentToken); TokenFound?.Invoke(this, e); CurrentChar = e.CurrentChar; CurrentToken.Row = row; CurrentToken.Col = CurrentChar - originalvalue.Length; CurrentToken.OriginalValue = originalvalue; return(CurrentToken); }
Token AddToken(string value, TokenType tokentype) { if (value == "\r") { value = ""; } CurrentToken = new Token(value, tokentype, CurrentToken); CurrentToken.Line = Assembler.currentLine; tokens.Add(CurrentToken); TokenizerEventArgs e = new TokenizerEventArgs(CurrentChar, CurrentToken); TokenFound?.Invoke(this, e); CurrentChar = e.CurrentChar; CurrentToken = e.Token; CurrentToken.Row = row; CurrentToken.Col = CurrentChar - value.Length; CurrentToken.OriginalValue = value; return(CurrentToken); }
protected virtual void OnTokenFound(TToken token) { TokenFound?.Invoke(token); }