Websites Navigation: Airbit | Shop | m-shell.net
Languages: EN | DE

Class mscanner.Scanner

The scanner implementation.

Constructor

function init(nameOrStream, ces=io.bom)
Constructor.
Parameters:
nameOrStream – the name of a source file to read, or a stream to read characters from.
ces – the character encoding scheme to use if nameOrStream denotes a file name.

Fields

ch The current (next) character.
chLine The line of ch.
chPos The position of ch.
skipComment Comments are skipped if set to true.
stream The stream characters are read from.
sym The symbol (always a string). This is either the symbol itself, or a special symbol (COMMENT, LINE_COMMENT, IDENTIFIER, STRING, NUMBER, ERROR). null indicates end of file.
symLine The line of the symbol.
symPos The position of the symbol.
value The value of the symbol (i.e. the comment, identifier, string or number).

Functions

close() Close the underlying stream.
next() Read the next symbol into sym and value.
function close()
Close the underlying stream.
function next()
Read the next symbol into sym and value.
Returns:the symbol (sym).
mShell Home  > Documentation  > mdoc