Class: CldrPlurals::Compiler::Parser
- Inherits:
-
Object
- Object
- CldrPlurals::Compiler::Parser
- Defined in:
- lib/cldr-plurals/compiler/parser.rb
Defined Under Namespace
Classes: UnexpectedTokenError
Constant Summary collapse
- OPERATORS =
[ :modulo, :equals, :not_equals ]
- SAMPLES =
[ :int_sample, :dec_sample ]
Instance Attribute Summary collapse
-
#counter ⇒ Object
readonly
Returns the value of attribute counter.
-
#stack ⇒ Object
readonly
Returns the value of attribute stack.
-
#token_list ⇒ Object
readonly
Returns the value of attribute token_list.
Instance Method Summary collapse
-
#initialize(token_list) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
Constructor Details
#initialize(token_list) ⇒ Parser
Returns a new instance of Parser.
21 22 23 24 25 |
# File 'lib/cldr-plurals/compiler/parser.rb', line 21 def initialize(token_list) @token_list = token_list @stack = [] @counter = 0 end |
Instance Attribute Details
#counter ⇒ Object (readonly)
Returns the value of attribute counter.
19 20 21 |
# File 'lib/cldr-plurals/compiler/parser.rb', line 19 def counter @counter end |
#stack ⇒ Object (readonly)
Returns the value of attribute stack.
19 20 21 |
# File 'lib/cldr-plurals/compiler/parser.rb', line 19 def stack @stack end |
#token_list ⇒ Object (readonly)
Returns the value of attribute token_list.
19 20 21 |
# File 'lib/cldr-plurals/compiler/parser.rb', line 19 def token_list @token_list end |