Class: Meteor::Ml::Html5::ParserImpl

Inherits:
Meteor::Ml::Html::ParserImpl show all
Defined in:
lib/meteor.rb

Overview

HTML5 parser (HTML5パーサ)

Constant Summary collapse

CHARSET =
'charset'.freeze
UTF8 =
'utf-8'.freeze
MATCH_TAG =
Array

内容のない要素

['br'.freeze, 'hr'.freeze, 'img'.freeze, 'input'.freeze, 'meta'.freeze, 'base'.freeze, 'embed'.freeze, 'command'.freeze, 'keygen'.freeze]
MATCH_TAG_SNG =
Array

入れ子にできない要素

['texarea'.freeze, 'select'.freeze, 'option'.freeze, 'form'.freeze, 'fieldset'.freeze, 'figure'.freeze, 'figcaption'.freeze, 'video'.freeze, 'audio'.freeze, 'progress'.freeze, 'meter'.freeze, 'time'.freeze, 'ruby'.freeze, 'rt'.freeze, 'rp'.freeze, 'datalist'.freeze, 'output'.freeze]
ATTR_LOGIC =
Array

論理値で指定する属性

['disabled'.freeze, 'readonly'.freeze, 'checked'.freeze, 'selected'.freeze, 'multiple'.freeze, 'required'.freeze]
DISABLE_ELEMENT =
Array

disabled属性のある要素

['input'.freeze, 'textarea'.freeze, 'select'.freeze, 'optgroup'.freeze, 'fieldset'.freeze]
REQUIRE_ELEMENT =
Array

required属性のある要素

['input', 'textarea']
REQUIRED =
'required'
REQUIRED_M =
'\\srequired\\s|\\srequired$|\\sREQUIRED\\s|\\sREQUIRED$'.freeze
REQUIRED_R =

REQUIRED_M = [' required ',' required',' REQUIRED ',' REQUIRED']

'required\\s|required$|REQUIRED\\s|REQUIRED$'.freeze
@@pattern_required_m =
Regexp.new(REQUIRED_M)
@@pattern_required_r =
Regexp.new(REQUIRED_R)

Constants inherited from Meteor::Ml::Html::ParserImpl

Meteor::Ml::Html::ParserImpl::BR_1, Meteor::Ml::Html::ParserImpl::BR_2, Meteor::Ml::Html::ParserImpl::CHECKED, Meteor::Ml::Html::ParserImpl::CHECKED_M, Meteor::Ml::Html::ParserImpl::CHECKED_R, Meteor::Ml::Html::ParserImpl::CONTENT, Meteor::Ml::Html::ParserImpl::CONTENT_TYPE, Meteor::Ml::Html::ParserImpl::DISABLED, Meteor::Ml::Html::ParserImpl::DISABLED_M, Meteor::Ml::Html::ParserImpl::DISABLED_R, Meteor::Ml::Html::ParserImpl::FALSE, Meteor::Ml::Html::ParserImpl::GET_ATTRS_MAP2, Meteor::Ml::Html::ParserImpl::HTTP_EQUIV, Meteor::Ml::Html::ParserImpl::INPUT, Meteor::Ml::Html::ParserImpl::KAIGYO_CODE, Meteor::Ml::Html::ParserImpl::META, Meteor::Ml::Html::ParserImpl::META_S, Meteor::Ml::Html::ParserImpl::MULTIPLE, Meteor::Ml::Html::ParserImpl::MULTIPLE_M, Meteor::Ml::Html::ParserImpl::MULTIPLE_R, Meteor::Ml::Html::ParserImpl::NBSP_2, Meteor::Ml::Html::ParserImpl::NBSP_3, Meteor::Ml::Html::ParserImpl::OPTION, Meteor::Ml::Html::ParserImpl::PATTERN_ESCAPE, Meteor::Ml::Html::ParserImpl::PATTERN_ESCAPE_CONTENT, Meteor::Ml::Html::ParserImpl::PATTERN_UNESCAPE, Meteor::Ml::Html::ParserImpl::RADIO, Meteor::Ml::Html::ParserImpl::READONLY, Meteor::Ml::Html::ParserImpl::READONLY_M, Meteor::Ml::Html::ParserImpl::READONLY_R, Meteor::Ml::Html::ParserImpl::READONLY_TYPE, Meteor::Ml::Html::ParserImpl::SELECT, Meteor::Ml::Html::ParserImpl::SELECTED, Meteor::Ml::Html::ParserImpl::SELECTED_M, Meteor::Ml::Html::ParserImpl::SELECTED_R, Meteor::Ml::Html::ParserImpl::TABLE_FOR_ESCAPE_, Meteor::Ml::Html::ParserImpl::TABLE_FOR_ESCAPE_CONTENT_, Meteor::Ml::Html::ParserImpl::TEXTAREA, Meteor::Ml::Html::ParserImpl::TRUE, Meteor::Ml::Html::ParserImpl::TYPE_L, Meteor::Ml::Html::ParserImpl::TYPE_U

Constants inherited from Core::Kernel

Core::Kernel::AND_1, Core::Kernel::AND_2, Core::Kernel::AND_3, Core::Kernel::AP_1, Core::Kernel::AP_2, Core::Kernel::AP_3, Core::Kernel::ATTR_EQ, Core::Kernel::CLEAN_1, Core::Kernel::CLEAN_2, Core::Kernel::CSS_CLASS, Core::Kernel::CSS_ID, Core::Kernel::DOUBLE_QUATATION, Core::Kernel::EMPTY, Core::Kernel::EN_1, Core::Kernel::ERASE_ATTR_1, Core::Kernel::ESCAPE_ENTITY_REF, Core::Kernel::GET_ATTRS_MAP, Core::Kernel::GET_ATTR_1, Core::Kernel::GT_1, Core::Kernel::GT_2, Core::Kernel::GT_3, Core::Kernel::LT_1, Core::Kernel::LT_2, Core::Kernel::LT_3, Core::Kernel::MODE_AF, Core::Kernel::MODE_BF, Core::Kernel::MODE_UTF8, Core::Kernel::PATTERN_FIND_1, Core::Kernel::PATTERN_FIND_2_1, Core::Kernel::PATTERN_FIND_2_2, Core::Kernel::PATTERN_FIND_2_3, Core::Kernel::PATTERN_FIND_3_1, Core::Kernel::PATTERN_FIND_3_2, Core::Kernel::PATTERN_FIND_3_3, Core::Kernel::PATTERN_FIND_4, Core::Kernel::PATTERN_FIND_5, Core::Kernel::QO_2, Core::Kernel::QO_3, Core::Kernel::SEARCH_CX_1, Core::Kernel::SEARCH_CX_2, Core::Kernel::SEARCH_CX_3, Core::Kernel::SEARCH_CX_4, Core::Kernel::SEARCH_CX_5, Core::Kernel::SEARCH_CX_6, Core::Kernel::SET_ATTR_1, Core::Kernel::SET_CX_1, Core::Kernel::SET_CX_2, Core::Kernel::SET_CX_3, Core::Kernel::SET_CX_4, Core::Kernel::SET_MONO_1, Core::Kernel::SPACE, Core::Kernel::TAG_CLOSE, Core::Kernel::TAG_CLOSE3, Core::Kernel::TAG_OPEN, Core::Kernel::TAG_OPEN3, Core::Kernel::TAG_SEARCH_1_1, Core::Kernel::TAG_SEARCH_1_2, Core::Kernel::TAG_SEARCH_1_3, Core::Kernel::TAG_SEARCH_1_4, Core::Kernel::TAG_SEARCH_1_4_2, Core::Kernel::TAG_SEARCH_2_1, Core::Kernel::TAG_SEARCH_2_1_2, Core::Kernel::TAG_SEARCH_2_2, Core::Kernel::TAG_SEARCH_2_2_2, Core::Kernel::TAG_SEARCH_2_3, Core::Kernel::TAG_SEARCH_2_3_2, Core::Kernel::TAG_SEARCH_2_3_2_2, Core::Kernel::TAG_SEARCH_2_4, Core::Kernel::TAG_SEARCH_2_4_2, Core::Kernel::TAG_SEARCH_2_4_2_2, Core::Kernel::TAG_SEARCH_2_4_2_3, Core::Kernel::TAG_SEARCH_2_4_3, Core::Kernel::TAG_SEARCH_2_4_3_2, Core::Kernel::TAG_SEARCH_2_4_4, Core::Kernel::TAG_SEARCH_2_6, Core::Kernel::TAG_SEARCH_2_7, Core::Kernel::TAG_SEARCH_3_1, Core::Kernel::TAG_SEARCH_3_1_2, Core::Kernel::TAG_SEARCH_3_1_2_2, Core::Kernel::TAG_SEARCH_3_2, Core::Kernel::TAG_SEARCH_3_2_2, Core::Kernel::TAG_SEARCH_3_2_2_2, Core::Kernel::TAG_SEARCH_4_1, Core::Kernel::TAG_SEARCH_4_2, Core::Kernel::TAG_SEARCH_4_3, Core::Kernel::TAG_SEARCH_4_4, Core::Kernel::TAG_SEARCH_4_5, Core::Kernel::TAG_SEARCH_4_6, Core::Kernel::TAG_SEARCH_4_7, Core::Kernel::TAG_SEARCH_4_7_2, Core::Kernel::TAG_SEARCH_NC_1_1, Core::Kernel::TAG_SEARCH_NC_1_2, Core::Kernel::TAG_SEARCH_NC_1_3, Core::Kernel::TAG_SEARCH_NC_1_4, Core::Kernel::TAG_SEARCH_NC_1_4_2, Core::Kernel::TAG_SEARCH_NC_2_1, Core::Kernel::TAG_SEARCH_NC_2_1_2, Core::Kernel::TAG_SEARCH_NC_2_2, Core::Kernel::TAG_SEARCH_NC_2_2_2, Core::Kernel::TAG_SEARCH_NC_2_3, Core::Kernel::TAG_SEARCH_NC_2_3_2, Core::Kernel::TAG_SEARCH_NC_2_3_2_2, Core::Kernel::TAG_SEARCH_NC_2_4, Core::Kernel::TAG_SEARCH_NC_2_4_2, Core::Kernel::TAG_SEARCH_NC_2_4_2_2, Core::Kernel::TAG_SEARCH_NC_2_4_2_3, Core::Kernel::TAG_SEARCH_NC_2_4_3, Core::Kernel::TAG_SEARCH_NC_2_4_3_2, Core::Kernel::TAG_SEARCH_NC_2_4_4, Core::Kernel::TAG_SEARCH_NC_2_6, Core::Kernel::TAG_SEARCH_NC_2_7, Core::Kernel::TAG_SEARCH_NC_3_1, Core::Kernel::TAG_SEARCH_NC_3_1_2, Core::Kernel::TAG_SEARCH_NC_3_1_2_2, Core::Kernel::TAG_SEARCH_NC_3_2, Core::Kernel::TAG_SEARCH_NC_3_2_2, Core::Kernel::TAG_SEARCH_NC_3_2_2_2

Constants inherited from Parser

Parser::HTML, Parser::HTML5, Parser::XHTML, Parser::XHTML5, Parser::XML

Instance Attribute Summary

Attributes inherited from Core::Kernel

#doc_type, #document_hook, #element_cache, #element_hook

Instance Method Summary collapse

Methods inherited from Meteor::Ml::Html::ParserImpl

#content_type, #parse

Methods inherited from Core::Kernel

#attr, #attr_map, #attrs, #character_encoding, #character_encoding=, #content, #cxtag, #document, #document=, #element, #elements, #elements_, #find, #flush, #parse, #read, #remove_element, #root_element, #shadow

Constructor Details

#initializeParserImpl #initialize(ps) ⇒ ParserImpl

initializer (イニシャライザ)


5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
# File 'lib/meteor.rb', line 5125

def initialize(*args)
  super()
  @@match_tag = MATCH_TAG
  @@match_tag_sng = MATCH_TAG_SNG
  @@attr_logic = ATTR_LOGIC
  @doc_type = Parser::HTML5
  case args.length
    when ZERO
      #initialize_0
    when ONE
      initialize_1(args[0])
    else
      raise ArgumentError
  end
end