Class: Jaspion::Kilza::Objc

Inherits:
Object
  • Object
show all
Includes:
Language
Defined in:
lib/jaspion/kilza/language/objc.rb,
lib/jaspion/kilza/language/objc/class.rb,
lib/jaspion/kilza/language/objc/property.rb

Overview

Objective-C Language parser

Defined Under Namespace

Classes: Class, Property

Constant Summary collapse

RESERVED_PROPERTY_PREFIX =
'_'
RESERVED_CLASS_POSFIX =
'Class'
RESERVED_WORDS =
%w(
  auto break case char const continue,
  class default do double else enum extern float for,
  goto if id implementation inline int interface long,
  new nonatomic property protocol readonly readwrite register,
  restrict retain return short signed sizeof static strong,
  struct switch typedef union unsafe_unretained unsigned void,
  volatile weak while _bool _complex _imaginary sel imp,
  bool nil yes no self super __strong __weak oneway,
  in out inout bycopy byref description
)
TYPES =
{
  'nilclass'    => 'id',
  'string'      => 'NSString *',
  'fixnum'      => 'NSNumber *',
  'float'       => 'NSNumber *',
  'falseclass'  => 'NSNumber *',
  'trueclass'   => 'NSNumber *',
  'hash'        => 'NSObject *'
}

Instance Attribute Summary

Attributes included from Language

#base_name, #classes, #equal_keys, #json_string, #reserved_words, #types

Instance Method Summary collapse

Constructor Details

#initialize(json_string) ⇒ Objc

Returns a new instance of Objc.



32
33
34
35
36
# File 'lib/jaspion/kilza/language/objc.rb', line 32

def initialize(json_string)
  super(json_string)

  @equal_keys = %w(id identifier uid)
end

Instance Method Details

#clazz(name) ⇒ Object



38
39
40
# File 'lib/jaspion/kilza/language/objc.rb', line 38

def clazz(name)
  Jaspion::Kilza::Objc::Class.new(name)
end

#property(name, type, array, key) ⇒ Object



42
43
44
# File 'lib/jaspion/kilza/language/objc.rb', line 42

def property(name, type, array, key)
  Jaspion::Kilza::Objc::Property.new(name , type, array, key)
end