Class: Dhaka::GrammarSymbol

### Home Classes Methods

### In Files

- lib/dhaka/grammar/grammar_symbol.rb

### Parent

Object

### Methods

- ::new
- #<=>
- #terminal

### 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::GrammarSymbol

Each grammar symbol is uniquely identified by a string name. The name of a symbol can be anything (except the two reserved names `'_Start_'` and `'_End_'`) and need not correspond to its character representation. For example, an ampersand in the input string could be tokenized as a symbol with a name 'AND_OP'. You never have to directly instantiate a GrammarSymbol. It is done implicitly for you when you define a Grammar.

### Attributes

associativity[RW]
name[R]
non_terminal[RW]
nullable[RW]
precedence[RW]

### Public Class Methods

new(name) click to toggle source

    # File lib/dhaka/grammar/grammar_symbol.rb, line 11
    def initialize(name)
      @name = name
    end

### Public Instance Methods

<=>(other) click to toggle source

    # File lib/dhaka/grammar/grammar_symbol.rb, line 23
    def <=> other
      name <=> other.name
    end

terminal() click to toggle source

    # File lib/dhaka/grammar/grammar_symbol.rb, line 15
    def terminal
      !non_terminal
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.