node/lib/metasm/metasm/parse_c.rb
def numeric_constants
			ret = []
			# macros
			@lexer.definition.each_key { |k|
				if v = macro_numeric(k)
					ret << [k, v]
				end
			}
			# enums
			seen_enum = {}
			@toplevel.struct.each { |k, v|
				if v.kind_of?(Enum)
					v.members.each { |kk, vv|
						ret << [kk, vv, k]
						seen_enum[kk] = true
					}
				end
			}
			@toplevel.symbol.each { |k, v|
				ret << [k, v] if v.kind_of?(::Numeric) and not seen_enum[k]
			}
			ret
		end
# returns all numeric constants defined with their value, either macros or enums
# for enums, also return the enum name
returns all numeric constants defined with their value, either macros or enums
for enums, also return the enum name
returns all numeric constants defined with their value either macros or enums for enums also return the enum name
def numeric_constants
			ret = []
			@lexer.definition.each_key { |k|
				if v = macro_numeric(k)
					ret << [k, v]
				end
			}
			seen_enum = {}
			@toplevel.struct.each { |k, v|
				if v.kind_of?(Enum)
					v.members.each { |kk, vv|
						ret << [kk, vv, k]
						seen_enum[kk] = true
					}
				end
			}
			@toplevel.symbol.each { |k, v|
				ret << [k, v] if v.kind_of?(::Numeric) and not seen_enum[k]
			}
			ret
		end
def numeric_constants ret = [ ] @lexer . definition . each_key { | k | if v = macro_numeric ( k ) ret << [ k , v ] end } seen_enum = { } @toplevel . struct . each { | k , v | if v . kind_of? ( Enum ) v . members . each { | kk , vv | ret << [ kk , vv , k ] seen_enum [ kk ] = true } end } @toplevel . symbol . each { | k , v | ret << [ k , v ] if v . kind_of? ( :: Numeric ) and not seen_enum [ k ] } ret end
returns all numeric constants defined with their value, either macros or enums
for enums, also return the enum name
returns all numeric constants defined with their value either macros or enums for enums also return the enum name
# macros # enums