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

Module mscanner

Scanner (tokenizer) for m. This is an m port of the original C++ scanner. Sample usage:
  scanner=mscanner.Scanner("script.m");
  while true do
    case scanner.next()
    in mscanner.IDENTIFIER:
      // scanner.value contains identifier
    in mscanner.NUMBER:
      // scanner.value contains number
    in ".":
      // read single dot
    in "<=":
      // read less than or equal
    ...
    null: // EOF
      break;
    end
  end;
  scanner.close()
  

Classes

Scanner The scanner implementation.

Constants

const COMMENT The symbol is a comment, value contains it.
const ERROR The symbol has an error, value contains the details.
const IDENTIFIER The symbol is an identifier, value contains it.
const LINE_COMMENT The symbol is a line comment, value contains it.
const MAX_IDENT_LENGTH The maximum length of an identifier.
const MAX_STRING_LENGTH The maximum length of a string.
const MODULEEXT The extension of an m module.
const NUMBER The symbol is a number, value contains it.
const SCRIPTEXT The extension of an m script.
const STRING The symbol is a string, value contains it.
mShell Home  > Documentation  > mdoc