Class: Racc::ParserFileGenerator::Params

Inherits:
Object
  • Object
show all
Defined in:
lib/racc/parserfilegenerator.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeParams

Returns a new instance of Params.



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/racc/parserfilegenerator.rb', line 51

def initialize
  # Parameters derived from parser
  self.filename = nil
  self.classname = nil
  self.superclass = 'Racc::Parser'
  self.omit_action_call = true
  self.result_var = true
  self.header = []
  self.inner  = []
  self.footer = []

  # Parameters derived from command line options
  self.debug_parser = false
  self.convert_line = true
  self.convert_line_all = false
  self.embed_runtime = false
  self.make_executable = false
  self.interpreter = nil
end

Instance Attribute Details

#classnameObject

Returns the value of attribute classname.



36
37
38
# File 'lib/racc/parserfilegenerator.rb', line 36

def classname
  @classname
end

#filenameObject

Returns the value of attribute filename.



35
36
37
# File 'lib/racc/parserfilegenerator.rb', line 35

def filename
  @filename
end

Returns the value of attribute footer.



42
43
44
# File 'lib/racc/parserfilegenerator.rb', line 42

def footer
  @footer
end

#headerObject

Returns the value of attribute header.



40
41
42
# File 'lib/racc/parserfilegenerator.rb', line 40

def header
  @header
end

#innerObject

Returns the value of attribute inner.



41
42
43
# File 'lib/racc/parserfilegenerator.rb', line 41

def inner
  @inner
end

#interpreterObject

Returns the value of attribute interpreter.



49
50
51
# File 'lib/racc/parserfilegenerator.rb', line 49

def interpreter
  @interpreter
end

#superclassObject

Returns the value of attribute superclass.



37
38
39
# File 'lib/racc/parserfilegenerator.rb', line 37

def superclass
  @superclass
end

Class Method Details

.bool_attr(name) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/racc/parserfilegenerator.rb', line 23

def self.bool_attr(name)
  module_eval(<<-End)
    def #{name}?
      @#{name}
    end

    def #{name}=(b)
      @#{name} = b
    end
  End
end