| MC API | Subsystem list | Top level |
Defined in: "SymbolTable.inc".
SYMmergeDupes - how to handle merge conflicts
void
| Add
| (string sName, anytype aValue)
|
void
| Set
| (string sName, anytype aValue)
|
void
| AddOrSet
| (string sName, anytype aValue)
|
void
| Delete
| (string sName)
|
boolean
| GetBoolean
| (string sName)
|
integer
| GetInteger
| (string sName)
|
list of anytype
| GetList
| (string sName)
|
real
| GetReal
| (string sName)
|
string
| GetString
| (string sName)
|
string
| Source
| (string sName)
|
boolean
| Exists
| (string sName)
|
void
| Clear
| (inout SYMtable st)
|
void
| ReadFile
| (SYMtable st, string sFileName)
|
void
| MergeFrom
| (SYMtable stMergeFrom,
optional SYMmergeType eMerge,
optional string sSource)
|
void
| Print
| ()
|
MergeFrom .
type SYMmergeDupes is enum { /* values (see below) */ };
eSYM_MERGE_KEEP
| When this option is enabled, all symbol values are preserved in the "merged into" symbol table, and only those symbols which are unique to the "merged from" symbol table are added. |
eSYM_MERGE_OVERWRITE
| When this option is enabled, all symbol values are copied in from the "merged from" symbol table. If a given symbol already existed in the "merged into" symbol table, its value (and type) are overwritten. |
eSYM_MERGE_ERROR_IF_DUPES
| When this option is enabled, an exception will be raised if a given symbol exists in both the "merged from" and "merged into" symbol tables. |
Delete,
Set,
AddOrSet.
void Add (string sName, anytype aValue)
sNameaValueX_SYM_ALREADY_EXISTSSet,
Add.
void AddOrSet (string sName, anytype aValue)
sNameaValueAdd,
Set,
Clear.
void Delete (string sName)
sName
X_SYM_NOT_FOUNDvoid Clear ()
boolean Exists (string sName)
sNameReturnsboolean GetBoolean (string sName)
sNameReturnsX_SYM_NOT_FOUNDX_SYM_TYPE_CONFLICTinteger GetInteger (string sName)
sNameReturnsX_SYM_NOT_FOUNDX_SYM_TYPE_CONFLICT
Note that this routine, unlike the other Get* routines,
is not type-safe. You are responsible for making sure that the list
contains elements of the proper type.
list of anytype GetList (string sName)
sNameReturnsX_SYM_NOT_FOUNDX_SYM_TYPE_CONFLICTreal GetReal (string sName)
sNameReturnsX_SYM_NOT_FOUNDX_SYM_TYPE_CONFLICTstring GetString (string sName)
sNameReturnsX_SYM_NOT_FOUNDX_SYM_TYPE_CONFLICT
string Source (string sName)
sNameReturnsAdd), then whatever value
was assigned at that time (possibly NULL) is returned.X_SYM_NOT_FOUNDvoid Print ( )
If a symbol exists in the symbol table prior to calling
ReadFile and the symbol file contains an
assignment of that symbol, the symbol's value is changed
to the value specified in the file.
If a symbol is assigned more than once in a file,
an exception is raised.
integer ReadFile (string sFileName)
sFileNameX_SYM_ALREADY_EXISTSX_SYM_FILE_ERRORvoid MergeFrom (SYMtable uMergeFrom,
optional SYMmergeDupes eMerge,
optional string sSource)
uMergeFromeMergeSYMmergeDupes.
This setting controls what happens when the same symbol is defined in
both symbol tables. By default, this will raise an exception, but it
is possible to specify instead that values from one symbol table or the
other are to be used.sSourceuMergeFrom will be flagged as having come from "X".
If this parameter is omitted, any copied symbol's "source" attribute
(usually a filename) will be preserved.X_SYM_ALREADY_EXISTSeSYM_MERGE_ERROR_IF_DUPES. In this event,
the uMergeInto symbol table is unmodified.
// This is an example of a symbol file. |
Each assignment statement consists of a symbol (variable) name, an equals sign, a value, and a semicolon.
The "//" syntax for comments is supported.
However, the "/* ... */" syntax is not.
Whitespace is not significant, except within a quoted string.
Symbol names are composed of alphanumeric characters and/or '_'
(underscore), and must not begin with a digit.
Strings may be delimited with either single or double quotes; the beginning and ending delimiters must match.
Numbers may optionally include a leading '-' and/or a decimal point. Currently only decimal numbers are allowed.
Lists consist of an open curly brace '{',
zero or more values separated by commas, and a close curly brace '}'.
You can logically include one symbol file in another
by using the keyword "use", followed by
a string containing a file name, followed by a semicolon.
If a symbol is assigned more than once in a file,
an exception is raised when the file is read.
See SYMreadFile.
symbol_file := [statement ";"]...
statement := assignment | "use" string
assignment := symbol_name "=" value
value := string | number | boolean | list
boolean := "TRUE" | "FALSE" | "true" | "false"
string := '"' character... '"' | "'" character... "'"
number := digit... ["." digit...] | "." digit...
list := "{" [ value ["," value]... ] "}"
Add,
AddOrSet.
void Set (string sName, anytype aValue)
sNameaValueX_SYM_NOT_FOUNDLast updated 9 September 1998.