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



31
32
33
# File 'lib/stupidedi/builder/tokenization.rb', line 31

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

#composite(*components)

This method returns an undefined value.

Generates a composite element



21
22
23
# File 'lib/stupidedi/builder/tokenization.rb', line 21

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.



53
54
55
# File 'lib/stupidedi/builder/tokenization.rb', line 53

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



41
42
43
# File 'lib/stupidedi/builder/tokenization.rb', line 41

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)



14
15
16
# File 'lib/stupidedi/builder/tokenization.rb', line 14

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