protected BufferPosition TakePosition() { BufferPosition position = _position; ClearPosition(); return(position); }
protected void ReportError(string message, Token token, params object[] args) { BufferPosition position = token.Position; if (Error != null && _lastErrorPosition != position) { Error(this, new ErrorEventArgs(string.Format(message, args), position)); } _lastErrorPosition = position; }
public IntToken(int value, string sourcePath, BufferPosition position) : base(LiteralTokenType.Int, sourcePath, position) { Value = value; }
public ErrorEventArgs(string message, BufferPosition position) { Message = message; Position = position; }
protected void ReportError(string message, Token token, params object[] args) { BufferPosition position = token.Position; if (Error != null && _lastErrorPosition != position) Error(this, new ErrorEventArgs(string.Format(message, args), position)); _lastErrorPosition = position; }
public Token(TokenType type, string sourcePath, BufferPosition position) { Type = type; SourcePath = sourcePath; Position = position; }
public IdentifierToken(string identifier, string sourcePath, BufferPosition position) : base(TokenType.Identifier, sourcePath, position) { Identifier = identifier; }
private void ClearPosition() { _position = new BufferPosition(); }
protected void StartToken() { _position = _buffer.Position; }
public StringToken(string value, string sourcePath, BufferPosition position) : base(LiteralTokenType.String, sourcePath, position) { Value = value; }
public FloatToken(float value, string sourcePath, BufferPosition position) : base(LiteralTokenType.Float, sourcePath, position) { Value = value; }
public LiteralToken(LiteralTokenType literalType, string sourcePath, BufferPosition position) : base(TokenType.Literal, sourcePath, position) { LiteralType = literalType; }