Class | REXML::DTD::NotationDecl |
In: |
lib/rexml/dtd/notationdecl.rb
|
Parent: | Child |
START | = | "<!NOTATION" |
START_RE | = | /^\s*#{START}/um |
PUBLIC | = | /^\s*#{START}\s+(\w[\w-]*)\s+(PUBLIC)\s+((["']).*?\4)\s*>/um |
SYSTEM | = | /^\s*#{START}\s+(\w[\w-]*)\s+(SYSTEM)\s+((["']).*?\4)\s*>/um |
# File lib/rexml/dtd/notationdecl.rb, line 9 9: def initialize src 10: super() 11: if src.match( PUBLIC ) 12: md = src.match( PUBLIC, true ) 13: elsif src.match( SYSTEM ) 14: md = src.match( SYSTEM, true ) 15: else 16: raise ParseException.new( "error parsing notation: no matching pattern", src ) 17: end 18: @name = md[1] 19: @middle = md[2] 20: @rest = md[3] 21: end
# File lib/rexml/dtd/notationdecl.rb, line 32 32: def NotationDecl.parse_source source, listener 33: md = source.match( PATTERN_RE, true ) 34: thing = md[0].squeeze(" \t\n\r") 35: listener.send inspect.downcase, thing 36: end
# File lib/rexml/dtd/notationdecl.rb, line 23 23: def to_s 24: "<!NOTATION #@name #@middle #@rest>" 25: end