{Scanner} - Creates a scanner object.
: javascript { const scanner = new Scanner(new Source('var x = 12;')); }
The source column number
The information about the Scanner
The source line number
The options
The source position number
The range in the source.
The source object
The history stack
The tokens stack
{ignoreWhiteSpace} - Ignores the whitespaces in the source.
{isEOF} - Determines whether the current character is the end of file.
{location} - Marks the locations.
: javascript { //... scanner.scan(ch => { this.location().start(); //... this.location().end(); }); }
{ { start: () => void, end: () => Range, eof: () => Range } } - The location helpers.
{pop} - Pops the previous charater and location from the history stack.
{push} - Pushes the current charater and location into the history stack.
{raise} - Adds an error message into the errors stack.
{scan} - Calls the tokenizer as it scans through the source.
: javascript { let scanner = new Scanner(new Source('...')); scanner.scan(function(ch) { //... }); }
Generated using TypeDoc
{Scanner} - Creates a scanner object.