[][src]Struct clang::Parser

pub struct Parser<'tu> { /* fields omitted */ }

Parses translation units.

Methods

impl<'tu> Parser<'tu>[src]

pub fn cache_completion_results(
    &mut self,
    cache_completion_results: bool
) -> &mut Parser<'tu>
[src]

Sets whether certain code completion results will be cached when the translation unit is reparsed.

This option increases the time it takes to reparse the translation unit but improves code completion performance.

pub fn detailed_preprocessing_record(
    &mut self,
    detailed_preprocessing_record: bool
) -> &mut Parser<'tu>
[src]

Sets whether a detailed preprocessing record will be constructed which tracks all macro definitions and instantiations.

pub fn briefs_in_completion_results(
    &mut self,
    briefs_in_completion_results: bool
) -> &mut Parser<'tu>
[src]

Sets whether documentation comment briefs will be included in code completion results.

pub fn incomplete(&mut self, incomplete: bool) -> &mut Parser<'tu>[src]

Sets whether the translation unit will be considered incomplete.

This option suppresses certain semantic analyses and is typically used when parsing headers with the intent of creating a precompiled header.

pub fn skip_function_bodies(
    &mut self,
    skip_function_bodies: bool
) -> &mut Parser<'tu>
[src]

Sets whether function and method bodies will be skipped.

impl<'tu> Parser<'tu>[src]

pub fn arguments<S: AsRef<str>>(&mut self, arguments: &[S]) -> &mut Parser<'tu>[src]

Sets the compiler arguments to provide to libclang.

Any compiler argument that could be supplied to clang may be supplied to this function. However, the following arguments are ignored:

  • -c
  • -emit-ast
  • -fsyntax-only
  • -o and the following <output>

pub fn unsaved(&mut self, unsaved: &[Unsaved]) -> &mut Parser<'tu>[src]

Sets the unsaved files to use.

pub fn parse(&self) -> Result<TranslationUnit<'tu>, SourceError>[src]

Parses a translation unit.

Failures

  • an error occurs while deserializing an AST file
  • libclang crashes
  • an unknown error occurs

Trait Implementations

impl<'tu> Clone for Parser<'tu>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'tu> Debug for Parser<'tu>[src]

Auto Trait Implementations

impl<'tu> !Send for Parser<'tu>

impl<'tu> !Sync for Parser<'tu>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.