pub struct Precompiler<'a> { /* private fields */ }Implementations§
Source§impl<'a> Precompiler<'a>
impl<'a> Precompiler<'a>
pub fn new( scope_stack: &'a mut PrecompilerScopeStack, ast_metadata: Rc<RefCell<AstMetadata>>, ) -> Self
Trait Implementations§
Source§impl<'a> ExpressionVisitor<SpannedCompilerError> for Precompiler<'a>
impl<'a> ExpressionVisitor<SpannedCompilerError> for Precompiler<'a>
Source§fn handle_expression_error(
&mut self,
error: SpannedCompilerError,
_expression: &DatexExpression,
) -> Result<VisitAction<DatexExpression>, SpannedCompilerError>
fn handle_expression_error( &mut self, error: SpannedCompilerError, _expression: &DatexExpression, ) -> Result<VisitAction<DatexExpression>, SpannedCompilerError>
Handle expression errors by either recording them if collected_errors is Some, or aborting the traversal if collected_errors is None.
fn before_visit_datex_expression(&mut self, expr: &mut DatexExpression)
fn after_visit_datex_expression(&mut self, expr: &mut DatexExpression)
Source§fn visit_remote_execution(
&mut self,
remote_execution: &mut RemoteExecution,
_: &Range<usize>,
) -> ExpressionVisitResult<SpannedCompilerError>
fn visit_remote_execution( &mut self, remote_execution: &mut RemoteExecution, _: &Range<usize>, ) -> ExpressionVisitResult<SpannedCompilerError>
Visit remote execution
Source§fn visit_statements(
&mut self,
statements: &mut Statements,
_: &Range<usize>,
) -> ExpressionVisitResult<SpannedCompilerError>
fn visit_statements( &mut self, statements: &mut Statements, _: &Range<usize>, ) -> ExpressionVisitResult<SpannedCompilerError>
Visit statements
Source§fn visit_type_declaration(
&mut self,
type_declaration: &mut TypeDeclaration,
_: &Range<usize>,
) -> ExpressionVisitResult<SpannedCompilerError>
fn visit_type_declaration( &mut self, type_declaration: &mut TypeDeclaration, _: &Range<usize>, ) -> ExpressionVisitResult<SpannedCompilerError>
Visit type declaration
Source§fn visit_binary_operation(
&mut self,
binary_operation: &mut BinaryOperation,
span: &Range<usize>,
) -> ExpressionVisitResult<SpannedCompilerError>
fn visit_binary_operation( &mut self, binary_operation: &mut BinaryOperation, span: &Range<usize>, ) -> ExpressionVisitResult<SpannedCompilerError>
Visit binary operation
Source§fn visit_variable_declaration(
&mut self,
variable_declaration: &mut VariableDeclaration,
span: &Range<usize>,
) -> ExpressionVisitResult<SpannedCompilerError>
fn visit_variable_declaration( &mut self, variable_declaration: &mut VariableDeclaration, span: &Range<usize>, ) -> ExpressionVisitResult<SpannedCompilerError>
Visit variable declaration
Source§fn visit_variable_assignment(
&mut self,
variable_assignment: &mut VariableAssignment,
span: &Range<usize>,
) -> ExpressionVisitResult<SpannedCompilerError>
fn visit_variable_assignment( &mut self, variable_assignment: &mut VariableAssignment, span: &Range<usize>, ) -> ExpressionVisitResult<SpannedCompilerError>
Visit variable assignment
Source§fn visit_identifier(
&mut self,
identifier: &mut String,
span: &Range<usize>,
) -> ExpressionVisitResult<SpannedCompilerError>
fn visit_identifier( &mut self, identifier: &mut String, span: &Range<usize>, ) -> ExpressionVisitResult<SpannedCompilerError>
Visit identifier
Source§fn visit_datex_expression(
&mut self,
expr: &mut DatexExpression,
) -> Result<(), E>
fn visit_datex_expression( &mut self, expr: &mut DatexExpression, ) -> Result<(), E>
Visit datex expression
Source§fn visit_unary_operation(
&mut self,
unary_operation: &mut UnaryOperation,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_unary_operation( &mut self, unary_operation: &mut UnaryOperation, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit unary operation
Source§fn visit_variant_access(
&mut self,
variant_access: &mut VariantAccess,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_variant_access( &mut self, variant_access: &mut VariantAccess, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit variant access
Source§fn visit_property_assignment(
&mut self,
property_assignment: &mut PropertyAssignment,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_property_assignment( &mut self, property_assignment: &mut PropertyAssignment, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit property assignment
Source§fn visit_conditional(
&mut self,
conditional: &mut Conditional,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_conditional( &mut self, conditional: &mut Conditional, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit conditional expression
Source§fn visit_comparison_operation(
&mut self,
comparison_operation: &mut ComparisonOperation,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_comparison_operation( &mut self, comparison_operation: &mut ComparisonOperation, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit comparison operation
Source§fn visit_deref_assignment(
&mut self,
deref_assignment: &mut DerefAssignment,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_deref_assignment( &mut self, deref_assignment: &mut DerefAssignment, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit dereference assignment
Source§fn visit_apply(
&mut self,
apply: &mut Apply,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_apply( &mut self, apply: &mut Apply, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit apply chain
Source§fn visit_property_access(
&mut self,
property_access: &mut PropertyAccess,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_property_access( &mut self, property_access: &mut PropertyAccess, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit property access
Source§fn visit_generic_instantiation(
&mut self,
generic_instantiation: &mut GenericInstantiation,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_generic_instantiation( &mut self, generic_instantiation: &mut GenericInstantiation, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit generic instantiation
Source§fn visit_callable_declaration(
&mut self,
function_declaration: &mut CallableDeclaration,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_callable_declaration( &mut self, function_declaration: &mut CallableDeclaration, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit callable declaration
Source§fn visit_slot_assignment(
&mut self,
slot_assignment: &mut SlotAssignment,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_slot_assignment( &mut self, slot_assignment: &mut SlotAssignment, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit slot assignment
Source§fn visit_variable_access(
&mut self,
var_access: &mut VariableAccess,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_variable_access( &mut self, var_access: &mut VariableAccess, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit variable access
Source§fn visit_create_ref(
&mut self,
create_ref: &mut CreateRef,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_create_ref( &mut self, create_ref: &mut CreateRef, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit create reference expression
Source§fn visit_create_mut(
&mut self,
datex_expression: &mut DatexExpression,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_create_mut( &mut self, datex_expression: &mut DatexExpression, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit create mutable reference expression
Source§fn visit_deref(
&mut self,
deref: &mut Deref,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_deref( &mut self, deref: &mut Deref, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit dereference expression
Source§fn visit_list(
&mut self,
list: &mut List,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_list( &mut self, list: &mut List, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit list expression
Source§fn visit_map(
&mut self,
map: &mut Map,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_map( &mut self, map: &mut Map, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit map expression
Source§fn visit_integer(
&mut self,
integer: &mut Integer,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_integer( &mut self, integer: &mut Integer, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit integer literal
Source§fn visit_typed_integer(
&mut self,
typed_integer: &mut TypedInteger,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_typed_integer( &mut self, typed_integer: &mut TypedInteger, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit typed integer literal
Source§fn visit_decimal(
&mut self,
decimal: &mut Decimal,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_decimal( &mut self, decimal: &mut Decimal, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit decimal literal
Source§fn visit_typed_decimal(
&mut self,
typed_decimal: &mut TypedDecimal,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_typed_decimal( &mut self, typed_decimal: &mut TypedDecimal, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit typed decimal literal
fn visit_placeholder(&mut self, span: &Range<usize>) -> ExpressionVisitResult<E>
Source§fn visit_text(
&mut self,
text: &mut String,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_text( &mut self, text: &mut String, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit text literal
Source§fn visit_get_reference(
&mut self,
pointer_address: &mut PointerAddress,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_get_reference( &mut self, pointer_address: &mut PointerAddress, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit get reference expression
Source§fn visit_boolean(
&mut self,
boolean: &mut bool,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_boolean( &mut self, boolean: &mut bool, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit boolean literal
Source§fn visit_endpoint(
&mut self,
endpoint: &mut Endpoint,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_endpoint( &mut self, endpoint: &mut Endpoint, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit endpoint expression
Source§fn visit_null(&mut self, span: &Range<usize>) -> ExpressionVisitResult<E>
fn visit_null(&mut self, span: &Range<usize>) -> ExpressionVisitResult<E>
Visit null literal
Source§fn visit_pointer_address(
&mut self,
pointer_address: &PointerAddress,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_pointer_address( &mut self, pointer_address: &PointerAddress, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit pointer address expression
Source§fn visit_slot(
&mut self,
slot: &Slot,
span: &Range<usize>,
) -> ExpressionVisitResult<E>
fn visit_slot( &mut self, slot: &Slot, span: &Range<usize>, ) -> ExpressionVisitResult<E>
Visit slot expression
Source§impl<'a> TypeExpressionVisitor<SpannedCompilerError> for Precompiler<'a>
impl<'a> TypeExpressionVisitor<SpannedCompilerError> for Precompiler<'a>
Source§fn visit_literal_type(
&mut self,
literal: &mut String,
span: &Range<usize>,
) -> TypeExpressionVisitResult<SpannedCompilerError>
fn visit_literal_type( &mut self, literal: &mut String, span: &Range<usize>, ) -> TypeExpressionVisitResult<SpannedCompilerError>
Visit literal type expression
Source§fn visit_variant_access_type(
&mut self,
variant_access: &mut TypeVariantAccess,
span: &Range<usize>,
) -> TypeExpressionVisitResult<SpannedCompilerError>
fn visit_variant_access_type( &mut self, variant_access: &mut TypeVariantAccess, span: &Range<usize>, ) -> TypeExpressionVisitResult<SpannedCompilerError>
Visit variant access expression
Source§fn handle_type_expression_error(
&mut self,
error: E,
expression: &TypeExpression,
) -> Result<VisitAction<TypeExpression>, E>
fn handle_type_expression_error( &mut self, error: E, expression: &TypeExpression, ) -> Result<VisitAction<TypeExpression>, E>
Handle type expression error
Can either propagate the error or return a VisitAction to recover
Per default, it just propagates the error
fn before_visit_type_expression(&mut self, expression: &mut TypeExpression)
fn after_visit_type_expression(&mut self, expression: &mut TypeExpression)
Source§fn visit_type_expression(&mut self, expr: &mut TypeExpression) -> Result<(), E>
fn visit_type_expression(&mut self, expr: &mut TypeExpression) -> Result<(), E>
Visit type expression
Source§fn visit_structural_list_type(
&mut self,
structural_list: &mut StructuralList,
span: &Range<usize>,
) -> TypeExpressionVisitResult<E>
fn visit_structural_list_type( &mut self, structural_list: &mut StructuralList, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>
Visit structural list type expression
Source§fn visit_fixed_size_list_type(
&mut self,
fixed_size_list: &mut FixedSizeList,
span: &Range<usize>,
) -> TypeExpressionVisitResult<E>
fn visit_fixed_size_list_type( &mut self, fixed_size_list: &mut FixedSizeList, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>
Visit fixed size list type expression
Source§fn visit_slice_list_type(
&mut self,
slice_list: &mut SliceList,
span: &Range<usize>,
) -> TypeExpressionVisitResult<E>
fn visit_slice_list_type( &mut self, slice_list: &mut SliceList, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>
Visit slice list type expression
Source§fn visit_intersection_type(
&mut self,
intersection: &mut Intersection,
span: &Range<usize>,
) -> TypeExpressionVisitResult<E>
fn visit_intersection_type( &mut self, intersection: &mut Intersection, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>
Visit intersection type expression
Source§fn visit_union_type(
&mut self,
union: &mut Union,
span: &Range<usize>,
) -> TypeExpressionVisitResult<E>
fn visit_union_type( &mut self, union: &mut Union, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>
Visit union type expression
Source§fn visit_generic_access_type(
&mut self,
generic_access: &mut GenericAccess,
span: &Range<usize>,
) -> TypeExpressionVisitResult<E>
fn visit_generic_access_type( &mut self, generic_access: &mut GenericAccess, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>
Visit generic access type expression
Source§fn visit_callable_type(
&mut self,
callable_type_expression: &mut CallableTypeExpression,
span: &Range<usize>,
) -> TypeExpressionVisitResult<E>
fn visit_callable_type( &mut self, callable_type_expression: &mut CallableTypeExpression, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>
Visit function type expression
Source§fn visit_structural_map_type(
&mut self,
structural_map: &mut StructuralMap,
span: &Range<usize>,
) -> TypeExpressionVisitResult<E>
fn visit_structural_map_type( &mut self, structural_map: &mut StructuralMap, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>
Visit structural map type expression
Source§fn visit_ref_type(
&mut self,
type_ref: &mut TypeExpression,
span: &Range<usize>,
) -> TypeExpressionVisitResult<E>
fn visit_ref_type( &mut self, type_ref: &mut TypeExpression, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>
Visit type reference expression
Source§fn visit_ref_mut_type(
&mut self,
type_ref_mut: &mut TypeExpression,
span: &Range<usize>,
) -> TypeExpressionVisitResult<E>
fn visit_ref_mut_type( &mut self, type_ref_mut: &mut TypeExpression, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>
Visit mutable type reference expression
Source§fn visit_integer_type(
&mut self,
integer: &mut Integer,
span: &Range<usize>,
) -> TypeExpressionVisitResult<E>
fn visit_integer_type( &mut self, integer: &mut Integer, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>
Visit integer literal
Source§fn visit_typed_integer_type(
&mut self,
typed_integer: &mut TypedInteger,
span: &Range<usize>,
) -> TypeExpressionVisitResult<E>
fn visit_typed_integer_type( &mut self, typed_integer: &mut TypedInteger, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>
Visit typed integer literal
Source§fn visit_decimal_type(
&mut self,
decimal: &mut Decimal,
span: &Range<usize>,
) -> TypeExpressionVisitResult<E>
fn visit_decimal_type( &mut self, decimal: &mut Decimal, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>
Visit decimal literal
Source§fn visit_typed_decimal_type(
&mut self,
typed_decimal: &mut TypedDecimal,
span: &Range<usize>,
) -> TypeExpressionVisitResult<E>
fn visit_typed_decimal_type( &mut self, typed_decimal: &mut TypedDecimal, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>
Visit typed decimal literal
Source§fn visit_text_type(
&mut self,
text: &mut String,
span: &Range<usize>,
) -> TypeExpressionVisitResult<E>
fn visit_text_type( &mut self, text: &mut String, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>
Visit text literal
Source§fn visit_get_reference_type(
&mut self,
pointer_address: &mut PointerAddress,
span: &Range<usize>,
) -> TypeExpressionVisitResult<E>
fn visit_get_reference_type( &mut self, pointer_address: &mut PointerAddress, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>
Visit get reference expression
Source§fn visit_boolean_type(
&mut self,
boolean: &mut bool,
span: &Range<usize>,
) -> TypeExpressionVisitResult<E>
fn visit_boolean_type( &mut self, boolean: &mut bool, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>
Visit boolean literal
Source§fn visit_endpoint_type(
&mut self,
endpoint: &mut Endpoint,
span: &Range<usize>,
) -> TypeExpressionVisitResult<E>
fn visit_endpoint_type( &mut self, endpoint: &mut Endpoint, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>
Visit endpoint expression
Source§fn visit_null_type(
&mut self,
span: &Range<usize>,
) -> TypeExpressionVisitResult<E>
fn visit_null_type( &mut self, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>
Visit null literal
fn visit_unit_type( &mut self, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>
Source§fn visit_variable_access_type(
&mut self,
var_access: &mut VariableAccess,
span: &Range<usize>,
) -> TypeExpressionVisitResult<E>
fn visit_variable_access_type( &mut self, var_access: &mut VariableAccess, span: &Range<usize>, ) -> TypeExpressionVisitResult<E>
Visit variable access
Auto Trait Implementations§
impl<'a> Freeze for Precompiler<'a>
impl<'a> !RefUnwindSafe for Precompiler<'a>
impl<'a> !Send for Precompiler<'a>
impl<'a> !Sync for Precompiler<'a>
impl<'a> Unpin for Precompiler<'a>
impl<'a> !UnwindSafe for Precompiler<'a>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more