MCPcopy Create free account

hub / github.com/4RH1T3CT0R7/ttf-doom / functions

Functions584 in github.com/4RH1T3CT0R7/ttf-doom

↓ 72 callersFunctionto_fixed
Convert a Python float to 16.16 fixed-point integer. Args: value: Real number to convert. Returns: Signed 32-bit integer in
compiler/stdlib.py:39
↓ 55 callersMethod_expect
Consume a token of type *tt* or raise :class:`ParseError`.
compiler/parser.py:162
↓ 53 callersFunction_compile
Compile a DSL source string to assembly segments.
tests/test_codegen.py:64
↓ 36 callersFunction_first_decl
Return the first top-level declaration.
tests/test_parser.py:37
↓ 31 callersFunctioncompile_doom
Compile a .doom DSL source string into a .ttf font file. Runs the full compilation pipeline: 1. Parse source text into an AST. 2.
compiler/pipeline.py:175
↓ 31 callersFunctiongenerate_sin_cos_tables
Generate fixed-point sin/cos lookup tables. Divides a full circle into *entries* equal steps and computes ``sin(angle) * scale`` and ``cos(an
fontgen/math_tables.py:17
↓ 28 callersFunctionrect
(x, y, rw, rh, color)
hosts/browser/doom.js:467
↓ 28 callersFunctionrect
(x, y, rw, rh, color)
docs/doom.js:467
↓ 27 callersMethod_push_value
Generate a PUSH instruction for an integer value. Args: value: The integer to push onto the TT stack. Returns:
compiler/codegen.py:717
↓ 22 callersMethod_compile_expr
Compile an expression, leaving its result on the stack. Args: expr: An AST expression node. Returns: List of
compiler/codegen.py:242
↓ 18 callersMethodtokenize
Return the complete list of tokens for the source text.
compiler/lexer.py:189
↓ 16 callersMethodcompile
Compile a ``Program`` AST to assembly. Args: program: The root AST node. Returns: Dict with keys ``'fpgm'``,
compiler/codegen.py:112
↓ 15 callersMethodparse
Parse the complete source and return a :class:`Program` AST.
compiler/parser.py:126
↓ 14 callersMethod_match
If the current token matches any of *types*, consume and return it.
compiler/parser.py:156
↓ 14 callersMethod_peek
Return the current token without consuming it.
compiler/parser.py:142
↓ 14 callersFunctionsimulate_fixmul
Simulate the fixmul FDEF through TT arithmetic. Mirrors the instruction sequence in ``_fixmul_asm()``: 1. ``MUL[]`` -> ``(a * b) / 64`
tests/test_stdlib.py:81
↓ 13 callersFunctionfrom_fixed
Convert a 16.16 fixed-point integer back to a Python float. Args: raw: Integer in 16.16 fixed-point representation. Returns:
compiler/stdlib.py:51
↓ 12 callersMethod_expr
Top-level expression: or_expr.
compiler/parser.py:435
↓ 12 callersFunction_types
Return just the token types for *source* (excluding EOF).
tests/test_lexer.py:14
↓ 12 callersFunctionbuild_bar_glyph
Create a glyph with *num_bars* vertical rectangular contours. Each bar is a separate closed contour occupying an equal horizontal slice of th
fontgen/glyph_builder.py:19
↓ 11 callersMethod_advance
Consume and return the current token.
compiler/parser.py:146
↓ 11 callersMethodalloc_func
Allocate a function ID for an FDEF. Args: name: Function name. Returns: Assigned FDEF function ID.
compiler/allocator.py:94
↓ 10 callersFunction_parse
(src: str)
tests/test_parser.py:33
↓ 9 callersMethodalloc_var
Allocate a single storage slot for a variable. Args: name: Variable name. Returns: Assigned storage slot ind
compiler/allocator.py:55
↓ 9 callersFunctionisWall
(wx, wy)
hosts/browser/doom.js:126
↓ 9 callersFunctionisWall
(wx, wy)
docs/doom.js:126
↓ 8 callersMethod_check
Return True if the current token has the given type.
compiler/parser.py:152
↓ 8 callersFunction_trunc_div
Integer division that truncates toward zero (C / TT semantics). Python's ``//`` floors toward negative infinity, but the TrueType VM truncate
tests/test_stdlib.py:35
↓ 8 callersFunctionbuild_doom_font
Build the complete DOOM ``.ttf`` font. Args: fpgm_asm: Assembly instructions for the font program (function definitions loade
fontgen/font_builder.py:34
↓ 8 callersFunctionsimulate_fixdiv
Simulate the fixdiv FDEF through TT arithmetic. Mirrors the instruction sequence in ``_fixdiv_asm()``: 1. ``SWAP`` -
tests/test_stdlib.py:98
↓ 7 callersFunction_push_and_store
Generate assembly to store *value* at *storage_idx*. Uses ``PUSHB`` for values in [0, 255] and ``PUSHW`` otherwise. The storage index is pus
fontgen/math_tables.py:77
↓ 7 callersMethodalloc_func_locals
Allocate storage slots for function parameters. Parameters are stored in storage slots so they can be referenced by name inside the f
compiler/allocator.py:113
↓ 7 callersFunctionget_stdlib_functions
Return TT assembly bodies for every standard-library function. Each value is a list of TrueType assembly mnemonics that form the function bod
compiler/stdlib.py:67
↓ 6 callersMethod_compile_func
Emit an FDEF block for a user-defined function.
compiler/codegen.py:180
↓ 6 callersFunction_is_valid_instruction
Check whether a single assembly line is a valid TT instruction.
tests/test_codegen.py:92
↓ 6 callersFunctionbuild_notdef_glyph
Create a minimal ``.notdef`` glyph. The ``.notdef`` glyph is a required placeholder in every TrueType font. It is drawn as a simple rectangle
fontgen/glyph_builder.py:57
↓ 6 callersFunctiongenerate_prep_load_tables
Generate TrueType assembly to load sin/cos tables into storage. Emits a sequence of ``PUSHB``/``PUSHW`` + ``WS[]`` instructions that write ev
fontgen/math_tables.py:46
↓ 5 callersFunction_is_valid_instruction
Check whether a single assembly line is a valid TT instruction. Recognises: - Bare mnemonics like ``MUL[]``, ``SWAP[]`` - Push instructio
tests/test_stdlib.py:153
↓ 5 callersFunctionbuild
Compile doom.doom into a TrueType font. Args: output_path: Override for the output .ttf path. Defaults to ``doom.ttf`` in th
game/build.py:70
↓ 5 callersFunctionbuild_fpgm_assembly
Build complete ``fpgm`` assembly containing all stdlib FDEFs. Args: func_ids: Optional mapping of function name to its FDEF ID.
compiler/stdlib.py:205
↓ 5 callersFunctionget_function_metadata
Return stack-effect metadata for every stdlib function. This information is consumed by the compiler's stack-depth analyser and register allo
compiler/stdlib.py:86
↓ 5 callersMethodlookup
Look up a name in the symbol table. Searches constants, then variables, then arrays. Args: name: The identifier to look
compiler/allocator.py:149
↓ 5 callersFunctiontt_div
Simulate TrueType ``DIV[]``: ``(n2 * 64) / n1``. The VM pops n1 (top-of-stack), then n2 (below), and pushes the result. Division truncates t
tests/test_stdlib.py:62
↓ 5 callersFunctiontt_mul
Simulate TrueType ``MUL[]``: ``(a * b) / 64``. The VM pops b (top-of-stack), then a, and pushes the result. Division truncates toward zero.
tests/test_stdlib.py:53
↓ 4 callersMethod_body
Parse one or more statements until DEDENT (without consuming it).
compiler/parser.py:303
↓ 4 callersMethod_compile_stmt
Compile a single statement. Args: stmt: An AST statement node. Returns: List of assembly instructions.
compiler/codegen.py:536
↓ 4 callersMethodalloc_array
Allocate a contiguous range of storage slots for an array. Args: name: Array name. size: Number of elements.
compiler/allocator.py:74
↓ 4 callersFunctionbuild_font
Build a variable TrueType font from compiled assembly segments. Creates a font with a multi-bar glyph whose geometry is controlled by TrueTyp
compiler/pipeline.py:38
↓ 4 callersFunctionis_wall
Return True if world coordinate (*wx*, *wy*) is inside a wall.
hosts/python/dev_host.py:65
↓ 3 callersMethod_expr_stmt
Parse a standalone expression (usually a function call).
compiler/parser.py:426
↓ 3 callersMethod_skip_newlines
Consume any NEWLINE tokens at the current position.
compiler/parser.py:173
↓ 3 callersFunctioncreate_variable_poc_font
Create a variable TrueType font with a MOVE axis driving bar height. The font contains a single glyph 'A' drawn as a vertical rectangle (4 on
fontgen/variable_poc.py:21
↓ 3 callersMethoddefine_const
Register a compile-time constant. Args: name: Constant name. value: Integer value (inlined at every use site).
compiler/allocator.py:135
↓ 3 callersFunctionideal_fixmul
Reference: exact ``(a * b) / 65536`` with truncation toward zero.
tests/test_stdlib.py:123
↓ 2 callersMethod_add_expr
``mul_expr (('+' | '-') mul_expr)*``
compiler/parser.py:471
↓ 2 callersMethod_and_expr
``not_expr ('and' not_expr)*``
compiler/parser.py:447
↓ 2 callersMethod_mul_expr
``unary_expr (('*' | '/' | '%') unary_expr)*``
compiler/parser.py:480
↓ 2 callersMethod_not_expr
``'not' not_expr | comparison``
compiler/parser.py:455
↓ 2 callersFunction_parse
Parse a DSL source string into an AST.
tests/test_codegen.py:59
↓ 2 callersMethod_unary_expr
``'-' unary_expr | atom``
compiler/parser.py:489
↓ 2 callersMethod_var_decl
``var IDENT : int ( = expr )?``
compiler/parser.py:202
↓ 2 callersFunctioncreate_poc_font
Create a proof-of-concept TrueType font with hinting instructions. The font contains a single glyph 'A' drawn as a vertical rectangle (4 on-c
fontgen/poc_font.py:16
↓ 2 callersFunctiongameLoop
()
hosts/browser/doom.js:929
↓ 2 callersFunctiongameLoop
()
docs/doom.js:929
↓ 2 callersFunctionspawnEnemies
()
hosts/browser/doom.js:99
↓ 2 callersFunctionspawnEnemies
()
docs/doom.js:99
↓ 2 callersFunctionstrip_comments
(lines: list[str])
tests/test_variable_poc.py:296
↓ 2 callersFunctionstrip_comments
(lines: list[str])
tests/test_font_builder.py:221
↓ 1 callersMethod__init__
(self, source: str)
compiler/parser.py:120
↓ 1 callersMethod__init__
(self, source: str)
compiler/lexer.py:183
↓ 1 callersMethod_args
``(expr (',' expr)*)?``
compiler/parser.py:540
↓ 1 callersMethod_array_decl
``array IDENT [ INT_LITERAL ]``
compiler/parser.py:242
↓ 1 callersMethod_assignment_or_expr_stmt
Parse IDENT-led statement: assignment, array assignment, or expr.
compiler/parser.py:387
↓ 1 callersMethod_atom
Parse an atomic expression. ``INT_LITERAL | IDENT '(' args ')' | IDENT '[' expr ']' | IDENT | '(' expr ')'``
compiler/parser.py:496
↓ 1 callersMethod_comparison
``add_expr (comp_op add_expr)?``
compiler/parser.py:462
↓ 1 callersMethod_compile_array_access
Compile an array element read: ``arr[i]``. Assembly: compile index, push base, ADD, RS.
compiler/codegen.py:517
↓ 1 callersMethod_compile_array_assignment
Compile ``arr[i] = expr``. Assembly: compile value, compile index, push base, ADD, SWAP, WS. WS pops index (top) then value (below),
compiler/codegen.py:590
↓ 1 callersMethod_compile_assignment
Compile ``target = expr``. Assembly: compile expr, push storage index, SWAP, WS.
compiler/codegen.py:568
↓ 1 callersMethod_compile_binop
Compile a binary operation.
compiler/codegen.py:293
↓ 1 callersMethod_compile_func_call
Compile a function or intrinsic call.
compiler/codegen.py:374
↓ 1 callersMethod_compile_get_axis
Compile get_axis(N) intrinsic. GETVARIATION[] pushes N values onto the stack (one per axis). We need to extract the Nth value.
compiler/codegen.py:400
↓ 1 callersMethod_compile_if
Compile if/else statement. Assembly: compile condition, IF, body, (ELSE, body)?, EIF.
compiler/codegen.py:616
↓ 1 callersMethod_compile_intrinsic
Compile an intrinsic function call.
compiler/codegen.py:392
↓ 1 callersMethod_compile_local_var_decl
Compile a local variable declaration inside a function body. Allocates a new storage slot and optionally initialises it. Local variab
compiler/codegen.py:681
↓ 1 callersMethod_compile_return
Compile a return statement. If there is a return value, compile the expression so it is left on the stack for the caller. If there i
compiler/codegen.py:670
↓ 1 callersMethod_compile_set_point_y
Compile set_point_y(point_idx, coordinate_funits) intrinsic. Accepts coordinate in font units (0..1000 for a 1000-UPM font) and conve
compiler/codegen.py:456
↓ 1 callersMethod_compile_unaryop
Compile a unary operation.
compiler/codegen.py:363
↓ 1 callersMethod_compile_var_ref
Compile a variable or constant reference.
compiler/codegen.py:271
↓ 1 callersMethod_compile_while
Compile a while loop via recursive FDEF pattern. Each while loop becomes a private FDEF that tests its condition, executes the body i
compiler/codegen.py:636
↓ 1 callersMethod_const_decl
``const IDENT = INT_LITERAL``
compiler/parser.py:219
↓ 1 callersMethod_declaration
Parse one top-level declaration.
compiler/parser.py:180
↓ 1 callersFunction_fixabs_asm
Fixed-point absolute value (thin wrapper around ``ABS[]``). Stack effect: ``..., a -> ..., |a|``
compiler/stdlib.py:181
↓ 1 callersFunction_fixdiv_asm
Fixed-point 16.16 divide: ``(a << 16) / b``. Stack effect ~~~~~~~~~~~~ :: input: ..., a, b (b on top) output: ..., (a
compiler/stdlib.py:141
↓ 1 callersFunction_fixmul_asm
Fixed-point 16.16 multiply: ``(a * b) >> 16``. Stack effect ~~~~~~~~~~~~ :: input: ..., a, b (b on top) output: ...,
compiler/stdlib.py:107
↓ 1 callersFunction_fixneg_asm
Fixed-point negation (thin wrapper around ``NEG[]``). Stack effect: ``..., a -> ..., -a``
compiler/stdlib.py:191
↓ 1 callersMethod_func_def
``func IDENT ( params ) ( -> int )? : NEWLINE INDENT body DEDENT``
compiler/parser.py:255
↓ 1 callersMethod_generate_glyph
Emit glyph assembly that calls game_tick (if defined).
compiler/codegen.py:229
↓ 1 callersMethod_generate_prep
Emit prep assembly for global variable initialisation.
compiler/codegen.py:211
↓ 1 callersMethod_if_stmt
``if expr : NEWLINE INDENT body DEDENT (else ...)?``
compiler/parser.py:342
↓ 1 callersMethod_make_token
Construct a :class:`Token`, converting values where needed.
compiler/lexer.py:284
next →1–100 of 584, ranked by callers