|
Options |
Name |
Purpose |
|
|
|
CheckForNameDot ()
|
Determines whether a period is a name-dot
Notes : Mirrors Preprocessor:CheckForNameDot. A '.' is a name-dot iff the
next character is present and not whitespace.
*/
|
|
|
|
DefGlobal (character, character)
|
Defines a global (&GLOBAL-DEFINE) macro
Notes :
@param pcName The macro name
@param pcValue The macro value
*/
|
|
|
|
DefScoped (character, character)
|
Defines a scoped (&SCOPED-DEFINE) macro in the current scope
Notes :
@param pcName The macro name
@param pcValue The macro value
*/
|
|
|
|
EnqueueIncRef (character)
|
Enqueues an include-file reference marker
Notes : Captures the reference origin (TextStart*, the position of the
opening brace) so the drained marker token reports where the
reference appeared, not where the included content starts
@param pcText The reference text
*/
|
|
|
|
EnqueueMakroRef (character, character)
|
Enqueues a (&name) macro reference marker
Notes : Captures the reference origin (TextStart*) as in EnqueueIncRef
@param pcName The full reference text ((&name))
@param pcValue The resolved expansion text
*/
|
|
|
|
INTEGER Escape ()
|
Handles a backslash / tilde escape sequence
Notes : Mirrors Preprocessor:Escape. Only ~n and ~r translate to control
characters; ~ at end of line is a line continuation (SKIP_CHAR).
@return The resulting character code, or SKIP_CHAR for a line continuation
*/
|
|
|
|
CHARACTER EvaluateDefined (character)
|
Returns the DEFINED() status of a macro name
Notes : "3" scoped define (local or ancestor), "2" named arg, "1"
global, "0" none. Named EvaluateDefined because a method
named "Defined" crashes the OpenEdge 11.7 compiler (SCL-5595).
@param pcName The macro name
@return The status digit as a string
*/
|
|
|
|
CHARACTER ExpandMacroReferences (character)
|
Expands the macro / argument references in a text
Notes : Used for a define value gathered raw (SuppressBraceExpansion):
a &GLOBAL-DEFINE / &SCOPED-DEFINE value is expanded EAGERLY at
definition time, the way the real preprocessor behaves - the
idiom "&SCOPED-DEFINE ACCESS (&ACCESS)" re-declares an include
argument as a scoped define and depends on the right-hand
reference resolving to the OUTER value; storing it raw would
make the define self-referential (SCL-5479). Only macro
((&name)) and numbered ((n) / (*)) references are expanded;
any other brace reference stays verbatim.
@param pcText The text to expand
@return The expanded text
*/
|
|
|
|
CHARACTER ExpandMacroReferences (character, integer)
|
Recursive worker of ExpandMacroReferences
Notes : The depth guard stops a (then genuinely cyclic) reference chain
@param pcText The text to expand
@param piDepth The current expansion depth
@return The expanded text
*/
|
|
|
|
CHARACTER FastScanRun (integer)
|
Bulk-scans a run of bytes of a self-delimiting character class
directly from the current top frame
Notes : Convenience overload for the kinds whose run ends at a fixed set
of bytes; only kind 4 needs a stop byte of its own.
@param piKind 1 = whitespace run, 2 = identifier run, 3 = comment body run
@return The scanned run text (empty string if none)
*/
|
|
|
|
CHARACTER FastScanRun (integer, integer)
|
Bulk-scans a run of source bytes directly from the current top
frame, bypassing the per-character cooked path
Notes : None of the character classes contains the trigger bytes { ~ \,
so scanning "while in class" stops at every trigger and at the
frame boundary automatically; the caller then resumes the
char-by-char cooked path for the boundary character. Advances the
frame position and replicates FrameGet's line/column accounting
exactly. The run is capped at 30000 bytes so the GET-STRING result
never exceeds the CHARACTER limit (the caller's loop simply calls
again for the remainder). Returns the run text, or the empty
string when the fast path does not apply (a lookahead is
buffered) or nothing was scanned.
Because the run never leaves the current top frame, no macro or
include reference can fire inside it and the source number cannot
change - which is what lets the string scanner (kind 4) guard its
verbatim capture once for the whole run (SCL-5666).
@param piKind 1 = whitespace run, 2 = identifier run, 3 = comment body
run, 4 = quoted string body run
@param piStopByte The additional byte that ends the run (kind 4: the quote
that opened the string); ignored by the other kinds
@return The scanned run text (empty string if none)
*/
|
|
|
|
INTEGER FrameGet ()
|
Reads the next byte from the current top frame, advancing its
position and (for non-macro sources) line / column
Notes : The GET-BYTE fast path replacing InputSource:Get.
@return The byte value, or EOF_CHAR when the frame is exhausted
*/
|
|
|
|
CHARACTER GetArgText (character)
|
Resolves a macro name to its text (defines, args, built-ins)
Notes : Mirrors Preprocessor:GetArgText. Precedence: local scoped define,
named include arg, ancestor scoped defines, global define,
all-args helpers and built-ins. A miss yields the empty string.
@param pcName The macro name (or "*" / "&*")
@return The resolved text
*/
|
|
|
|
CHARACTER GetArgTextByNum (integer)
|
Resolves a numbered macro argument
Notes : Mirrors Preprocessor:GetArgTextByNum.
@param piNum The 0-based argument number (arg 0 = referenced name)
@return The argument value (or the empty string when out of range)
*/
|
|
|
|
INTEGER GetChar ()
|
Returns the next cooked character (macro / escape / include
handled), one at a time
Notes : Mirrors Preprocessor:GetChar. Returns EOF_CHAR at end of input,
PROPARSE_DIRECTIVE after a consumed (&_proparse_ directive) directive,
or a character code.
@return The next character code or a sentinel
*/
|
|
|
|
INTEGER GetColumn ()
|
Returns the source column of the current character
Notes :
@return The column number
*/
|
|
|
|
INTEGER GetFileIndex ()
|
Returns the file index of the current character
Notes :
@return The file index
*/
|
|
|
|
CHARACTER GetFilename (integer)
|
Returns the file name for a given file index
Notes :
@param piIndex The file index
@return The file name (or the empty string if unknown)
*/
|
|
|
|
CHARACTER GetFileNames ()
|
Returns every file name seen during preprocessing, by file index
Notes : The result is a 1-based ABL array whose entry i + 1 holds the
name of file index i, which is the layout NodeStore:FileNames
expects (a node's FileIndex is zero based). Returns an
indeterminate array when no file was opened at all.
@return The file names, indexed by file index + 1
*/
|
|
|
|
INTEGER GetLine ()
|
Returns the source line of the current character
Notes :
@return The line number
*/
|
|
|
|
GetRawChar ()
|
Reads the next raw (un-cooked) character from the source stack
Notes : Mirrors Preprocessor:GetRawChar. Handles the pop cascade and the
synthetic space injected at an include boundary.
*/
|
|
|
|
INTEGER GetSourceNum ()
|
Returns the source number of the current character
Notes :
@return The source number
*/
|
|
|
|
HandleIncludeReference (character, character)
|
Handles an include-file reference [ filename args ]
Notes : Mirrors Preprocessor:HandleIncludeReference. Parses the file name
and numbered / named arguments, opens the include (unless in a
consumed &IF branch) and enqueues an INCLUDEFILEREFERENCE marker.
@param pcRefText The full (expanded) reference text including the braces
@param pcMarkerText The original (unexpanded) reference text for the marker
*/
|
|
|
|
CHARACTER IncludeRefArg (character, integer, integer)
|
Reads one include-reference argument (whitespace-delimited,
honouring ~"-quoted runs)
Notes : Mirrors Preprocessor:IncludeRefArg.
@param pcText The text
@param piPos The current 1-based position (advanced past the argument)
@param piLen The text length
@return The argument value
*/
|
|
|
|
CHARACTER IncRefDequeue ()
|
Dequeues the next include-file reference text
Notes :
@return The reference text
*/
|
|
|
|
CHARACTER IncRefDequeue (integer, integer, integer, integer)
|
Dequeues the next include-file reference text with its origin
Notes : The origin is the position of the reference (the opening brace)
in the file that contains it (SCL-5479)
@param piFile The file index the reference appeared in
@param piLine The line of the reference
@param piCol The column of the reference
@param piSrc The source number of the frame containing the reference
@return The reference text
*/
|
|
|
|
LOGICAL IncRefIsEmpty ()
|
Returns whether the include-reference queue is empty
Notes :
@return Logical value
*/
|
|
|
|
LOGICAL IsAllDigits (character)
|
Returns whether a string consists solely of digits
Notes :
@param pcText The text to test
@return Logical value
*/
|
|
|
|
LOGICAL IsWhitespaceCode (integer)
|
Returns whether a character code is whitespace
Notes :
@param piChar The character code
@return Logical value indicating whitespace
*/
|
|
|
|
LaGet ()
|
Reads one character of lookahead without consuming it
Notes : Mirrors Preprocessor:LaGet.
*/
|
|
|
|
LaUse ()
|
Consumes the buffered lookahead character as the current char
Notes : Mirrors Preprocessor:LaUse.
*/
|
|
|
|
LOGICAL MacroReference ()
|
Handles a macro / include / directive reference starting at a brace
Notes : Mirrors Preprocessor:MacroReference. Gathers the full (recursively
expanded) reference text and dispatches on its shape.
@return True if a (&_proparse_ directive) directive was consumed (GetChar must
return PROPARSE_DIRECTIVE); false otherwise (a source was pushed
or the reference contributed nothing).
*/
|
|
|
|
MakroRefDequeue (character, character)
|
Dequeues the next macro reference
Notes :
@param pcName The full reference text
@param pcValue The resolved expansion text
*/
|
|
|
|
MakroRefDequeue (character, character, integer, integer, integer, integer)
|
Dequeues the next macro reference with its origin
Notes : The origin is the position of the reference (the opening brace)
in the file that contains it (SCL-5479)
@param pcName The full reference text
@param pcValue The resolved expansion text
@param piFile The file index the reference appeared in
@param piLine The line of the reference
@param piCol The column of the reference
@param piSrc The source number of the frame containing the reference
*/
|
|
|
|
LOGICAL MakroRefIsEmpty ()
|
Returns whether the macro-reference queue is empty
Notes :
@return Logical value
*/
|
|
|
|
LOGICAL NewInclude (character)
|
Opens an include file, pushing a new scope and source
Notes : Mirrors Preprocessor:NewInclude. Skipped inside a consumed &IF
branch; a missing file raises an exception.
@param pcFileName The include file name
@return True if the include was opened, false otherwise
*/
|
|
|
|
INTEGER NextSourceNum ()
|
Returns the next unique source number
Notes : Source numbers are consumed even for empty expansions, matching
the original iSourceCounter behaviour.
@return The next source number
*/
|
|
|
|
INTEGER PopSource ()
|
Pops the top source and reports what kind of boundary was crossed
Notes : Mirrors Preprocessor:PopInput.
@return 0 = nothing left, 1 = an include file boundary was crossed,
2 = a macro / argument expansion boundary was crossed
*/
|
|
|
|
PreprocessToMemptr (memptr, integer)
|
Runs the preprocessor to the end, accumulating the cooked output
into a MEMPTR (grown by doubling), returned by reference
Notes : MEMPTR accumulation with PUT-BYTE is O(n); it avoids the O(n^2)
per-character LONGCHAR concatenation. The caller owns the returned
MEMPTR and must SET-SIZE it to 0 when done.
@param pmResult The cooked output bytes
@param piLength The number of cooked bytes written
*/
|
|
|
|
LONGCHAR PreprocessToText ()
|
Returns the fully preprocessed text of the source
Notes : Mirrors ProparseAblLexer:PreprocessSource so the folded character
engine can be verified for parity with the original pipeline
independently of tokenization. Accumulates via a MEMPTR and
converts to LONGCHAR once (O(n)).
@return The preprocessed character stream
*/
|
|
|
|
PushExpansion (character)
|
Pushes a macro / argument expansion as a new source
Notes : Mirrors Preprocessor:NewMacroRef2. An empty expansion pushes no
source but still consumes a source number.
@param pcText The expansion text
*/
|
|
|
|
PushSource (longchar, integer, integer, logical, PreproScope, logical)
|
Pushes a new character source onto the source stack
Notes :
@param plcContent The source content
@param piFileIndex The file index for position reporting
@param piSourceNum The unique source number
@param plMacro Whether this is a macro / argument expansion (line/col
stay fixed at the referencing position)
@param poScope The include scope owning this source
@param plResetPos Whether to start line / column at 1 (a real file) or to
inherit the referencing position (a macro expansion)
*/
|
|
|
|
INTEGER RegisterFile (character)
|
Registers a file name and returns its (0-based) index
Notes :
@param pcFileName The file name to register
@return The file index
*/
|
|
|
|
INTEGER SkipWhitespace (character, integer, integer)
|
Skips whitespace in a string, returning the next non-ws position
Notes :
@param pcText The text
@param piPos The current 1-based position
@param piLen The text length
@return The next non-whitespace position
*/
|
|
|
|
Undef (character)
|
Removes a macro definition (&UNDEFINE)
Notes : Removal order: local scoped name, named argument, ancestor
scoped names, global.
@param pcName The macro name
*/
|
|
|
|
WriteTrace (character)
|
Writes a diagnostic trace message to the log
Notes : Only emitted when Trace is enabled. SCL-5877: Written unfiltered
through the LogManager, so the message reaches the registered
logging stream although FoldedPP is not an active custom log
entry type. The default logging stream writes to LOG-MANAGER,
whose writes are flushed (unbuffered), so the message is visible
in the client log even while a run is still in progress.
@param pcMessage The message text
*/
|