| Commit | Date | |
|---|---|---|
|
[r13023]
by
mikeaubury
4glc: two parsing hot spots - 4glc is now about a third faster Profiled 4glc compiling a 7737 line module (callgrind, since perf is not 1. A4GL_get_current_comments() declared char buff[200000]=""; An initialiser on an array that size makes the compiler zero all 200KB on 2. FGLPARSE_allow_token_state() was the linear scan version. The token groups 7737 lines: 0.58s -> 0.39s Both verified. The comment change was A/B'd on the path that actually uses What is left is the semantic value stack. The %union carries char str[12288], |
2026-08-31 16:03:50 | Tree |
|
[r13022]
by
mikeaubury
4glc: build the keyword state table from bison --xml, keep y.output as fallback The per-state "which tokens can the parser accept here" table was scraped out bison's --xml report carries exactly the same information, including the --xml is not in every bison and passing -x to one without it is fatal, so The script is now two small extractors - one for XML, one for y.output - Also made the group dedup deterministic. The key was built by "for (a in arr)", Verified: both routes produce the same mk_states.c, full build clean, and the |
2026-08-31 15:30:46 | Tree |
|
[r13021]
by
mikeaubury
4glc: record why the keyword/identifier table is scraped from y.output Reading bison's y.output to build the per-state token table looks like it Those tables only carry a state's EXPLICIT actions. A token that is acceptable 1025 module_globals_section: actual_globals_section . [$end, KW_CSTART, ... Only GLOBALS has a yypact entry, but MAIN, FUNCTION, DEFINE and the rest are Answering the question from the tables alone would mean following default So the y.output dependency is not a shortcut, it is the only route to the No functional change. |
2026-08-31 14:53:37 | Tree |
|
[r13020]
by
mikeaubury
4glc: emit the last parser state's token group, and bounds check the lookup mk_states_c builds the per-state "which keyword tokens can the parser accept With the current grammar that is 4732 states (0-4731) described by 4731 The per-state flush is now a function called from both the state header and Also added a bounds check. An out of range state now returns 1 (treat the word The same two changes are made in mk_states_opt.c, which generates the bsearch No behaviour change, as expected for a state that was never consulted: the full |
2026-08-31 14:46:26 | Tree |
|
[r13019]
by
mikeaubury
P-code: fix the typedef rule reading its type through the wrong union member The TYPEDEF rule passed $<define_variables>2 for a dtype, but dtype yields A typedef name is only ever used as a pointer target or a sizeof operand, and Two things fell out of testing it: * dtype had no pointer form for a typedef name, so "_dynelem_aa *aa=0;" - which * add_default_struct_list() was static; it is now exported so the rule can build Also removed three leftover debug printfs that went to stdout on every typedef The p-code corpus run is now 28 passing with a single compile failure left - a Grammar and lexer only; the C code generator is untouched. Full build clean, |
2026-08-31 14:18:43 | Tree |
|
[r13018]
by
mikeaubury
P-code: clear the remaining C-generation syntax errors Nine tests in the aubit4gltest corpus failed to get through c2pcode with a Most of this is on the code generation side rather than the grammar, since we * _dtype_hint was declared just before its use in the PROMPT block, after * "a4gl_sqlca.sqlcode = a4gl_status = _fetcherr" is a chained assignment, and * The generated event list declared aclfgl_event_list _sio_evt[n+1] where n * The ERR_CHK_* names are macros, and p-code skips every '#' line, so it saw Two additions to the grammar itself, both of which leave the conflict count * "struct BINDING *reread" - dtype folds pointers into the type for CHAR, INT, * sizeof of a TYPE rather than an expression, as in * A trailing comma in a brace initialiser list, which C allows and every Still failing to compile: one module using a typedef (the grammar's TYPEDEF Verified: full aubit4gltest run unchanged against the r13015 baseline - the |
2026-08-31 14:09:15 | Tree |
|
[r13017]
by
mikeaubury
P-code: register struct s_field_name and s_field_name_list Same gap as sDependantTable - these are emitted into generated code for field Found by running the aubit4gltest corpus through the p-code pipeline using each |
2026-08-31 12:51:48 | Tree |
|
[r13016]
by
mikeaubury
Make the P-code compiler and runner work; restore panel/form to the TUI link P-code The runner would not build: compilers/pcode/fgl_calls.h registered Sizes and signs, all 64 bit issues: * a4gl_htonl/a4gl_ntohl returned htonl()'s uint32_t as a long, which zero * The p-code type model said a long and a pointer were 4 bytes while the runner * A string literal's address was cast through (int) in common_eval.c, which The p-code compiler skips every '#' line, so it never sees a #define. NULL, A4GL_push_long and A4GL_push_int were still keyword-bound to constants, but An unspecified array bound is held as -1, which was multiplied into a negative On the generator side, several things emitted only for the C backend are not Suppressing the MAIN prototype means an ordinary "MAIN ... END MAIN" program TUI link Testing r12988 1098 run, 59 skipped, 35 failed The two differences are tests 706 and 1413. Run individually, 706 passes on For reference, with the TUI driver broken these runs managed 283 tests with |
2026-08-31 12:19:27 | Tree |
|
[r13015]
by
mikeaubury
Build warning cleanup, object system fixes, embedded Python Three strands of work. Build warnings Mostly noise (sign-compare, unused-but-set, missing prototypes, dead Also added svn:keywords=Id to the modules that had lost it. 4GL object system * objData->base.objectid is not a 4GL variable, so the root-scanning * Destructors are registered as "<type>.~" but A4GL_destroy_object looked * Class methods pushed a call frame on entry but only popped it on an * castTo could not be reached from 4GL at all. The lookup is a plain * Polymorphic overloads resolved backwards. getSigForTopOfStack built the New samples in tools/test/OO exercising a three-level chain (shape <- Embedded Python define p object(python) Methods: new, import, addpath, available, run, eval, call, set, get, configure detects an embeddable Python (pkg-config python3-embed, then ./configure --with-python / --without-python / (auto by default) With no python3-dev the implementation compiles away, nothing links Documented in docs/README-Python.txt, example in Verified: full build clean in both configurations, tools/test builds, and |
2026-08-30 17:49:50 | Tree |
|
[r13014]
by
mikeaubury
Fix the real bugs behind the remaining compiler warnings These are the ones set aside earlier as "the interesting shortlist" - every Memory: - compilers/4glc/parsehelp.c: malloc(sizeof(expr_str)) followed by memcpy of Logic that never ran, or always ran: - compilers/4glc/lint.c: "whencode & 0x15 == WHEN_CALL" - 0x15 masks off bit 1 Format strings: - compilers/4glc/prototypes.c: three fprintf calls passing arguments to format Left alone deliberately: compile_c.c's "arr_subscripts_len >= 0" was always true |
2026-08-27 12:18:56 | Tree |