Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/4RH1T3CT0R7/ttf-doom
/ types & classes
Types & classes
112 in github.com/4RH1T3CT0R7/ttf-doom
⨍
Functions
584
◇
Types & classes
112
↓ 28 callers
Class
CodeGenerator
Translates a ``Program`` AST into TrueType hinting assembly. Usage:: gen = CodeGenerator() result = gen.compile(program_ast)
compiler/codegen.py:87
↓ 24 callers
Class
Program
Root AST node — a sequence of top-level declarations.
compiler/ast_nodes.py:208
↓ 18 callers
Class
Lexer
Tokenize TTDoom DSL source code. Usage:: lexer = Lexer(source_code) tokens = lexer.tokenize() # list[Token]
compiler/lexer.py:174
↓ 15 callers
Class
Parser
Recursive-descent parser for the TTDoom DSL. Usage:: parser = Parser(source_code) program = parser.parse() # returns ast_nodes
compiler/parser.py:111
↓ 14 callers
Class
CodeGenError
Raised when code generation encounters an unrecoverable error.
compiler/codegen.py:72
↓ 14 callers
Class
StorageAllocator
Assigns storage indices and function IDs. Args: start_storage: First available storage slot index. start_func_id: First available
compiler/allocator.py:26
↓ 9 callers
Class
Token
A single lexical token.
compiler/lexer.py:98
↓ 6 callers
Class
FuncDef
Function definition with typed parameters and optional return type. ``func add(a: int, b: int) -> int:``
compiler/ast_nodes.py:62
↓ 5 callers
Class
BinOp
Binary operation. Supported operators: ``+ - * / % == != < > <= >= and or``
compiler/ast_nodes.py:94
↓ 5 callers
Class
ExprStmt
Standalone expression (typically a function call).
compiler/ast_nodes.py:190
↓ 4 callers
Class
AllocatorError
Raised when the allocator detects an invalid operation.
compiler/allocator.py:21
↓ 4 callers
Class
FuncCall
Function or intrinsic call. Intrinsics: ``get_axis``, ``set_point_y``, ``fixmul``, ``fixdiv``.
compiler/ast_nodes.py:114
↓ 4 callers
Class
IntLiteral
Integer constant (decimal or hex).
compiler/ast_nodes.py:80
↓ 4 callers
Class
ParseError
Raised when the parser encounters a syntax error.
compiler/parser.py:71
↓ 2 callers
Class
ArrayAccess
Indexed array read: ``map_data[y * MAP_SIZE + x]``.
compiler/ast_nodes.py:125
↓ 2 callers
Class
Assignment
Simple variable assignment: ``player_x = player_x + dx``.
compiler/ast_nodes.py:141
↓ 2 callers
Class
LexerError
Raised when the lexer encounters an invalid character or token.
compiler/lexer.py:114
↓ 2 callers
Class
UnaryOp
Unary operation: negation ``-`` or logical ``not``.
compiler/ast_nodes.py:106
↓ 1 callers
Class
ArrayAssignment
Indexed array write: ``map_data[idx] = value``.
compiler/ast_nodes.py:150
↓ 1 callers
Class
ArrayDecl
Contiguous storage-slot array. ``array sin_table[256]``
compiler/ast_nodes.py:50
↓ 1 callers
Class
ConstDecl
Compile-time constant (always inlined). ``const SCALE = 16384``
compiler/ast_nodes.py:38
↓ 1 callers
Class
IfStmt
Conditional with optional else branch. The else branch may itself contain a single ``IfStmt`` for chaining.
compiler/ast_nodes.py:160
↓ 1 callers
Class
ReturnStmt
Return statement with optional expression.
compiler/ast_nodes.py:182
↓ 1 callers
Class
VarDecl
Global or local variable declaration. ``var player_x: int = 512``
compiler/ast_nodes.py:26
↓ 1 callers
Class
VarRef
Reference to a named variable or constant.
compiler/ast_nodes.py:87
↓ 1 callers
Class
WhileStmt
While-loop.
compiler/ast_nodes.py:173
Class
TestArithmeticOps
Verify arithmetic operators compile correctly.
tests/test_codegen.py:725
Class
TestArrayAccess
tests/test_parser.py:420
Class
TestArrayDecl
tests/test_parser.py:98
Class
TestArrayProgram
Compile a program with arrays and while loops.
tests/test_pipeline.py:373
Class
TestArrayRead
Compile ``arr[i]`` read and verify index + base + RS.
tests/test_codegen.py:326
Class
TestArrayWrite
Compile ``arr[i] = v`` and verify correct WS sequence.
tests/test_codegen.py:363
Class
TestArrow
tests/test_lexer.py:293
Class
TestAssemblyRoundTrip
Verify that assembly can be disassembled and still makes sense.
tests/test_pipeline.py:309
Class
TestAssemblyValidity
Verify that generated assembly consists of valid TT instructions.
tests/test_stdlib.py:212
Class
TestAssignment
Compile ``x = x + 1`` and verify RS/ADD/WS sequence.
tests/test_codegen.py:291
Class
TestBuildFont
Test the build_font function directly.
tests/test_pipeline.py:557
Class
TestBuildFpgmAssembly
Verify the FDEF/ENDF wrapping and function ID assignment.
tests/test_stdlib.py:673
Class
TestBuildScript
Verify the build script produces a valid font file.
tests/test_raycaster.py:309
Class
TestCLI
Test the compiler CLI (python -m compiler).
tests/test_pipeline.py:410
Class
TestComments
tests/test_lexer.py:88
Class
TestComparisonOps
Verify all comparison operators compile to correct TT instructions.
tests/test_codegen.py:652
Class
TestComparisonOps
tests/test_parser.py:631
Class
TestCompleteProgram
tests/test_parser.py:485
Class
TestComplexProgram
Verify a more complex program compiles without errors.
tests/test_codegen.py:1314
Class
TestConstDecl
tests/test_parser.py:76
Class
TestConstInlining
Compile ``const C = 100`` and verify it is inlined in expressions.
tests/test_codegen.py:249
Class
TestConversionHelpers
Verify to_fixed / from_fixed round-trip correctly.
tests/test_stdlib.py:187
Class
TestDSLFeatures
Verify specific DSL features used in the raycaster.
tests/test_raycaster.py:557
Class
TestDoomCompilation
Verify that doom.doom compiles to valid TT assembly.
tests/test_raycaster.py:212
Class
TestDoomParsing
Verify that doom.doom parses without errors.
tests/test_raycaster.py:114
Class
TestEdgeCases
Stress-test with boundary and adversarial inputs.
tests/test_stdlib.py:620
Class
TestEdgeCases
tests/test_parser.py:653
Class
TestEmptyLines
tests/test_lexer.py:306
Class
TestEndToEnd
Compile a small program, inject into a font, verify valid bytecode.
tests/test_codegen.py:1044
Class
TestEndToEnd
End-to-end tests verifying the complete build pipeline.
tests/test_raycaster.py:826
Class
TestErrorHandling
Verify that code generation raises useful errors.
tests/test_codegen.py:1218
Class
TestErrorHandling
Verify that compilation errors are handled gracefully.
tests/test_pipeline.py:499
Class
TestErrors
tests/test_lexer.py:245
Class
TestExprPrecedence
tests/test_parser.py:262
Class
TestFixabsFixneg
Verify the trivial ABS/NEG wrappers.
tests/test_stdlib.py:589
Class
TestFixdivNumerical
Verify fixdiv produces correct results via simulation.
tests/test_stdlib.py:471
Class
TestFixmulNumerical
Verify fixmul produces correct results via simulation.
tests/test_stdlib.py:334
Class
TestFontInjection
Inject stdlib assembly into a real .ttf and verify it compiles.
tests/test_stdlib.py:723
Class
TestFontReload
Verify font can be saved and reloaded (round-trip).
tests/test_raycaster.py:457
Class
TestFontStructure
Verify the built font has the correct tables and structure.
tests/test_raycaster.py:327
Class
TestFontStructure
Verify the structural properties of compiled fonts.
tests/test_pipeline.py:201
Class
TestFpgmContent
Verify the font program (fpgm) content.
tests/test_raycaster.py:390
Class
TestFuncCall
Compile function calls and verify push args + CALL.
tests/test_codegen.py:526
Class
TestFuncCall
tests/test_parser.py:374
Class
TestFuncDef
Compile function definitions and verify FDEF with param storage.
tests/test_codegen.py:481
Class
TestFuncDef
tests/test_parser.py:110
Class
TestFuncDef
tests/test_lexer.py:61
Class
TestFunctionMetadata
Verify stack-effect metadata is consistent.
tests/test_stdlib.py:261
Class
TestFunctionProgram
Compile a program with function definitions and calls.
tests/test_pipeline.py:135
Class
TestGameProgram
Compile a game-like program with variables, arrays, functions, if/while.
tests/test_pipeline.py:171
Class
TestGetAxis
Compile get_axis(N) and verify GETVARIATION assembly.
tests/test_codegen.py:797
Class
TestGlyphProgram
Verify glyph program generation.
tests/test_codegen.py:928
Class
TestIfElseProgram
Compile a program with if/else.
tests/test_pipeline.py:395
Class
TestIfStmt
Compile if/else and verify IF/EIF assembly.
tests/test_codegen.py:398
Class
TestIfStmt
tests/test_parser.py:151
Class
TestIndentation
tests/test_lexer.py:122
Class
TestInstructionValidity
Every generated instruction should be a valid TT mnemonic.
tests/test_codegen.py:970
Class
TestIntLiterals
tests/test_lexer.py:222
Class
TestKeywordsVsIdentifiers
tests/test_lexer.py:335
Class
TestLineNumbers
tests/test_lexer.py:358
Class
TestLocalVarDecl
tests/test_parser.py:612
Class
TestLocalVariableScoping
Verify that local variables in different functions do not conflict.
tests/test_raycaster.py:502
Class
TestLogicalOps
Verify and/or/not compile to correct TT instructions.
tests/test_codegen.py:684
Class
TestMapData
Verify the map data loading.
tests/test_raycaster.py:768
Class
TestMathTablesIntegration
Verify sin/cos table generation and integration.
tests/test_raycaster.py:704
Class
TestMinimalProgram
Compile a minimal ``var x: int = 42`` program.
tests/test_pipeline.py:98
Class
TestMultiLine
tests/test_lexer.py:262
Class
TestNestedExpr
tests/test_parser.py:452
Class
TestOperators
tests/test_lexer.py:181
Class
TestPrecedence
Compile ``a + b * c`` and verify correct order.
tests/test_codegen.py:620
Class
TestPrepContent
Verify the pre-program (prep) content.
tests/test_raycaster.py:421
Class
TestPrepProgram
Verify prep program always starts with SVTCA[0].
tests/test_codegen.py:955
Class
TestPushValue
Verify PUSHB/PUSHW selection based on value range.
tests/test_codegen.py:879
Class
TestReturnStmt
Compile return and verify expr is left on stack.
tests/test_codegen.py:575
next →
1–100 of 112, ranked by callers