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]
fn parse_string(input: &str) -> ParseResult
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]
fn clone(&self) -> Parser
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy for Parser
[src]
impl Debug for Parser
[src]
impl Eq for Parser
[src]
impl Hash for Parser
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more