| |
---|
| | retval = ParseConfig(cfgfile, |
---|
| | InitialSymTable={}, |
---|
| | AllowNewVars=True, |
---|
| | AllowNewNamespaces=True, |
---|
| | Debug=False, |
---|
| | LiteralVars=False |
---|
| | LiteralVars=False, |
---|
| | Debug=False |
---|
| | ) |
---|
| | |
---|
| | where: |
---|
| | |
---|
| |
---|
| | |
---|
| | Allow new namespaces to be created in the configuration file. |
---|
| | |
---|
| | .TP |
---|
| | .B Debug (Default: False) |
---|
| | |
---|
| | |
---|
| | If set to True, \*(TC will provide detailed debugging information |
---|
| | about each line processed when it returns. |
---|
| | |
---|
| | .TP |
---|
| | .B LiteralVars (Default: False) |
---|
| | |
---|
| | |
---|
| | If set to True this option enables variable substitutions within |
---|
| | \'.literal\' blocks of a configuration file. See the section in the |
---|
| | language reference below on \'.literal\' usage for details. |
---|
| | |
---|
| | .TP |
---|
| | .B Debug (Default: False) |
---|
| | |
---|
| | |
---|
| | If set to True, \*(TC will provide detailed debugging information |
---|
| | about each line processed when it returns. |
---|
| | |
---|
| | .TP |
---|
| | .B retval |
---|
| | |
---|
| |
---|
| | |
---|
| | It is important to realize that this option only disables the |
---|
| | creation of |
---|
| | .B new |
---|
| | namespaces. As discussed in the later section on namespace |
---|
| | namespaces. As discussed in the previous section on namespace |
---|
| | processing, it is possible to pass an initial symbol table to the |
---|
| | parser which has one or more pre-defined namespaces in it. Each of |
---|
| | these pre-defined namespaces is available for use throughout the |
---|
| | configuration file even if \'AllowNewNamespaces\' is set to False. |
---|
| | |
---|
| | |
---|
| | .SS The \'Debug\' API Option |
---|
| | |
---|
| | \*(TC has a fairly rich set of debugging features built into its |
---|
| | parser. It can provide some detail about each line parsed as well |
---|
| | as overall information about the parse. Be default, debugging is |
---|
| | turned off. To enable debugging, merely set \'Debug=True' in the |
---|
| | API call: |
---|
| | |
---|
| | .nf |
---|
| | retval = ParseConfig("myconfigfile", Debug=True) |
---|
| | .fi |
---|
| | |
---|
| | .SS The \'LiteralVars\' API Option |
---|
| | |
---|
| | \*(TC supports the inclusion of literal text anywhere in a |
---|
| |
---|
| | other language or text. |
---|
| | |
---|
| | |
---|
| | |
---|
| | .SS The \'Debug\' API Option |
---|
| | |
---|
| | \*(TC has a fairly rich set of debugging features built into its |
---|
| | parser. It can provide some detail about each line parsed as well |
---|
| | as overall information about the parse. Be default, debugging is |
---|
| | turned off. To enable debugging, merely set \'Debug=True' in the |
---|
| | API call: |
---|
| | |
---|
| | .nf |
---|
| | retval = ParseConfig("myconfigfile", Debug=True) |
---|
| | .fi |
---|
| | |
---|
| | .SS How \*(TC Processes Errors |
---|
| | |
---|
| | As a general matter, when \*(TC encounters an error in the |
---|
| | configuration file currently being parsed, it does two things. First, |
---|
| |
---|
| | Variable names cannot have the \'#\' character anywhere in them |
---|
| | because \*(TC sees that character as the beginning a comment. |
---|
| | |
---|
| | .IP \(bu 4 |
---|
| | Variable names cannot begin with \'.\' character. \*(TC understands |
---|
| | a leading period in a variable name to be a "namespace escape". |
---|
| | This is discussed in a later section on lexical namespaces. |
---|
| | |
---|
| | .IP \(bu 4 |
---|
| | You cannot have a variable whose name is the empty string. This is |
---|
| | illegal: |
---|
| | |
---|
| | .nf |
---|
| | = String |
---|
| | .fi |
---|
| | |
---|
| | .IP \(bu 4 |
---|
| | The variable named \'NAMESPACE\' is not available for your own |
---|
| | use. \*(TC understands this variable to hold the current lexical |
---|
| | namespace as described later in this document. If you set it |
---|
| | to a new value, it will change the namespace, so be sure this is |
---|
| | what you wanted to do. |
---|
| | |
---|
| | |
---|
| | .SS Getting And Using The Value Of A Variable |
---|
| | |
---|
| |
---|
| | |