MCPcopy Create free account

hub / github.com/4RH1T3CT0R7/ttf-doom / types & classes

Types & classes112 in github.com/4RH1T3CT0R7/ttf-doom

↓ 28 callersClassCodeGenerator
Translates a ``Program`` AST into TrueType hinting assembly. Usage:: gen = CodeGenerator() result = gen.compile(program_ast)
compiler/codegen.py:87
↓ 24 callersClassProgram
Root AST node — a sequence of top-level declarations.
compiler/ast_nodes.py:208
↓ 18 callersClassLexer
Tokenize TTDoom DSL source code. Usage:: lexer = Lexer(source_code) tokens = lexer.tokenize() # list[Token]
compiler/lexer.py:174
↓ 15 callersClassParser
Recursive-descent parser for the TTDoom DSL. Usage:: parser = Parser(source_code) program = parser.parse() # returns ast_nodes
compiler/parser.py:111
↓ 14 callersClassCodeGenError
Raised when code generation encounters an unrecoverable error.
compiler/codegen.py:72
↓ 14 callersClassStorageAllocator
Assigns storage indices and function IDs. Args: start_storage: First available storage slot index. start_func_id: First available
compiler/allocator.py:26
↓ 9 callersClassToken
A single lexical token.
compiler/lexer.py:98
↓ 6 callersClassFuncDef
Function definition with typed parameters and optional return type. ``func add(a: int, b: int) -> int:``
compiler/ast_nodes.py:62
↓ 5 callersClassBinOp
Binary operation. Supported operators: ``+ - * / % == != < > <= >= and or``
compiler/ast_nodes.py:94
↓ 5 callersClassExprStmt
Standalone expression (typically a function call).
compiler/ast_nodes.py:190
↓ 4 callersClassAllocatorError
Raised when the allocator detects an invalid operation.
compiler/allocator.py:21
↓ 4 callersClassFuncCall
Function or intrinsic call. Intrinsics: ``get_axis``, ``set_point_y``, ``fixmul``, ``fixdiv``.
compiler/ast_nodes.py:114
↓ 4 callersClassIntLiteral
Integer constant (decimal or hex).
compiler/ast_nodes.py:80
↓ 4 callersClassParseError
Raised when the parser encounters a syntax error.
compiler/parser.py:71
↓ 2 callersClassArrayAccess
Indexed array read: ``map_data[y * MAP_SIZE + x]``.
compiler/ast_nodes.py:125
↓ 2 callersClassAssignment
Simple variable assignment: ``player_x = player_x + dx``.
compiler/ast_nodes.py:141
↓ 2 callersClassLexerError
Raised when the lexer encounters an invalid character or token.
compiler/lexer.py:114
↓ 2 callersClassUnaryOp
Unary operation: negation ``-`` or logical ``not``.
compiler/ast_nodes.py:106
↓ 1 callersClassArrayAssignment
Indexed array write: ``map_data[idx] = value``.
compiler/ast_nodes.py:150
↓ 1 callersClassArrayDecl
Contiguous storage-slot array. ``array sin_table[256]``
compiler/ast_nodes.py:50
↓ 1 callersClassConstDecl
Compile-time constant (always inlined). ``const SCALE = 16384``
compiler/ast_nodes.py:38
↓ 1 callersClassIfStmt
Conditional with optional else branch. The else branch may itself contain a single ``IfStmt`` for chaining.
compiler/ast_nodes.py:160
↓ 1 callersClassReturnStmt
Return statement with optional expression.
compiler/ast_nodes.py:182
↓ 1 callersClassVarDecl
Global or local variable declaration. ``var player_x: int = 512``
compiler/ast_nodes.py:26
↓ 1 callersClassVarRef
Reference to a named variable or constant.
compiler/ast_nodes.py:87
↓ 1 callersClassWhileStmt
While-loop.
compiler/ast_nodes.py:173
ClassTestArithmeticOps
Verify arithmetic operators compile correctly.
tests/test_codegen.py:725
ClassTestArrayAccess
tests/test_parser.py:420
ClassTestArrayDecl
tests/test_parser.py:98
ClassTestArrayProgram
Compile a program with arrays and while loops.
tests/test_pipeline.py:373
ClassTestArrayRead
Compile ``arr[i]`` read and verify index + base + RS.
tests/test_codegen.py:326
ClassTestArrayWrite
Compile ``arr[i] = v`` and verify correct WS sequence.
tests/test_codegen.py:363
ClassTestArrow
tests/test_lexer.py:293
ClassTestAssemblyRoundTrip
Verify that assembly can be disassembled and still makes sense.
tests/test_pipeline.py:309
ClassTestAssemblyValidity
Verify that generated assembly consists of valid TT instructions.
tests/test_stdlib.py:212
ClassTestAssignment
Compile ``x = x + 1`` and verify RS/ADD/WS sequence.
tests/test_codegen.py:291
ClassTestBuildFont
Test the build_font function directly.
tests/test_pipeline.py:557
ClassTestBuildFpgmAssembly
Verify the FDEF/ENDF wrapping and function ID assignment.
tests/test_stdlib.py:673
ClassTestBuildScript
Verify the build script produces a valid font file.
tests/test_raycaster.py:309
ClassTestCLI
Test the compiler CLI (python -m compiler).
tests/test_pipeline.py:410
ClassTestComments
tests/test_lexer.py:88
ClassTestComparisonOps
Verify all comparison operators compile to correct TT instructions.
tests/test_codegen.py:652
ClassTestComparisonOps
tests/test_parser.py:631
ClassTestCompleteProgram
tests/test_parser.py:485
ClassTestComplexProgram
Verify a more complex program compiles without errors.
tests/test_codegen.py:1314
ClassTestConstDecl
tests/test_parser.py:76
ClassTestConstInlining
Compile ``const C = 100`` and verify it is inlined in expressions.
tests/test_codegen.py:249
ClassTestConversionHelpers
Verify to_fixed / from_fixed round-trip correctly.
tests/test_stdlib.py:187
ClassTestDSLFeatures
Verify specific DSL features used in the raycaster.
tests/test_raycaster.py:557
ClassTestDoomCompilation
Verify that doom.doom compiles to valid TT assembly.
tests/test_raycaster.py:212
ClassTestDoomParsing
Verify that doom.doom parses without errors.
tests/test_raycaster.py:114
ClassTestEdgeCases
Stress-test with boundary and adversarial inputs.
tests/test_stdlib.py:620
ClassTestEdgeCases
tests/test_parser.py:653
ClassTestEmptyLines
tests/test_lexer.py:306
ClassTestEndToEnd
Compile a small program, inject into a font, verify valid bytecode.
tests/test_codegen.py:1044
ClassTestEndToEnd
End-to-end tests verifying the complete build pipeline.
tests/test_raycaster.py:826
ClassTestErrorHandling
Verify that code generation raises useful errors.
tests/test_codegen.py:1218
ClassTestErrorHandling
Verify that compilation errors are handled gracefully.
tests/test_pipeline.py:499
ClassTestErrors
tests/test_lexer.py:245
ClassTestExprPrecedence
tests/test_parser.py:262
ClassTestFixabsFixneg
Verify the trivial ABS/NEG wrappers.
tests/test_stdlib.py:589
ClassTestFixdivNumerical
Verify fixdiv produces correct results via simulation.
tests/test_stdlib.py:471
ClassTestFixmulNumerical
Verify fixmul produces correct results via simulation.
tests/test_stdlib.py:334
ClassTestFontInjection
Inject stdlib assembly into a real .ttf and verify it compiles.
tests/test_stdlib.py:723
ClassTestFontReload
Verify font can be saved and reloaded (round-trip).
tests/test_raycaster.py:457
ClassTestFontStructure
Verify the built font has the correct tables and structure.
tests/test_raycaster.py:327
ClassTestFontStructure
Verify the structural properties of compiled fonts.
tests/test_pipeline.py:201
ClassTestFpgmContent
Verify the font program (fpgm) content.
tests/test_raycaster.py:390
ClassTestFuncCall
Compile function calls and verify push args + CALL.
tests/test_codegen.py:526
ClassTestFuncCall
tests/test_parser.py:374
ClassTestFuncDef
Compile function definitions and verify FDEF with param storage.
tests/test_codegen.py:481
ClassTestFuncDef
tests/test_parser.py:110
ClassTestFuncDef
tests/test_lexer.py:61
ClassTestFunctionMetadata
Verify stack-effect metadata is consistent.
tests/test_stdlib.py:261
ClassTestFunctionProgram
Compile a program with function definitions and calls.
tests/test_pipeline.py:135
ClassTestGameProgram
Compile a game-like program with variables, arrays, functions, if/while.
tests/test_pipeline.py:171
ClassTestGetAxis
Compile get_axis(N) and verify GETVARIATION assembly.
tests/test_codegen.py:797
ClassTestGlyphProgram
Verify glyph program generation.
tests/test_codegen.py:928
ClassTestIfElseProgram
Compile a program with if/else.
tests/test_pipeline.py:395
ClassTestIfStmt
Compile if/else and verify IF/EIF assembly.
tests/test_codegen.py:398
ClassTestIfStmt
tests/test_parser.py:151
ClassTestIndentation
tests/test_lexer.py:122
ClassTestInstructionValidity
Every generated instruction should be a valid TT mnemonic.
tests/test_codegen.py:970
ClassTestIntLiterals
tests/test_lexer.py:222
ClassTestKeywordsVsIdentifiers
tests/test_lexer.py:335
ClassTestLineNumbers
tests/test_lexer.py:358
ClassTestLocalVarDecl
tests/test_parser.py:612
ClassTestLocalVariableScoping
Verify that local variables in different functions do not conflict.
tests/test_raycaster.py:502
ClassTestLogicalOps
Verify and/or/not compile to correct TT instructions.
tests/test_codegen.py:684
ClassTestMapData
Verify the map data loading.
tests/test_raycaster.py:768
ClassTestMathTablesIntegration
Verify sin/cos table generation and integration.
tests/test_raycaster.py:704
ClassTestMinimalProgram
Compile a minimal ``var x: int = 42`` program.
tests/test_pipeline.py:98
ClassTestMultiLine
tests/test_lexer.py:262
ClassTestNestedExpr
tests/test_parser.py:452
ClassTestOperators
tests/test_lexer.py:181
ClassTestPrecedence
Compile ``a + b * c`` and verify correct order.
tests/test_codegen.py:620
ClassTestPrepContent
Verify the pre-program (prep) content.
tests/test_raycaster.py:421
ClassTestPrepProgram
Verify prep program always starts with SVTCA[0].
tests/test_codegen.py:955
ClassTestPushValue
Verify PUSHB/PUSHW selection based on value range.
tests/test_codegen.py:879
ClassTestReturnStmt
Compile return and verify expr is left on stack.
tests/test_codegen.py:575
next →1–100 of 112, ranked by callers