예제 #1
0
        protected BufferPosition TakePosition()
        {
            BufferPosition position = _position;

            ClearPosition();
            return(position);
        }
예제 #2
0
        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;
        }
예제 #3
0
 public ErrorEventArgs(string message, BufferPosition position)
 {
     Message  = message;
     Position = position;
 }
예제 #4
0
파일: IntToken.cs 프로젝트: tgjones/weaver
 public IntToken(int value, string sourcePath, BufferPosition position)
     : base(LiteralTokenType.Int, sourcePath, position)
 {
     Value = value;
 }
예제 #5
0
 public ShaderCodeToken(string shaderCode, string sourcePath, BufferPosition position)
     : base(TokenType.ShaderCode, sourcePath, position)
 {
     ShaderCode = shaderCode;
 }
예제 #6
0
파일: Lexer.cs 프로젝트: tgjones/weaver
 private void ClearPosition()
 {
     _position = new BufferPosition();
 }
예제 #7
0
파일: Lexer.cs 프로젝트: tgjones/weaver
 protected void StartToken()
 {
     _position = _buffer.Position;
 }
예제 #8
0
 public FloatToken(float value, string sourcePath, BufferPosition position)
     : base(LiteralTokenType.Float, sourcePath, position)
 {
     Value = value;
 }
예제 #9
0
 public IdentifierToken(string identifier, string sourcePath, BufferPosition position)
     : base(TokenType.Identifier, sourcePath, position)
 {
     Identifier = identifier;
 }
예제 #10
0
 public LiteralToken(LiteralTokenType literalType, string sourcePath, BufferPosition position)
     : base(TokenType.Literal, sourcePath, position)
 {
     LiteralType = literalType;
 }
예제 #11
0
 public StringToken(string value, string sourcePath, BufferPosition position)
     : base(LiteralTokenType.String, sourcePath, position)
 {
     Value = value;
 }
예제 #12
0
파일: Token.cs 프로젝트: tgjones/weaver
 public Token(TokenType type, string sourcePath, BufferPosition position)
 {
     Type = type;
     SourcePath = sourcePath;
     Position = position;
 }
예제 #13
0
 private void ClearPosition()
 {
     _position = new BufferPosition();
 }
예제 #14
0
 protected void StartToken()
 {
     _position = _buffer.Position;
 }
예제 #15
0
 public ErrorEventArgs(string message, BufferPosition position)
 {
     Message = message;
     Position = position;
 }