Class: LexerKit::DFA::RegexAST::Meta

Inherits:
Data
  • Object
show all
Defined in:
lib/lexer_kit/dfa/regex_ast.rb

Overview

Metadata for AST nodes (source location, original text, etc.)

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bytesObject (readonly)

Returns the value of attribute bytes

Returns:

  • (Object)

    the current value of bytes



9
10
11
# File 'lib/lexer_kit/dfa/regex_ast.rb', line 9

def bytes
  @bytes
end

#codepointObject (readonly)

Returns the value of attribute codepoint

Returns:

  • (Object)

    the current value of codepoint



9
10
11
# File 'lib/lexer_kit/dfa/regex_ast.rb', line 9

def codepoint
  @codepoint
end

#literal_textObject (readonly)

Returns the value of attribute literal_text

Returns:

  • (Object)

    the current value of literal_text



9
10
11
# File 'lib/lexer_kit/dfa/regex_ast.rb', line 9

def literal_text
  @literal_text
end

#spanObject (readonly)

Returns the value of attribute span

Returns:

  • (Object)

    the current value of span



9
10
11
# File 'lib/lexer_kit/dfa/regex_ast.rb', line 9

def span
  @span
end

Instance Method Details

#to_sObject



10
11
12
13
14
15
16
# File 'lib/lexer_kit/dfa/regex_ast.rb', line 10

def to_s
  parts = []
  parts << "span=#{span.inspect}" if span
  parts << "text=#{literal_text.inspect}" if literal_text
  parts << "cp=U+#{codepoint.to_s(16).upcase}" if codepoint
  "{#{parts.join(', ')}}"
end