| MC API | Subsystem list | Top level |
A Lexical Analyzer, or Lexer for short, reads an input stream and breaks it up into meaningful syntactic units called "tokens". The input stream is normally an ASCII file; the stream is a stream of characters.
Defined in: Shared/Lexer.inc
LEXtoken - a token type
void
| PushFile
| (string sFileName)
|
void
| PushStrings
| (list of string lsTheInput)
|
void
| ClearInputs
| ()
|
string
| GetFileName
| ()
|
LEXtoken
| GetToken
| (out anytype aValue optional, out anytype tType optional)
|
void
| UnGet
| ()
|
string
| ErrorInfo
| (out string sFileName, out integer iLine, out string sInput,
out integer iInputPosition)
|
type LEXtoken is enum { /* see below */ }
eLEX_NAME
| A symbolic name consisting of 'A'-'Z', 'a'-'Z', '_' (underscore), and '0'-'9'. It may not start with a digit. |
eLEX_BOOLEAN
| "TRUE", "true", "FALSE", or "false" |
eLEX_STRING
| A sequence of characters beginning or ending with a single or double quote. The ending quote must be the same character as the beginning quote. |
eLEX_NUMBER
| An integer or floating point number, optionally preceded by a minus sign. |
eLEX_EQUALS
| |
eLEX_SEMICOLON
| |
eLEX_OPEN_CURLY
| |
eLEX_CLOSE_CURLY
| |
eLEX_COMMA
| |
eLEX_END_OF_INPUT
|
void PushFile (string sFileName)
sFileNameX_LEX_INPUT_STACKvoid PushStrings (list of string lsTheInput)
lsTheInputvoid ClearInputs ()
string GetFileName()
ReturnsLEXtoken GetToken
(out anytype aValue optional, out anytype tType optional)
ReturnsaValuetTypeX_LEX_SYNTAX_ERRORErrorInfo
to get more information about the error.void LEXunGet ()
string ErrorInfo (out string sFileName, out integer iLine, out string sInput,
out integer iInputPosition)
ReturnssFileNameiLinesInputiInputPositionLast updated 9 April 1998.