How arturmarschenkulov/ice-lang-rust works
Icelang is a strongly and statically typed language project, currently centered on source lexing, parsing, AST construction, and checking. The principal workflow is that a user supplies source text or a file; the CLI reads it, lexes tokens, parses a project AST, and prints source, token, and AST views. The checker is a distinct implementation stage, though the shown excerpts do not establish how the CLI invokes it. The compiler file contains commented-out LLVM code, so it is not represented as an active product stage. Connections for unsampled checker behavior are left out or marked unverified.
Main entry points: main.rs CLI runner · lexer/mod.rs Lexer · parser/mod.rs Project parser · ast.rs Language AST
Components 16
Input and display
- CLI runner
src/main.rs - File input
src/main.rs - Stage display
src/tui.rs
Lexical analysis
- Lexer
src/lexer/mod.rs - Token model
src/lexer/token.rs - Lex cursor
src/lexer/cursor.rs - Source spans
src/lexer/span.rs - Lex errors
src/lexer/error.rs
Parsing and AST
- Project parser
src/parser/mod.rs - Expression parser
src/parser/expr.rs - Item parser
src/parser/item.rs - Operator precedence
src/parser/precedence.rs - Language AST
src/parser/ast.rs - AST printer
src/parser/ast_print.rs
Semantic validation
- Type checker
src/check.rs
Other components
- Source author
Connections 21
- Source author → CLI runner: supplies source
src/main.rs - CLI runner → File input: reads file
src/main.rs - CLI runner → Lexer: lexes source
src/main.rs - Lexer → Lex cursor: scans characters
src/lexer/mod.rs - Lexer → Token model: produces tokens
src/lexer/mod.rs - Lexer → Source spans: assigns spans
src/lexer/mod.rs - Lexer → Lex errors: reports errors
src/lexer/mod.rs - Lex cursor → Source spans: tracks positions
src/lexer/cursor.rs - CLI runner → Project parser: parses tokens
src/main.rs - Project parser → Expression parser: parses expressions
src/parser/mod.rs - Project parser → Item parser: parses items
src/parser/mod.rs - Expression parser → Operator precedence: looks up binding
src/parser/expr.rs - Expression parser → Language AST: builds expressions
src/parser/expr.rs - Item parser → Language AST: builds items
src/parser/item.rs - Project parser → Language AST: returns project
src/parser/mod.rs - CLI runner → Stage display: prints stages
src/main.rs - Stage display → Token model: prints tokens
src/tui.rs - Stage display → AST printer: prints AST
src/tui.rs - AST printer → Language AST: renders tree
src/parser/ast_print.rs - Type checker → Language AST: reads AST types
src/check.rs - Project parser → Type checker: may validate