Class: GrammarSymbol
Instance Attribute Summary collapse
Attributes inherited from Element
#sub_elements, #tree_specification
Instance Method Summary
collapse
Methods inherited from Element
#normalize
as_code, as_method_named, as_module_method_named, #create_new, indent_lines, name_hash, #new_of_my_type, #parameter_named, #to_compact_src, #to_src_in_module, #type_to_src
Constructor Details
Returns a new instance of GrammarSymbol.
318
319
320
321
|
# File 'lib/rpdf2txt-rockit/grammar.rb', line 318
def initialize(name)
super(nil, nil) @name = name.to_s
end
|
Instance Attribute Details
Returns the value of attribute name.
317
318
319
|
# File 'lib/rpdf2txt-rockit/grammar.rb', line 317
def name
@name
end
|
Instance Method Details
#==(other) ⇒ Object
323
324
325
326
327
|
# File 'lib/rpdf2txt-rockit/grammar.rb', line 323
def ==(other)
res = other.kind_of?(GrammarSymbol) and name == other.name
end
|
#eql?(other) ⇒ Boolean
333
334
335
|
# File 'lib/rpdf2txt-rockit/grammar.rb', line 333
def eql?(other)
other.hash == hash
end
|
329
330
331
|
# File 'lib/rpdf2txt-rockit/grammar.rb', line 329
def hash
name.hash
end
|
337
338
339
|
# File 'lib/rpdf2txt-rockit/grammar.rb', line 337
def inspect
name
end
|
#to_src(assignToName = nil, nameHash = {}) ⇒ Object
341
342
343
|
# File 'lib/rpdf2txt-rockit/grammar.rb', line 341
def to_src(assignToName = nil, nameHash = {})
assign_to(assignToName, new_of_my_type(name))
end
|