libSBML C API  libSBML 5.8.0 C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
L3ParserSettings.h File Reference

Detailed Description

Definition of the level 3 infix-to-mathml parser settings.

Author
Lucian Smith
Include dependency graph for L3ParserSettings.h:
This graph shows which files directly or indirectly include this file:

Macros

#define L3P_AVOGADRO_IS_CSYMBOL   true
 
#define L3P_AVOGADRO_IS_NAME   false
 
#define L3P_COLLAPSE_UNARY_MINUS   true
 
#define L3P_EXPAND_UNARY_MINUS   false
 
#define L3P_NO_UNITS   false
 
#define L3P_PARSE_UNITS   true
 

Enumerations

enum  ParseLogType_t {
  L3P_PARSE_LOG_AS_LOG10 = 0,
  L3P_PARSE_LOG_AS_LN = 1,
  L3P_PARSE_LOG_AS_ERROR = 2
}
 Configuration values for handling log in formulas. More...
 

Functions

L3ParserSettings_t * L3ParserSettings_create ()
 Creates a new L3ParserSettings_t object and returns a pointer to it. More...
 
void L3ParserSettings_free (L3ParserSettings_t *settings)
 
const Model_t * L3ParserSettings_getModel (L3ParserSettings_t *settings)
 Retrieves the model associated with this L3ParserSettings_t object. More...
 
int L3ParserSettings_getParseAvogadroCsymbol (L3ParserSettings_t *settings)
 Retrieves the avogadro csymbol option associated with this L3ParserSettings_t object. More...
 
int L3ParserSettings_getParseCollapseMinus (L3ParserSettings_t *settings)
 Retrieves the collapse minus option associated with this L3ParserSettings_t object. More...
 
ParseLogType_t L3ParserSettings_getParseLog (L3ParserSettings_t *settings)
 Retrieves the log parsing option associated with this L3ParserSettings_t object. More...
 
int L3ParserSettings_getParseUnits (L3ParserSettings_t *settings)
 Retrieves the units option associated with this L3ParserSettings_t object. More...
 
void L3ParserSettings_setModel (L3ParserSettings_t *settings, const Model_t *model)
 Sets the model associated with this L3ParserSettings_t object to the provided pointer. More...
 
void L3ParserSettings_setParseAvogadroCsymbol (L3ParserSettings_t *settings, int flag)
 Sets the avogadro csymbol option associated with this L3ParserSettings_t object. More...
 
void L3ParserSettings_setParseCollapseMinus (L3ParserSettings_t *settings, int flag)
 Sets the collapse minus option associated with this L3ParserSettings_t object. More...
 
void L3ParserSettings_setParseLog (L3ParserSettings_t *settings, ParseLogType_t type)
 Sets the log parsing option associated with this L3ParserSettings_t object. More...
 
void L3ParserSettings_setParseUnits (L3ParserSettings_t *settings, int flag)
 Sets the units option associated with this L3ParserSettings_t object. More...
 
void L3ParserSettings_unsetModel (L3ParserSettings_t *settings)
 Unsets the model associated with this L3ParserSettings_t object. More...
 

Macro Definition Documentation

#define L3P_AVOGADRO_IS_CSYMBOL   true

Recognize 'avogadro' as an SBML Level 3 symbol.

See Also
getParseAvogadroCsymbol()
setParseAvogadroCsymbol()
#define L3P_AVOGADRO_IS_NAME   false

Do not treat 'avogadro' specially—consider it a plain symbol name.

See Also
getParseAvogadroCsymbol()
setParseAvogadroCsymbol()
#define L3P_COLLAPSE_UNARY_MINUS   true

Collapse unary minuses where possible.

See Also
getParseCollapseMinus()
setParseCollapseMinus()
#define L3P_EXPAND_UNARY_MINUS   false

Retain unary minuses in the AST representation.

See Also
getParseCollapseMinus()
setParseCollapseMinus()
#define L3P_NO_UNITS   false

Do not recognize units in text-string formulas—treat them as errors.

See Also
setParseCollapseMinus()
getParseCollapseMinus()
#define L3P_PARSE_UNITS   true

Parse units in text-string formulas.

See Also
setParseCollapseMinus()
getParseCollapseMinus()

Enumeration Type Documentation

Configuration values for handling log in formulas.

Enumerator
L3P_PARSE_LOG_AS_LOG10 

Parse log(x) as the base-10 logarithm of x.

L3P_PARSE_LOG_AS_LN 

Parse log(x) as the natural logarithm of x.

L3P_PARSE_LOG_AS_ERROR 

Refuse to parse log(x) at all, and set an error message telling the user to use log10(x), ln(x), or log(base, x) instead.

Function Documentation

L3ParserSettings_t* L3ParserSettings_create ( )

Creates a new L3ParserSettings_t object and returns a pointer to it.

Note
This functions sets the Model* to NULL, and other settings to L3P_PARSE_LOG_AS_LOG10, L3P_EXPAND_UNARY_MINUS, L3P_PARSE_UNITS, and L3P_AVOGADRO_IS_CSYMBOL.
Returns
a pointer to the newly created L3ParserSettings_t structure.
void L3ParserSettings_free ( L3ParserSettings_t *  settings)
const Model_t* L3ParserSettings_getModel ( L3ParserSettings_t *  settings)

Retrieves the model associated with this L3ParserSettings_t object.

Parameters
settingsthe L3ParserSettings_t structure from which to get the Model.
Returns
the Model_t* object associated with this L3ParserSettings_t object.
int L3ParserSettings_getParseAvogadroCsymbol ( L3ParserSettings_t *  settings)

Retrieves the avogadro csymbol option associated with this L3ParserSettings_t object.

Parameters
settingsthe L3ParserSettings_t structure from which to get the option.
Returns
an integer indicating whether avogadro should be considered as a csymbol (non-zero) or not (zero).
int L3ParserSettings_getParseCollapseMinus ( L3ParserSettings_t *  settings)

Retrieves the collapse minus option associated with this L3ParserSettings_t object.

This option allows the user to specify how the infix expression '-4' is parsed in a MathML ASTNode.

Parameters
settingsthe L3ParserSettings_t structure from which to get the option.
Returns
an integer indicating whether unary minus should be collapsed (non-zero) or not (zero).
ParseLogType_t L3ParserSettings_getParseLog ( L3ParserSettings_t *  settings)

Retrieves the log parsing option associated with this L3ParserSettings_t object.

This option allows the user to specify how the infix expression 'log(x)' is parsed in a MathML ASTNode. The options are:

  • L3P_PARSE_LOG_AS_LOG10 (0)
  • L3P_PARSE_LOG_AS_LN (1)
  • L3P_PARSE_LOG_AS_ERROR (2)
Parameters
settingsthe L3ParserSettings_t structure on which to set the Model.
Returns
ParseLogType_t log parsing option to associate with this L3ParserSettings_t object.
int L3ParserSettings_getParseUnits ( L3ParserSettings_t *  settings)

Retrieves the units option associated with this L3ParserSettings_t object.

Parameters
settingsthe L3ParserSettings_t structure from which to get the option.
Returns
an integer indicating whether numbers should be considered as a having units (non-zero) or not (zero).
void L3ParserSettings_setModel ( L3ParserSettings_t *  settings,
const Model_t *  model 
)

Sets the model associated with this L3ParserSettings_t object to the provided pointer.

Note
A copy of the Model is not made, so modifications to the Model itself may affect future parsing.
Parameters
settingsthe L3ParserSettings_t structure on which to set the Model.
modelThe Model* object to which infix strings are to be compared.
void L3ParserSettings_setParseAvogadroCsymbol ( L3ParserSettings_t *  settings,
int  flag 
)

Sets the avogadro csymbol option associated with this L3ParserSettings_t object.

Parameters
settingsthe L3ParserSettings_t structure on which to set the option.
flagan integer indicating whether avogadro should be considered as a csymbol (non-zero) or not (zero).
void L3ParserSettings_setParseCollapseMinus ( L3ParserSettings_t *  settings,
int  flag 
)

Sets the collapse minus option associated with this L3ParserSettings_t object.

This option allows the user to specify how the infix expression '-4' is parsed in a MathML ASTNode.

Parameters
settingsthe L3ParserSettings_t structure on which to set the option.
flagan integer indicating whether unary minus should be collapsed (non-zero) or not (zero).
void L3ParserSettings_setParseLog ( L3ParserSettings_t *  settings,
ParseLogType_t  type 
)

Sets the log parsing option associated with this L3ParserSettings_t object.

This option allows the user to specify how the infix expression 'log(x)' is parsed in a MathML ASTNode. The options are:

  • L3P_PARSE_LOG_AS_LOG10 (0)
  • L3P_PARSE_LOG_AS_LN (1)
  • L3P_PARSE_LOG_AS_ERROR (2)
Parameters
settingsthe L3ParserSettings_t structure on which to set the option.
typeParseLogType_t log parsing option to associate with this L3ParserSettings_t object.
void L3ParserSettings_setParseUnits ( L3ParserSettings_t *  settings,
int  flag 
)

Sets the units option associated with this L3ParserSettings_t object.

Parameters
settingsthe L3ParserSettings_t structure on which to set the option.
flagan integer indicating whether numbers should be considered as a having units (non-zero) or not (zero).
void L3ParserSettings_unsetModel ( L3ParserSettings_t *  settings)

Unsets the model associated with this L3ParserSettings_t object.

Parameters
settingsthe L3ParserSettings_t structure on which to unset the Model.