AtteanX::API::Lexer3pm
Role defining common functionality for lexers.
Version
This document describes AtteanX::API::Lexer version 0.035
Overview
The AtteanX::API::Lexer role provides a common interface and implementation for lexer implementations, allowing line-based buffer filling, and consuming of characters, constant strings, and fixed-length buffers.
Attributes
- "file"
- "linebuffer"
- "line"
- "column"
- "buffer"
- "start_column"
- "start_line"
Methods
- "fill_buffer"
-
Fills the buffer with a new line from the underlying filehandle.
- "check_for_bom"
-
Remove a BOM character if one appears at the start of the buffer.
- get_char_safe( $char )
-
Consume the single character
$charfrom the buffer. Throw an error if$charis not at the start of the buffer.
- get_char( $char )
-
Consume and return a single character from the buffer.
- peek_char( $char )
-
Return a single character from the start of the buffer.
- read_word( $word )
-
Consume the string
$wordfrom the start of the buffer. Throw an error if$wordis not at the start of the buffer.
- read_length( $length )
-
Consume and return
$lengthcharacters from the start of the buffer.
Releases
5 releases since Debian 9 (Stretch); the text changed 4 times.