Module: Spectre::StringParsing

Includes:
Spectre
Defined in:
lib/spectre/string.rb,
lib/spectre/string/directives.rb,
lib/spectre/string/primitives.rb,
lib/spectre/string/additionals.rb,
lib/spectre/string/inputiterator.rb

Defined Under Namespace

Classes: AlnumParser, AlphaParser, AnycharParser, BlankParser, CharParser, ControlParser, DigitParser, EOLParser, GraphParser, HexDigitParser, LowerDirective, LowerParser, PrintParser, PunctParser, RegExpParser, SpaceParser, StringInputIterator, StringParser, UpperParser

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Spectre

#closed, register_POD, #sym

Class Method Details

.parse(string, parser, pre_skip = true) ⇒ Object

Shortcut that parses the string using the parser and a StringInputIterator. pre_skip will be passed on to Node#parse. If you mix the StringParsing module into your class, it will gain this method.



49
50
51
# File 'lib/spectre/string.rb', line 49

def parse string, parser, pre_skip = true
    parser.to_p.parse StringInputIterator.new(string), pre_skip
end

Instance Method Details

#parse(string, parser, pre_skip = true) ⇒ Object

Shortcut that parses the string using the parser and a StringInputIterator. pre_skip will be passed on to Node#parse. If you mix the StringParsing module into your class, it will gain this method.



39
40
41
# File 'lib/spectre/string.rb', line 39

def parse string, parser, pre_skip = true
    parser.to_p.parse StringInputIterator.new(string), pre_skip
end