[][src]Struct clang::Parser

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

Parses translation units.

Implementations

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.

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

Sets whether processing will continue after a fatal error is encountered.

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

Sets whether incremental processing will be used.

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

Sets whether function bodies will only be skipped in the preamble.

Used in conjunction with skip_function_bodies.

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

Sets whether attributed types should be included.

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

Sets whether implicit attributes should be visited.

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

Indicates that non-errors (e.g. warnings) from included files should be ignored.

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

Sets whether the preprocessor will retain excluded conditional blocks.

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]

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

Auto Trait Implementations

impl<'tu> RefUnwindSafe for Parser<'tu>

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

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

impl<'tu> Unpin for Parser<'tu>

impl<'tu> UnwindSafe for Parser<'tu>

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.