Class GNUMakefileParser::MkVariable
In: gnumakefileparser.rb
Parent: Object

下記のように記述される変数定義.

    objects = main.o command.o display.o    #              insert.o search.o

Methods

new   to_s  

Public Class methods

引数 var_rules に上記の書式の文字列を与えることで, それぞれ @var, @value, が設定される.

[Source]

     # File gnumakefileparser.rb, line 199
199:     def initialize(var_rules)
200:       if var_rules =~ /^\s*(\w+)\s*(:?)(\??)\=\s*(.*)\s*$/
201:         @var = $1
202:         @simply_expanded = $2
203:         @conditional = $3
204:         value = $4
205:         @value = value.gsub(/[\t ]+/, ' ')
206:       else
207:         raise "Syntax Error"
208:       end
209:     end

Public Instance methods

オブジェクトの内容を Makefile 用のテキストに変換.

[Source]

     # File gnumakefileparser.rb, line 214
214:     def to_s
215:       return @var + ' ' + @simply_expanded + @conditional + '= ' + @value + "\n"
216:     end

[Validate]