summaryrefslogtreecommitdiff
path: root/spec/compiler/compiler.txt
blob: df7a5912520dd0b85a6652c1c43ae20ac039241b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
The "compiler" of the TNSL language is formed of several parts, each discussed
in their own file.

	1) Parsing
	
		1a) The tokenizer - chews up .tnsl files and spits out tokens
		1b) The file resolver - interperets import commands and creates a tree of files to compile
		1c) The definer - 
		1d) The AST generator - indexes tokens and provides some rudimentary syntax checking
	
	2) Validation

		2a) The expander - expands pre-processor commands and macro operations
		2b) The validator - checks all requirements for all functions and expressions are valid

	3) Translation

		3a) Variable resolver - chooses and creates an internal model of where variables are on the stack, as well as calling conventions for functions
		3b) Type translator - places and translates types (internal and external)
		3c) Container resolver - checks container (elf, exe, dll, app, out, etc.) and decides how to map the types for future linking
		3d) Final translation - translates all logic and expressions into native binary code
		3e) Optimization
		3f) Container Writer - writes the final output of the previous steps into the specified container