Class: TinyGQL::Parser
- Inherits:
-
Object
- Object
- TinyGQL::Parser
- Defined in:
- lib/tinygql/parser.rb
Defined Under Namespace
Classes: UnexpectedToken
Instance Attribute Summary collapse
-
#token_name ⇒ Object
readonly
Returns the value of attribute token_name.
Instance Method Summary collapse
-
#initialize(doc) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
Constructor Details
#initialize(doc) ⇒ Parser
Returns a new instance of Parser.
12 13 14 15 16 |
# File 'lib/tinygql/parser.rb', line 12 def initialize doc @lexer = Lexer.new doc @lexer.advance @token_name = @lexer.token_name end |
Instance Attribute Details
#token_name ⇒ Object (readonly)
Returns the value of attribute token_name.
10 11 12 |
# File 'lib/tinygql/parser.rb', line 10 def token_name @token_name end |
Instance Method Details
#parse ⇒ Object
18 19 20 |
# File 'lib/tinygql/parser.rb', line 18 def parse document end |