Class: Dhaka::Token

### Home Classes Methods

### In Files

- lib/dhaka/parser/token.rb

### Parent

Object

### Methods

- ::new
- #==

### Class/Module Index

Quicksearch

- Dhaka
- Dhaka::CompiledLexer
- Dhaka::CompiledParser
- Dhaka::Evaluator
- Dhaka::Grammar
- Dhaka::GrammarSymbol
- Dhaka::Lexeme
- Dhaka::Lexer
- Dhaka::LexerRun
- Dhaka::LexerSpecification
- Dhaka::LexerSupport
- Dhaka::LexerSupport::AcceptAction
- Dhaka::LexerSupport::CheckpointAction
- Dhaka::LexerSupport::DFARun
- Dhaka::LexerSupport::InvalidRegexException
- Dhaka::LexerSupport::LookaheadAcceptAction
- Dhaka::LexerSupport::RegexParser
- Dhaka::LexerSupport::RegexTokenizer
- Dhaka::LexerSupport::State
- Dhaka::LexerSupport::StateMachine
- Dhaka::NoStartProductionsError
- Dhaka::ParseErrorResult
- Dhaka::ParseSuccessResult
- Dhaka::ParseTreeCompositeNode
- Dhaka::ParseTreeLeafNode
- Dhaka::Parser
- Dhaka::ParserMethods
- Dhaka::PrecedenceBuilder
- Dhaka::Production
- Dhaka::ProductionBuilder
- Dhaka::Token
- Dhaka::Tokenizer
- Dhaka::TokenizerErrorResult
- Dhaka::TokenizerState
- Dhaka::TokenizerSuccessResult

No matching classes.

# Dhaka::Token

Represents a portion of the input character stream that is mapped by the tokenizer to a symbol in the grammar. The attribute `input_position` contains the start index position of the original string input that this token came from. It can be used to report errors by indicating the specific portion of the input where the error occurred.

### Attributes

input_position[RW]
symbol_name[RW]
value[RW]

### Public Class Methods

new(symbol_name, value, input_position) click to toggle source

    # File lib/dhaka/parser/token.rb, line 8
    def initialize(symbol_name, value, input_position)
      @symbol_name    = symbol_name
      @value          = value
      @input_position = input_position
    end

### Public Instance Methods

==(other) click to toggle source

    # File lib/dhaka/parser/token.rb, line 18
    def == other
      symbol_name == other.symbol_name && value == other.value
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.