Skip to main content

AstFactory

Struct AstFactory 

Source
pub struct AstFactory {}

Implementations§

Source§

impl AstFactory

Source

pub fn create_empty_statement(location: SourceLocation, id: AstId) -> AstNode

Source

pub fn create_return_statement( condition: Option<AstNode>, location: SourceLocation, id: AstId, ) -> AstNode

Source

pub fn create_exit_statement(location: SourceLocation, id: AstId) -> AstNode

Source

pub fn create_continue_statement(location: SourceLocation, id: AstId) -> AstNode

Source

pub fn create_case_condition( result: AstNode, location: SourceLocation, id: AstId, ) -> AstNode

Source

pub fn create_vla_range_statement( location: SourceLocation, id: AstId, ) -> AstNode

Source

pub fn create_literal( kind: AstLiteral, location: SourceLocation, id: AstId, ) -> AstNode

Source

pub fn create_hardware_access( access: DirectAccessType, direction: HardwareAccessType, address: Vec<AstNode>, location: SourceLocation, id: usize, ) -> AstNode

Source

pub fn create_default_value(location: SourceLocation, id: AstId) -> AstNode

Source

pub fn create_expression_list( expressions: Vec<AstNode>, location: SourceLocation, id: AstId, ) -> AstNode

Source

pub fn create_paren_expression( expression: AstNode, location: SourceLocation, id: AstId, ) -> AstNode

Source

pub fn create_if_statement( stmt: IfStatement, location: SourceLocation, id: AstId, ) -> AstNode

creates a new if-statement

Source

pub fn create_for_loop( stmt: ForLoopStatement, location: SourceLocation, id: AstId, ) -> AstNode

creates a new for loop statement

Source

pub fn create_while_statement( stmt: LoopStatement, location: SourceLocation, id: AstId, ) -> AstNode

creates a new while statement

Source

pub fn create_repeat_statement( stmt: LoopStatement, location: SourceLocation, id: AstId, ) -> AstNode

creates a new repeat-statement

Source

pub fn create_case_statement( stmt: CaseStatement, location: SourceLocation, id: AstId, ) -> AstNode

creates a new case-statement

Source

pub fn create_or_expression(left: AstNode, right: AstNode) -> AstNode

creates an or-expression

Source

pub fn create_not_expression( operator: AstNode, location: SourceLocation, id: usize, ) -> AstNode

creates a not-expression

Source

pub fn create_identifier<T, U>(name: T, location: U, id: AstId) -> AstNode
where T: Into<String>, U: Into<SourceLocation>,

creates a new Identifier

Source

pub fn create_super_reference<T>( location: T, deref: Option<()>, id: AstId, ) -> AstNode
where T: Into<SourceLocation>,

Source

pub fn create_this_reference<T>(location: T, id: AstId) -> AstNode
where T: Into<SourceLocation>,

Source

pub fn create_unary_expression( operator: Operator, value: AstNode, location: SourceLocation, id: AstId, ) -> AstNode

Source

pub fn create_assignment(left: AstNode, right: AstNode, id: AstId) -> AstNode

Source

pub fn create_output_assignment( left: AstNode, right: AstNode, id: AstId, ) -> AstNode

Source

pub fn create_ref_assignment( left: AstNode, right: AstNode, id: AstId, ) -> AstNode

Source

pub fn create_member_reference( member: AstNode, base: Option<AstNode>, id: AstId, ) -> AstNode

Source

pub fn create_global_reference( id: AstId, member: AstNode, location: SourceLocation, ) -> AstNode

Source

pub fn create_index_reference( index: AstNode, base: Option<AstNode>, id: AstId, location: SourceLocation, ) -> AstNode

Source

pub fn create_address_of_reference( base: AstNode, id: AstId, location: SourceLocation, ) -> AstNode

Source

pub fn create_deref_reference( base: AstNode, id: AstId, location: SourceLocation, ) -> AstNode

Source

pub fn create_direct_access( access: DirectAccessType, index: AstNode, id: AstId, location: SourceLocation, ) -> AstNode

Source

pub fn create_binary_expression( left: AstNode, operator: Operator, right: AstNode, id: AstId, ) -> AstNode

creates a new binary statement

Source

pub fn create_cast_statement( type_name: AstNode, stmt: AstNode, location: &SourceLocation, id: AstId, ) -> AstNode

creates a new cast statement

Source

pub fn create_call_statement<T>( operator: AstNode, parameters: Option<AstNode>, id: usize, location: T, ) -> AstNode
where T: Into<SourceLocation>,

Source

pub fn create_call_to( function_name: String, parameters: Vec<AstNode>, id: usize, parameter_list_id: usize, location: &SourceLocation, ) -> AstNode

creates a new call statement to the given function and parameters

Source

pub fn create_multiplied_statement( multiplier: u32, element: AstNode, location: SourceLocation, id: AstId, ) -> AstNode

Source

pub fn create_range_statement( start: AstNode, end: AstNode, id: AstId, ) -> AstNode

Source

pub fn create_call_to_with_ids( function_name: &str, parameters: Vec<AstNode>, location: &SourceLocation, id_provider: IdProvider, ) -> AstNode

Source

pub fn create_call_to_check_function_ast( check_function_name: &str, parameter: AstNode, sub_range: Range<AstNode>, location: &SourceLocation, id_provider: IdProvider, ) -> AstNode

Source

pub fn create_jump_statement( condition: Box<AstNode>, target: Box<AstNode>, location: SourceLocation, id: AstId, ) -> AstNode

Source

pub fn create_label_statement( name: String, location: SourceLocation, id: AstId, ) -> AstNode

Source

pub fn create_plus_one_expression( value: AstNode, location: SourceLocation, id: AstId, ) -> AstNode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.