Section contents
cdescriptor.oxh
this& = NewLex&:
Creates a lexical analyser object and returns a handle which allows the object to be manipulated.
this& |
An value which represents the created lexical analyser object |
If the object could not be created then an error is generated
which should be trapped by an ONERR
handler.
LOCAL this& this& = NewLex&: DeleteLex:(this&)
this& = NewLex2&:(str$)
Creates a lexical analyser object and returns a handle which allows the object to be manipulated.
str$ |
A string to initialise the analyser |
this& |
An value which represents the created lexical analyser object |
If the object could not be created then an error is generated
which should be trapped by an ONERR
handler.
LOCAL this& this& = NewLex2&:("a line to analyse") DeleteLex:(this&)
this& = NewLex3&:(des&)
Creates a lexical analyser object and returns a handle which allows the object to be manipulated.
des& |
A handle to a descriptor object |
this& |
An value which represents the created lexical analyser object |
If the object could not be created then an error is generated
which should be trapped by an ONERR
handler.
LOCAL this&,des& des& = NewDesAlloc(20) DesCopyStr:(des&,"a line to analyser") this& = NewLex3&:(des&) DeleteDes(des&) DeleteLex:(this&)
this& = NewLex4&:(lex&)
Creates a lexical analyser object and returns a handle which allows the object to be manipulated.
lex& |
A handle to a lexical analyser object |
this& |
An value which represents the created lexical analyser object |
If the object could not be created then an error is generated
which should be trapped by an ONERR
handler.
LOCAL this&,lex& lex& = NewLex2&:("this is a line") this& = NewLex4&:(lex&) DeleteLex:(this&) DeleteLex:(lex&)
DeleteLex:(BYREF this&)
Destroys the lexical analyser object.
BYREF this& |
A handle to a lexical analyser object |
LOCAL this& this& = NewLex&: DeleteLex:(this&)
LexAssign:(this&,lex&)
Assigns the constents of the lexical analyser object lex&
to the lexical analyser object this&
..
this& |
A handle to a lexical analyser object |
lex& |
A handle to a lexical analyser object |
LexAssignDes:(this&,des&)
Assigns the contents of the descriptor des&
to the lexical analyser object this&
..
this& |
A handle to a lexical analyser object |
des& |
A handle to a descriptor object |
LexAssignStr:(this&,str$)
Assigns the contents of the string str$
to the
lexical analyser object this&
..
this& |
A handle to a lexical analyser object |
str$ |
A string |
result% = LexEos%:(this&)
Returns the True (-1) if the current character position is at the end of the lexical analyser's buffer contents, otherwise it returns False (0)..
this& |
A handle to a lexical analyser object |
result% |
True(-1) if and the end of the string, other False (0) |
char% = LexGet%:(this&)
Returns the next character from the input string and advances the character position one place.
this& |
A handle to a lexical analyser object |
char% |
The next character or 0 if at the end of the input string |
LexInc:(this&,number&)
Advances the character position by number&
positions.
this& |
A handle to a lexical analyser object |
number& |
The number of character positions to increment |
LexMark:(this&,make&)
<TBS>
this& |
A handle to a lexical analyser object |
mark& |
A handle to a lexical markt, or 0 for the default mark |
offset& = LexMarkedOffset&:(this&,mar&)
Returns the offset of the marked token from the start of the buffer.
this& |
A handle to a lexical analyser object |
mark& |
A handle to a lexical markt, or 0 for the default mark |
offset& |
The offset of the default maked token |
des& = LexMarkedToken&:(this&)
Returns the marked token as a descriptor.
this& |
A handle to a lexical analyser object |
des& |
The current token as a descriptor object |
If the des&
object cannot be created then an
error is generated which should be trapped by an ONERR
handler.
token$ = LexMarkedTokenStr$:(this&)
Returns the marked token as a string.
this& |
A handle to a lexical analyser object |
token$ |
The current token |
If the token$
string cannot be created then an
error is generated which should be trapped by an ONERR
handler.
des& = LexNextToken&:(this&)
Skips white space and returns the next token as a descriptor object.
this& |
A handle to a lexical analyser object |
des& |
The next token as a descriptor object |
If the des&
object cannot be created then an
error is generated which should be trapped by an ONERR
handler.
token$ = LexNextTokenStr$:(this&)
Skips white space and returns the next token as a string.
this& |
A handle to a lexical analyser object |
token$ |
The next token |
If the token$
string cannot be created then an
error is generated which should be trapped by an ONERR
handler.
offset& = LexOffset&:(this&)
Returns the offset of the current character position from the start of the string.
this& |
A handle to a lexical analyser object |
offset& |
The offset of the current character position from the start of the string |
char% = LexPeek%:(this&)
Returns the next character that would be retirn by LexGet:
this& |
A handle to a lexical analyser object |
char% |
The next character or 0 if at the end of the input string |
des& = LexRemainder&:(this&)
Returns the remainder of the string in the lexical buffer from the current position to the end of the string.
this& |
A handle to a lexical analyser object |
des& |
The remainder of the string from the current position to the end of the string returned as a descriptor object |
If the des&
object cannot be created then an
error is generated which should be trapped by an ONERR
handler.
str$ = LexRemainderStr&:(this&)
Returns the remainder of the string in the lexical buffer from the current position to the end of the string.
this& |
A handle to a lexical analyser object |
str$ |
The remainder of the string from the current position to the end of the string |
If the str$
string cannot be created then an
error is generated which should be trapped by an ONERR
handler.
des& =
LexRemainderFromMask&:(this&,mark&)
Returns the remainder of the string in the lexical buffer from
the mark&
to the end of the string as a descriptor object.
this& |
A handle to a lexical analyser object |
mark& |
A handle to a lexical mark, or 0 for the default mark |
des& |
The remainder of the string from the mark&
to the end of the string returned as a descriptor
object |
If the des&
object cannot be created then an
error is generated which should be trapped by an ONERR
handler.
str$ = LexRemainderFromMaskStr$:(this&,mark)
Returns the remainder of the string in the lexical buffer from
the mark&
to the end of the string.
this& |
A handle to a lexical analyser object |
mark& |
A handle to a lexical mark, or 0 for the default mark |
str$ |
The remainder of the string from the mark&
to the end of the string |
If the str$
string cannot be created then an
error is generated which should be trapped by an ONERR
handler.
LexSkipAndMark:(this&,number&,mark&)
Advances the character position number&
character positions, or to the end of the string. The current
position is set into the default mark.
this& |
A handle to a lexical analyser object |
number& |
The number of character position to skip |
mark& |
A handle to a lexical mark, or 0 for the default mark |
LexSkipCharacters:(this&)
Advances the character position until the first whitespace character is encountered, or to the end of the string.
this& |
A handle to a lexical analyser object |
LexSkipSpace:(this&)
Advances the character position until the first non-whitespace character is encountered, or to the end of the string.
this& |
A handle to a lexical analyser object |
LexSkipSpaceandMark:(this&,mark&)
Advances the character position until the first non-whitespace character is encountered, or to the end of the string. The current position is set into the default mark.
this& |
A handle to a lexical analyser object |
mark& |
A handle to a lexical mark, or 0 for the default mark |
len& = LexTokenLength&:(this&,mark&)
Returns the difference between the current character position and the default mark.
this& |
A handle to a lexical analyser object |
mark& |
A handle to a lexical mark, or 0 for the default mark |
len& |
The length of the token |
LexUnget:(this&)
Decrements the current character position by one place.
this& |
A handle to a lexical analyser object |
LexUnGetToMark:(this&,mark&)
Sets the current character position to the position of the current mark..
this& |
A handle to a lexical analyser object |
mark& |
A handle to a lexical mark, or 0 for the default mark |
result% = LexVal%:(this&,BYREF value&)
<TBS>
this& |
A handle to a lexical analyser object |
BYREF value& |
Where the extracted signed integer value is placed |
err% |
The error status of the conversion operation |
result% = LexValFloat%:(this&,BYREF value,point%)
<TBS>
this& |
A handle to a lexical analyser object |
BYREF value |
Where the extracted floating point value is placed |
point% |
The character to use for the decimal point |
err% |
The error status of the conversion operation |
result% = LexValRadix%:(this&,BYREF
value&,radix&)
<TBS>
this& |
A handle to a lexical analyser object |
BYREF value& |
Where the extracted signed integer value is placed |
radix& |
The radix to use in the conversion operation |
err% |
The error status of the conversion operation |
result% = LexValRadixLimit%:(this&,BYREF
value&,radix&,limit&)
<TBS>
this& |
A handle to a lexical analyser object |
BYREF value& |
Where the extracted signed integer value is placed |
radix& |
The radix to use in the conversion operation |
limit& |
The maximum value allowed |
err% |
The error status of the conversion operation |