Class: Antlr4Native::ContextMethodArg

Inherits:
Object
  • Object
show all
Defined in:
lib/antlr4-native/context_method_arg.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_arg) ⇒ ContextMethodArg

Returns a new instance of ContextMethodArg.


5
6
7
# File 'lib/antlr4-native/context_method_arg.rb', line 5

def initialize(raw_arg)
  @raw_arg = raw_arg
end

Instance Attribute Details

#raw_argObject (readonly)

Returns the value of attribute raw_arg.


3
4
5
# File 'lib/antlr4-native/context_method_arg.rb', line 3

def raw_arg
  @raw_arg
end

Instance Method Details

#nameObject


9
10
11
# File 'lib/antlr4-native/context_method_arg.rb', line 9

def name
  @name ||= parts[1]
end

#pointer?Boolean

Returns:

  • (Boolean)

17
18
19
# File 'lib/antlr4-native/context_method_arg.rb', line 17

def pointer?
  type.end_with?('*')
end

#typeObject


13
14
15
# File 'lib/antlr4-native/context_method_arg.rb', line 13

def type
  @type ||= parts[0].gsub(' ', '')
end