Class: Rattler::Parsers::Eof
- Inherits:
-
Parser
- Object
- Util::Node
- Parser
- Rattler::Parsers::Eof
- Includes:
- Atomic, Singleton
- Defined in:
- lib/rattler/parsers/eof.rb
Overview
Eof
succeeds if there is no more input to parse.
Class Method Summary collapse
-
.[] ⇒ Eof
Return the singleton instance of
Eof
. - .parsed(*_) ⇒ Object
Instance Method Summary collapse
-
#capturing? ⇒ Object
true
if the parser returns parse results on success, orfalse
if the parser simply returnstrue
on success. -
#parse(scanner, *_) ⇒ Boolean
Return
true
if there is no more input to parse.
Methods included from Atomic
Methods inherited from Parser
#&, #>>, #capturing_decidable?, #labeled?, #list, #one_or_more, #optional, #repeat, #semantic?, #sequence?, #skip, #variable_capture_count?, #with_ws, #zero_or_more, #|
Methods included from Runtime::ParserHelper
Methods inherited from Util::Node
#==, #[], #attrs, #can_equal?, #child, #children, #each, #empty?, #eql?, #initialize, #inspect, #method_missing, #name, #pretty_print, #pretty_print_cycle, #respond_to?, #same_contents?, #to_graphviz, #with_attrs, #with_attrs!, #with_children
Constructor Details
This class inherits a constructor from Rattler::Util::Node
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Rattler::Util::Node
Class Method Details
.[] ⇒ Eof
Return the singleton instance of Eof
14 15 16 |
# File 'lib/rattler/parsers/eof.rb', line 14 def self.[]() self.instance end |
.parsed(*_) ⇒ Object
19 20 21 |
# File 'lib/rattler/parsers/eof.rb', line 19 def self.parsed(*_) #:nodoc: self.instance end |
Instance Method Details
#capturing? ⇒ Object
Returns true
if the parser returns parse results on success, or false
if the parser simply returns true
on success.
33 34 35 |
# File 'lib/rattler/parsers/eof.rb', line 33 def capturing? false end |
#parse(scanner, *_) ⇒ Boolean
Return true
if there is no more input to parse
28 29 30 |
# File 'lib/rattler/parsers/eof.rb', line 28 def parse(scanner, *_) scanner.eos? end |