Crate webidl_parser [] [src]

Contains a lexer for lexing the WebIDL grammar.

Modules

ast

Contains all structures related to the AST for the WebIDL grammar.

Structs

Lexer

The lexer that is used to perform lexical analysis on the WebIDL grammar. The lexer implements the Iterator trait, so in order to retrieve the tokens, you simply have to iterate over it.

LexicalError

The error that is returned when an error occurs during lexing.

Parser

The parser that is used to parse WebIDL. It really serves as a wrapper around the parse function exposed by lalrpop.

Enums

LexicalErrorCode

An enum of possible errors that can occur during lexing.

Token

An enum of all possible tokens allowed by the WebIDL grammar A token in this case is a terminal, either a static string or regular expression based token. Note that not all possible simplifications are made such as converting the True and False tokens to actual booleans. This choice was made to be as consistent as possible with the WebIDL grammar.

Type Definitions

ParseResult

The result that is returned when an input string is parsed. If the parse succeeds, the Ok result will be a vector of definitions representing the AST. If the parse fails, the Err will be either an error from the lexer or the parser.