From 258c945382811f29ca181cb992b5a55e4c2b515a 2021-03-05 10:02:21 From: MH Date: 2021-03-05 10:02:21 Subject: [PATCH] start on type checking --- diff --git a/src/protocol/parser/mod.rs b/src/protocol/parser/mod.rs index 077a32f98012c8fdee825b160b8ca1102fdaf874..331bf24f468336f6c960ffe784e78f76f22f59a6 100644 --- a/src/protocol/parser/mod.rs +++ b/src/protocol/parser/mod.rs @@ -1,6 +1,7 @@ mod depth_visitor; mod symbol_table; mod type_table; +mod type_resolver; mod visitor; use depth_visitor::*; @@ -12,7 +13,6 @@ use crate::protocol::ast::*; use crate::protocol::inputsource::*; use crate::protocol::lexer::*; - use std::collections::HashMap; use crate::protocol::parser::visitor::Ctx; use crate::protocol::ast_printer::ASTWriter; diff --git a/src/protocol/parser/type_resolver.rs b/src/protocol/parser/type_resolver.rs index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..40ecfb15e70169197073d67d854c0115fb799946 100644 --- a/src/protocol/parser/type_resolver.rs +++ b/src/protocol/parser/type_resolver.rs @@ -0,0 +1,18 @@ +use super::visitor::{Visitor2, VisitorResult}; + +/// This particular visitor will recurse depth-first into the AST and ensures +/// that all expressions have the appropriate types. At the moment this implies: +/// +/// - Type checking arguments to unary and binary operators. +/// - Type checking assignment, indexing, slicing and select expressions. +/// - Checking arguments to functions and component instantiations. +/// +/// This will be achieved by slowly descending into the AST. At any given +/// expression we may depend on +pub(crate) struct TypeResolvingVisitor { + +} + +impl Visitor2 for TypeResolvingVisitor { + +} \ No newline at end of file