The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

CPU::Z80::Assembler::Line - One line of text retrieved from the input

SYNOPSIS

  use CPU::Z80::Assembler::Line;
  my $line1 = CPU::Z80::Assembler::Line->new(
                  text    => $text,
                  line_nr => $line_nr,
                  file    => $file );
  my $line2 = $line->clone;
  if ($line1 == $line2) {...}
  if ($line1 != $line2) {...}
  $line1->error($message);
  $line2->warning($message);

DESCRIPTION

This module defines the data structure to represent one line of input text to be assembled. The object is created by Class::Struct and contains the actual text from the line and the file name and line number where the text was retrieved. This information is used for error messages.

EXPORTS

Nothing.

FUNCTIONS

new

Creates a new object, see Class::Struct.

text

Get/set the text - text read from the file.

line_nr

Get/set the line_nr - line where text was read from.

file

Get/set the file - name of the file where the text was read from.

clone

Creates an identical copy as a new object.

as_string

  print $self->as_string;
  print "$self";

Converts to string, for debug purposes. Overloads the double-quote operator.

is_equal

  if ($self == $other) { ... }

Compares two line objects. Overloads the '==' operator.

is_different

  if ($self != $other) { ... }

Compares two line objects. Overloads the '!=' operator.

error

Dies with the given error message, indicating the place in the input source file where the error occured as "FILE(LINE) : error ...".

warning

Warns with the given error message, indicating the place in the input source file where the error occured as "FILE(LINE) : warning ...".

BUGS and FEEDBACK

See CPU::Z80::Assembler.

SEE ALSO

CPU::Z80::Assembler Class::Struct

AUTHORS, COPYRIGHT and LICENCE

See CPU::Z80::Assembler.