-
Notifications
You must be signed in to change notification settings - Fork 24
Scanner class
Ron Buckton edited this page Jun 23, 2015
·
3 revisions
export declare class Scanner {
constructor(filename: string, text: string, diagnostics: DiagnosticMessages);
public getPos(): number;
public getLen(): number;
public getStartPos(): number;
public getTokenPos(): number;
public getToken(): SyntaxKind;
public getTokenValue(): string;
public getDiagnostics(): DiagnosticMessages;
public scan(): SyntaxKind;
public speculate<T>(callback: () => T, isLookahead: boolean): T;
}
import { Scanner } from "grammarkdown";
let scanner = new Scanner(filename, source, diagnostics);
- new Scanner(String, String, DiagnosticMessages)
- Creates a new instance of the Scanner class
- getPos()
- Gets the current position in the source text.
- getLen()
- Gets the length of the source text.
- getStartPos()
- Gets the starting position of the current scan.
- getTokenPos()
- Gets the starting position of the current token.
- getToken()
- Gets the current token.
- getTokenValue()
- Gets the current token value.
- getDiagnostics()
- Gets the diagnostics for the scanner.
- scan()
- Scans the next token.
- speculate(Function, Boolean)
- Speculatively scans one or more tokens.
- Supported Platforms: nodejs, iojs
- Module: grammarkdown