Class: Rubex::AST::Statement::Base
- Inherits:
-
Object
- Object
- Rubex::AST::Statement::Base
- Includes:
- Helpers::NodeTypeMethods
- Defined in:
- lib/rubex/ast/statement.rb
Direct Known Subclasses
Alias, ArgumentList, Assign, Rubex::AST::Statement::BeginBlock::Base, Break, CArrayDecl, CBaseType, CFunctionDecl, CPtrDecl, CStructOrUnionDef, Expression, For, ForwardDecl, IfBlock, IfBlock::Else, IfBlock::Elsif, NoGilBlock, Return, VarDecl, While
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
File name and line number of statement in “file_name:lineno” format.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #generate_code(code, _local_scope) ⇒ Object
-
#initialize(location) ⇒ Base
constructor
A new instance of Base.
- #statement? ⇒ Boolean
Constructor Details
#initialize(location) ⇒ Base
Returns a new instance of Base.
12 13 14 |
# File 'lib/rubex/ast/statement.rb', line 12 def initialize(location) @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
File name and line number of statement in “file_name:lineno” format.
10 11 12 |
# File 'lib/rubex/ast/statement.rb', line 10 def location @location end |
Instance Method Details
#==(other) ⇒ Object
20 21 22 |
# File 'lib/rubex/ast/statement.rb', line 20 def ==(other) self.class == other.class end |
#generate_code(code, _local_scope) ⇒ Object
24 25 26 |
# File 'lib/rubex/ast/statement.rb', line 24 def generate_code(code, _local_scope) code.write_location @location end |