Class: IdlParser

Inherits:
Treetop::Runtime::CompiledParser
  • Object
show all
Includes:
Idl
Defined in:
lib/idlc.rb,
lib/idlc/idl_parser.rb

Constant Summary

Constants included from Idl

Idl::BasicValueRbType, Idl::Bits1Type, Idl::Bits32Type, Idl::Bits64Type, Idl::BitsUnknownType, Idl::BoolType, Idl::ConstBitsUnknownType, Idl::ConstBoolType, Idl::EMPTY_ARRAY, Idl::ExecutableAst, Idl::RvalueAst, Idl::StringType, Idl::TypeNameAst, Idl::ValueRbType, Idl::VoidType

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Idl

#_nt_ary_access, #_nt_ary_eligible_expression, #_nt_ary_size_decl, #_nt_assignment, #_nt_bitfield_definition, #_nt_body_function_definition, #_nt_builtin_function_definition, #_nt_comment, #_nt_concatenation_expression, #_nt_constraint_body, #_nt_csr_field_access_expression, #_nt_csr_field_name, #_nt_csr_name, #_nt_csr_register_access_expression, #_nt_declaration, #_nt_dollar_arg_list, #_nt_dollar_function_call, #_nt_dollar_variable, #_nt_dontcare_lvalue, #_nt_dontcare_return, #_nt_enum_definition, #_nt_enum_ref, #_nt_execute_if_block, #_nt_expression, #_nt_fetch, #_nt_field_access_eligible_expression, #_nt_field_access_expression, #_nt_field_name, #_nt_for_loop, #_nt_for_loop_iteration_variable_declaration, #_nt_function_arg_list, #_nt_function_body, #_nt_function_call, #_nt_function_definition, #_nt_function_if_block, #_nt_function_name, #_nt_function_statement, #_nt_global_definition, #_nt_id, #_nt_implication_expression, #_nt_implication_for_loop, #_nt_implication_statement, #_nt_include_statement, #_nt_instruction_operation, #_nt_int, #_nt_isa, #_nt_p0_binary_expression, #_nt_p0_binary_operator, #_nt_p1_binary_expression, #_nt_p1_binary_operator, #_nt_p2_binary_expression, #_nt_p2_binary_operator, #_nt_p3_binary_expression, #_nt_p3_binary_operator, #_nt_p3_template_binary_operator, #_nt_p4_binary_expression, #_nt_p4_binary_operator, #_nt_p5_binary_expression, #_nt_p5_binary_operator, #_nt_p6_binary_expression, #_nt_p6_binary_operator, #_nt_p7_binary_expression, #_nt_p7_binary_operator, #_nt_p8_binary_expression, #_nt_p8_binary_operator, #_nt_p9_binary_expression, #_nt_p9_binary_operator, #_nt_paren_expression, #_nt_post_dec, #_nt_post_inc, #_nt_replication_expression, #_nt_return_expression, #_nt_return_statement, #_nt_rval, #_nt_single_declaration, #_nt_single_declaration_with_initialization, #_nt_space, #_nt_statement, #_nt_string, #_nt_struct_definition, #_nt_template_safe_expression, #_nt_template_safe_p3_binary_expression, #_nt_template_safe_p4_binary_expression, #_nt_template_safe_p5_binary_expression, #_nt_template_safe_p6_binary_expression, #_nt_template_safe_p7_binary_expression, #_nt_template_safe_p8_binary_expression, #_nt_template_safe_p9_binary_expression, #_nt_template_safe_ternary_expression, #_nt_ternary_expression, #_nt_type_name, #_nt_unary_expression, #_nt_unary_operator, #_nt_var_write, #_nt_version_string, logger, #root, set_logger

Instance Attribute Details

#input_fileObject (readonly)

Returns the value of attribute input_file.



14
15
16
# File 'lib/idlc.rb', line 14

def input_file
  @input_file
end

Instance Method Details

#idlc_instantiate_nodeObject

alias instantiate_node so we can call it from the override



24
# File 'lib/idlc.rb', line 24

alias idlc_instantiate_node instantiate_node

#instantiate_node(node_type, *args) ⇒ Object

override instatiate_node so we can set the input file



27
28
29
30
31
# File 'lib/idlc.rb', line 27

def instantiate_node(node_type, *args)
  node = T.unsafe(self).idlc_instantiate_node(node_type, *args)
  node.set_input_file(input_file, @starting_line.nil? ? 0 : @starting_line, @starting_offset.nil? ? 0 : @starting_offset, @line_file_offsets)
  node
end

#set_input_file(filename, starting_line = 0, starting_offset = 0, line_file_offsets = nil) ⇒ Object



16
17
18
19
20
21
# File 'lib/idlc.rb', line 16

def set_input_file(filename, starting_line = 0, starting_offset = 0, line_file_offsets = nil)
  @input_file = filename
  @starting_line = starting_line
  @starting_offset = starting_offset
  @line_file_offsets = line_file_offsets
end