Module: Stupidedi::Builder::Tokenization

Included in:
BuilderDsl, StateMachine
Defined in:
lib/stupidedi/builder/tokenization.rb

Element Constructors collapse

Element Placeholders collapse

Instance Method Details

#blank

This method returns an undefined value.

Generates a blank element



33
34
35
# File 'lib/stupidedi/builder/tokenization.rb', line 33

def blank
  [:blank, nil, Reader::Position.caller(2)]
end

#composite(*components)

This method returns an undefined value.

Generates a composite element



23
24
25
# File 'lib/stupidedi/builder/tokenization.rb', line 23

def composite(*components)
  [:composite, components, Reader::Position.caller(2)]
end

#default

This method returns an undefined value.

Generates the only possible value an element may have, which may be blank. An exception is thrown if the element's usage requirement is optional, or if there are more than one allowed non-blank values.



55
56
57
# File 'lib/stupidedi/builder/tokenization.rb', line 55

def default
  [:default, nil, Reader::Position.caller(2)]
end

#not_used

This method returns an undefined value.

Generates a blank element and asserts that the element's usage requirement is NOT USED



43
44
45
# File 'lib/stupidedi/builder/tokenization.rb', line 43

def not_used
  [:not_used, nil, Reader::Position.caller(2)]
end

#repeated(*elements)

This method returns an undefined value.

Generates a repeated element (simple or composite)



16
17
18
# File 'lib/stupidedi/builder/tokenization.rb', line 16

def repeated(*elements)
  [:repeated, elements, Reader::Position.caller(2)]
end