Class: Piggly::Parser::Nodes::Terminal

Inherits:
NodeClass show all
Defined in:
lib/piggly/parser/nodes.rb

Overview

Terminals have no children

Direct Known Subclasses

StubNode, TextNode, Token

Instance Attribute Summary

Attributes inherited from NodeClass

#source_text

Instance Method Summary collapse

Methods inherited from NodeClass

#assignment?, #block?, #branch?, #comment?, #datatype?, #else?, #expression?, #for?, #identifier?, #if?, #indent, #keyword?, #label?, #loop?, #named?, #sql?, #statement?, #string?, #stub?, #style, #tag, #tag_id, #tagged?, #token?, #while?, #whitespace?

Methods included from Traversal

#count, #find, #flatten, #inject, #select

Constructor Details

#initialize(input, interval, elements = nil) ⇒ Terminal

Returns a new instance of Terminal.



274
275
276
277
# File 'lib/piggly/parser/nodes.rb', line 274

def initialize(input, interval, elements = nil)
  # Third argument nil prevents children from being assigned
  super(input, interval, nil)
end

Instance Method Details

#terminal?Boolean

Returns:

  • (Boolean)


279
280
281
# File 'lib/piggly/parser/nodes.rb', line 279

def terminal?
  true
end