[ Pobierz całość w formacie PDF ]

@matchRealConst. If this
Same parameters as @matchIntConst or function matches a string
@matchRealConst; see those functions at the beginning of str that
for details. is a legal numeric con-
stant, it will convert that
value to numeric form
(int32 or real80) and store
the value into matched.
This function returns any
following characters in
rem.
@matchStrConst @matchStrConst( str, rem, matched) This function returns true
if str begins with an HLA
Same parameters as @matchID; see compatible literal string
@matchID for details. constant. If this function
matches such a constant, it
will store the matched
string, minus the delimit-
ing quotes, into the
matched variable. It will
also store any following
charcters into rem.
Beta Draft - Do not distribute © 2001, By Randall Hyde Page 1519
AppendixH
Table 10: Miscellaneous Compile-time Pattern Matching Functions
Function Parameters Description
@zeroOrMoreWS @zeroOrMoreWS( str, rem ) This function always
returns true. It matches
str must be a string expression. zero or more "whitespace"
characters at the beginning
rem is an optional argument. of str.
The type of rem is irrelevant but it must
be a VAL object. Whitespace includes
spaces, newlines, tabs, and
certain other special char-
acters.
Note that this function
does not return the
matched string. To return
matched whitespace char-
acters, use @zeroOr-
MoreCset.
@oneOrMoreWS @oneOrMoreWS( str, rem ) This function returns true
if it matches at least one
str must be a string expression. whitespace character. If it
returns true, it also returns
rem is an optional argument. any characters following
The type of rem is irrelevant but it must the leading whitespace
be a VAL object. This function stores a characters in the rem vari-
result into this object. able.
@wsOrEOS @wsOrEOS( str, rem ) This function succeeds if
there is whitespace at the
str must be a string expression. beginning of str or if str is
the empty string. If it suc-
rem is an optional argument. ceeds and there is leading
The type of rem is irrelevant but it must whitespace, this function
be a VAL object. This function stores a returns the remaining
result into this object. characters in rem. If this
function succeeds and the
string was empty, this
function returns the empty
string in rem. This func-
tion fails if the string is not
empty and it begins with
non-whitespace charac-
ters.
Page 1520 © 2001, By Randall Hyde Beta Draft - Do not distribute
Appendix H: HLA Compile-time Functions
Table 10: Miscellaneous Compile-time Pattern Matching Functions
Function Parameters Description
@wsThenEOS @wsThenEOS( str ) This function returns true
if str contains zero or more
str must be a string expression. whitespace characters fol-
lowed by the end of the
string. If fails if there are
any other characters in the
string.
@peekWS @peekWS( str, rem ) This function returns true
if the next character in str
str must be a string expression. is a whitespace character.
This function returns a
rem is an optional argument. copy of str in rem if it is
The type of rem is irrelevant but it must successful.
be a VAL object. This function stores a
result into this object.
@eos @eos( str ) This function returns true
if and only if str is the
str must be a string expression. empty string.
H.7 HLA Information and Symbol Table Functions
The symbol table functions provide access to information in HLA s internal symbol table database.
These functions are particularly useful within macros to determine how to generate code for a particular
macro parameter.
Table 11: HLA Information and Compile-time Symbol Table Information Functions
Function Parameters Description
@name @name( identifier ) This function returns a string speci-
fying the name of the specified
identifier must be a defined sym- identifier. The name this function
bol in the HLA program. returns is computed after macro and
text constant expansion. This func-
tion is useful mainly in macros to
determine the name of a macro
parameter.
Beta Draft - Do not distribute © 2001, By Randall Hyde Page 1521
AppendixH
Table 11: HLA Information and Compile-time Symbol Table Information Functions
Function Parameters Description
@type @type( identifier ) This function returns a dword con-
stant that should be unique for any
identifier must be a defined sym- given type in the program. You can
bol in the HLA program. use this to compare the types of two
different objects. For guaranteed
uniqueness, see @typeName.
@typeName @typeName( identifier ) This function returns a string that
specifies the type of of the parame-
identifier must be a defined sym- ter.
bol in the HLA program. [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • blogostan.opx.pl