Class: BitClust::RDCompiler

Inherits:
Object show all
Includes:
HTMLUtils, TextUtils
Defined in:
lib/bitclust/rdcompiler.rb

Overview

Compiles doc into HTML.

Constant Summary

Constants included from TextUtils

TextUtils::INDENT_RE

Constants included from NameUtils

NameUtils::CHAR_TO_MARK, NameUtils::CHAR_TO_NAME, NameUtils::CLASS_NAME_RE, NameUtils::CLASS_PATH_RE, NameUtils::CONST_PATH_RE, NameUtils::CONST_RE, NameUtils::GVAR_RE, NameUtils::LIBNAME_RE, NameUtils::MARK_TO_CHAR, NameUtils::MARK_TO_NAME, NameUtils::METHOD_NAME_RE, NameUtils::METHOD_SPEC_RE, NameUtils::MID, NameUtils::NAME_TO_CHAR, NameUtils::NAME_TO_MARK, NameUtils::TYPEMARK_RE

Instance Method Summary collapse

Methods included from TextUtils

detab, n_indent, n_minimum_indent, unindent, unindent_block

Methods included from NameUtils

build_method_id, classid2name, classname2id, classname?, decodeid, decodename_fs, decodename_url, encodeid, encodename_fs, encodename_rdocurl, encodename_url, functionname?, gvarname?, html_filename, libid2name, libname2id, libname?, method_spec?, methodid2classid, methodid2libid, methodid2mname, methodid2specparts, methodid2specstring, methodid2typechar, methodid2typemark, methodid2typename, methodname?, split_method_id, split_method_spec, typechar2mark, typechar2name, typechar?, typemark2char, typemark2name, typemark?, typename2char, typename2mark, typename?

Constructor Details

#initialize(urlmapper, hlevel = 1, opt = {}) ⇒ RDCompiler

Returns a new instance of RDCompiler.


24
25
26
27
28
29
30
31
32
33
# File 'lib/bitclust/rdcompiler.rb', line 24

def initialize(urlmapper, hlevel = 1, opt = {})
  @urlmapper = urlmapper
  @catalog = opt[:catalog]
  @hlevel = hlevel
  @type = nil
  @library = nil
  @class = nil
  @method = nil
  @option = opt.dup
end

Instance Method Details

#compile(src) ⇒ Object


35
36
37
38
39
# File 'lib/bitclust/rdcompiler.rb', line 35

def compile(src)
  setup(src) {
    library_file
  }
end

#compile_function(f, opt = nil) ⇒ Object


41
42
43
44
45
46
47
48
49
# File 'lib/bitclust/rdcompiler.rb', line 41

def compile_function(f, opt = nil)
  @opt = opt
  @type = :function
  setup(f.source) {
    entry
  }
ensure
  @opt = nil
end

#compile_method(m, opt = nil) ⇒ Object

FIXME


52
53
54
55
56
57
58
59
60
61
# File 'lib/bitclust/rdcompiler.rb', line 52

def compile_method(m, opt = nil)
  @opt = opt
  @type = :method
  @method = m
  setup(m.source) {
    entry
  }
ensure
  @opt = nil
end