Menu

Commit [r13079]  Maximize  Restore  History

dotnet: qualify the builtins, so a program may reuse their names

Every builtin that can be static now lives on the static Fgl class and
is emitted as Fgl.X. Only the few that need the running session -
errorlog, err_get, lastkeypress and the SQLCA/flag members - stay
unqualified on FglModule.

The point is namespace: a builtin on the module base class reserves that
name across every 4GL program, so a program with its own function called
Current, or readln, or getuser, silently hides one. Adding Current in
r13077 collided with a member of that name in our own test example,
which was the warning. Since the generator decides how these are
written, the fix is to write them qualified rather than to hope the
names never clash - and Fgl.Pad, Fgl.Clipped and Fgl.Length were
already emitted that way, so this makes the surface consistent rather
than introducing a new convention.

Most of it went into map_fname's table, which is where a 4GL name is
turned into a .NET one; three sites emit their names directly and were
changed there. CURRENT is now one method taking an optional qualifier,
rather than a property and a separate CurrentQual.

The reservation that remains is deliberate and small. It is worth
knowing it exists: those few names are still spent.

On the large application this is 99 errors down to 94 - the qualifying
is not about the count, it is about what the generated code is allowed
to be. 203 runtime tests pass and the six end-to-end programs still
agree with the C runtime.

mikeaubury 2026-09-04

changed /aubit4glsrc/trunk/dotnet/src/Aubit4GL.Runtime/Types/FglBuiltins.cs
changed /aubit4glsrc/trunk/lib/liblex/lex_cs/compile_cs.c
changed /aubit4glsrc/trunk/lib/liblex/lex_cs/runtime/FglEnvironment.cs
added /aubit4glsrc/trunk/lib/liblex/lex_cs/runtime/FglModuleBuiltins.cs
changed /aubit4glsrc/trunk/lib/liblex/lex_cs/runtime/FglProcess.cs
changed /aubit4glsrc/trunk/lib/liblex/lex_cs/runtime/FglStrings.cs
/aubit4glsrc/trunk/dotnet/src/Aubit4GL.Runtime/Types/FglBuiltins.cs Diff Switch to side-by-side view
Loading...
/aubit4glsrc/trunk/lib/liblex/lex_cs/compile_cs.c Diff Switch to side-by-side view
Loading...
/aubit4glsrc/trunk/lib/liblex/lex_cs/runtime/FglEnvironment.cs Diff Switch to side-by-side view
Loading...
/aubit4glsrc/trunk/lib/liblex/lex_cs/runtime/FglModuleBuiltins.cs Diff Switch to side-by-side view
Loading...
/aubit4glsrc/trunk/lib/liblex/lex_cs/runtime/FglProcess.cs Diff Switch to side-by-side view
Loading...
/aubit4glsrc/trunk/lib/liblex/lex_cs/runtime/FglStrings.cs Diff Switch to side-by-side view
Loading...