Commit Graph

8 Commits

Author SHA1 Message Date
Jose Luis Montañes Ojados
14b6a2ddd2 Add * and / operators, VM step debugger, and visualizer tweaks
Support multiply and divide in lexer, parser and eval.
Add step-by-step VM debug output with AST and heap visualization.
Remove spacing in visualizer hex output.
2026-02-16 02:24:37 +01:00
Jose Luis Montañes Ojados
01740d4892 Add evaluator with environment and file-based execution
Implements recursive AST evaluator with variable environment,
reads .j files from command line args, and executes programs
end-to-end (lexer -> parser -> eval).
2026-02-16 02:08:54 +01:00
Jose Luis Montañes Ojados
e2896fac5b Add lexer, parser and AST debug printer
Implements tokenizer for basic tokens (INT, ID, ASSIGN, PLUS, MINUS, NEWLINE, PRINT),
recursive descent parser for assignments and binary expressions, and
tree-formatted AST visualization with ast_debug().
2026-02-16 01:36:41 +01:00
Jose Luis Montañes Ojados
d14227efeb Add list type, obj_free for compound types, and self-reference guard
- Implement OBJ_LIST with offset-based items array and capacity
- obj_free now releases child allocations (string buffer, list items)
- obj_print detects self-referencing lists to prevent infinite recursion
- Visualizer distinguishes freed blocks (JLANG_NOT_USE) from active ones
- JLANG_free now zeroes payload on release
2026-02-16 00:33:02 +01:00
Jose Luis Montañes Ojados
13c9d052a0 Refactor allocator to use offsets instead of absolute pointers
JLANG_malloc now returns size_t offsets relative to the heap buffer,
making all references stable across heap growth (realloc). Object API
updated accordingly: constructors return offsets, obj_print/obj_free
receive (allocator, offset). Added heap auto-grow when out of space.
2026-02-15 23:17:51 +01:00
Jose Luis Montañes Ojados
5dc0946a19 add JLANG_free and Object 2026-02-15 22:12:19 +01:00
Jose Luis Montañes Ojados
c90883ac27 base allocator logic 2026-02-15 20:57:19 +01:00
Jose Luis Montañes Ojados
74b426e12d first commit 2026-02-15 20:48:01 +01:00