
CPU::Z80::Assembler::Token - One token retrieved from the input

use CPU::Z80::Assembler::Token;
my $token = CPU::Z80::Assembler::Token->new(
type => $type,
value => $value,
line => CPU::Z80::Assembler::Line->new(...));
my $token2 = $token->clone;
$token->error($message);
CPU::Z80::Assembler::Token->error_at($token, $message);
$token->warning($message);
CPU::Z80::Assembler::Token->warning_at($token, $message);

This module defines the data structure to represent one token of input text to be assembled, as retrived by the lexer. The object is created by Class::Struct and contains the token type and value, and the input line where it was found in the input. The input line is used for error messages.

Nothing.

Creates a new object, see Class::Struct.
Get/set the type - type of token.
Get/set the value - value of token.
Get/set the line - text, file name and line number where the token was read.
Creates an identical copy as a new object.
print $self->as_string; print "$self";
Converts to string, for debug purposes. Overloads the double-quote operator.
Dies with the given error message, indicating the place in the input source file where the error occured as "FILE(LINE) : error ... at TOKEN".
Same as error(), but is a class method and can receive an undef $token.
Warns with the given error message, indicating the place in the input source file where the error occured as "FILE(LINE) : warning ... at TOKEN".
Same as warning(), but is a class method and can receive an undef $token.

See CPU::Z80::Assembler.

CPU::Z80::Assembler CPU::Z80::Assembler::Line Class::Struct

See CPU::Z80::Assembler.