Class: DDQL::TokenType::Screen

Inherits:
DDQL::TokenType show all
Defined in:
lib/ddql/token_type.rb

Constant Summary

Constants inherited from DDQL::TokenType

ALL, CURRENCY_LITERAL, FACTOR, FACTOR_PATTERN, INFIXOPERATOR, INTEGER_LITERAL, LBRACE, LPAREN, NESTED_CLOSER, NESTED_CLOSE_PATTERN, NESTED_OPENER, NESTED_OPEN_PATTERN, NUMERIC_LITERAL, POSTFIXOPERATOR, PREFIXOPERATOR, RBRACE, RPAREN, SCI_NUM_LITERAL, SCREEN, SPECIAL_MARKER, STRING_LITERAL, SUB_Q_ALIAS, SUB_Q_EXPR, SUB_Q_FIELDS, SUB_Q_GROUP, SUB_Q_TYPE, WHITESPACE

Instance Attribute Summary

Attributes inherited from DDQL::TokenType

#label, #name, #pattern

Instance Method Summary collapse

Methods inherited from DDQL::TokenType

#==, all_types_pattern, #comparison?, #data_from, #factor?, #group?, #infix?, #interpret, #interpreted_data_from, #literal?, #match?, #parse, #postfix?, #prefix?, #skipping!, #supports_post_processing?, #trimming!

Constructor Details

#initializeScreen

Returns a new instance of Screen.



398
399
400
401
# File 'lib/ddql/token_type.rb', line 398

def initialize
  super(name: :screen, pattern: /\[(screen)(#)(\d+)\]+/)
  trimming!
end

Instance Method Details

#as_hash(data) ⇒ Object



403
404
405
# File 'lib/ddql/token_type.rb', line 403

def as_hash(data)
  {screen: data.split('#').last.to_i}
end

#expression?Boolean

Returns:

  • (Boolean)


407
408
409
# File 'lib/ddql/token_type.rb', line 407

def expression?
  true
end

#screen?Boolean

Returns:

  • (Boolean)


411
412
413
# File 'lib/ddql/token_type.rb', line 411

def screen?
  true
end