Struct webidl_parser::Parser [] [src]

pub struct Parser;

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

Methods

impl Parser
[src]

Parses a given input string and returns an AST.

Example

use webidl_parser::*;
use webidl_parser::ast::*;

let result = Parser::parse_string("[Attribute] interface Node { };");

assert_eq!(result,
           Ok(vec![Definition {
                definition_type: DefinitionType::Interface(Interface {
                    members: vec![],
                    name: "Node".to_string(),
                    type_:
                        InterfaceType::NonPartial(None),
                }),
                extended_attributes: vec![
                    Box::new(ExtendedAttribute::Other {
                        other: Other::Identifier("Attribute".to_string()),
                        rest: None,
                    })],
           }]));

Trait Implementations

impl Clone for Parser
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Parser
[src]

impl Debug for Parser
[src]

Formats the value using the given formatter.

impl Eq for Parser
[src]

impl Hash for Parser
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl PartialEq for Parser
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.