libSBML C++ API  5.20.2
L3ParserSettings.h File Reference

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

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

Classes

class  L3ParserSettings
 

Macros

#define L3P_AVOGADRO_IS_CSYMBOL   true
 Recognize 'avogadro' as an SBML Level 3 symbol. More...
 
#define L3P_AVOGADRO_IS_NAME   false
 Do not treat 'avogadro' specially—consider it a plain symbol name. More...
 
#define L3P_COLLAPSE_UNARY_MINUS   true
 Collapse unary minuses where possible. More...
 
#define L3P_COMPARE_BUILTINS_CASE_INSENSITIVE   false
 Treat all forms of built-in functions as referencing that function, regardless of the capitalization of that string. More...
 
#define L3P_COMPARE_BUILTINS_CASE_SENSITIVE   true
 Treat only the all-lower-case form of built-in functions as referencing that function, and all other forms of capitalization of that string as referencing user-defined functions or values. More...
 
#define L3P_EXPAND_UNARY_MINUS   false
 Retain unary minuses in the AST representation. More...
 
#define L3P_MODULO_IS_PIECEWISE   false
 Parse the % symbol as an expanded 'piecewise' function (valid in all levels/versions). More...
 
#define L3P_MODULO_IS_REM   true
 Parse the % symbol as the l3v2-allowed 'rem' symbol. More...
 
#define L3P_NO_UNITS   false
 Do not recognize units in text-string formulas—treat them as errors. More...
 
#define L3P_PARSE_L3V2_FUNCTIONS_AS_GENERIC   false
 Parse the % symbol as an expanded 'piecewise' function (valid in all levels/versions). More...
 
#define L3P_PARSE_L3V2_FUNCTIONS_DIRECTLY   true
 Parse the functions added in l3v2. More...
 
#define L3P_PARSE_PACKAGE_MATH_AS_GENERIC   false
 Parse the '' symbol as an expanded 'piecewise' function (valid in all levels/versions). More...
 
#define L3P_PARSE_PACKAGE_MATH_DIRECTLY   true
 Parse the functions added in distrib. More...
 
#define L3P_PARSE_UNITS   true
 Parse units in text-string formulas. More...
 

Enumerations

enum  L3ParserGrammarLineType_t {
  INFIX_SYNTAX_NAMED_SQUARE_BRACKETS ,
  INFIX_SYNTAX_CURLY_BRACES ,
  INFIX_SYNTAX_CURLY_BRACES_SEMICOLON
}
 
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 the log function in mathematical formulas. More...
 

Detailed Description

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

Author
Lucian Smith

Macro Definition Documentation

◆ L3P_AVOGADRO_IS_CSYMBOL

#define L3P_AVOGADRO_IS_CSYMBOL   true

Recognize 'avogadro' as an SBML Level 3 symbol.

See also
L3ParserSettings::getParseAvogadroCsymbol()
L3ParserSettings::setParseAvogadroCsymbol()

◆ L3P_AVOGADRO_IS_NAME

#define L3P_AVOGADRO_IS_NAME   false

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

See also
L3ParserSettings::getParseAvogadroCsymbol()
L3ParserSettings::setParseAvogadroCsymbol()

◆ L3P_COLLAPSE_UNARY_MINUS

#define L3P_COLLAPSE_UNARY_MINUS   true

◆ L3P_COMPARE_BUILTINS_CASE_INSENSITIVE

#define L3P_COMPARE_BUILTINS_CASE_INSENSITIVE   false

Treat all forms of built-in functions as referencing that function, regardless of the capitalization of that string.

See also
L3ParserSettings::getComparisonCaseSensitivity()
L3ParserSettings::setComparisonCaseSensitivity()

◆ L3P_COMPARE_BUILTINS_CASE_SENSITIVE

#define L3P_COMPARE_BUILTINS_CASE_SENSITIVE   true

Treat only the all-lower-case form of built-in functions as referencing that function, and all other forms of capitalization of that string as referencing user-defined functions or values.

See also
L3ParserSettings::getComparisonCaseSensitivity()
L3ParserSettings::setComparisonCaseSensitivity()

◆ L3P_EXPAND_UNARY_MINUS

#define L3P_EXPAND_UNARY_MINUS   false

Retain unary minuses in the AST representation.

See also
L3ParserSettings::getParseCollapseMinus()
L3ParserSettings::setParseCollapseMinus()
Examples
translateL3Math.cpp.

◆ L3P_MODULO_IS_PIECEWISE

#define L3P_MODULO_IS_PIECEWISE   false

Parse the % symbol as an expanded 'piecewise' function (valid in all levels/versions).

See also
L3ParserSettings::getParseModuloL3v2()
L3ParserSettings::setParseModuloL3v2()

◆ L3P_MODULO_IS_REM

#define L3P_MODULO_IS_REM   true

Parse the % symbol as the l3v2-allowed 'rem' symbol.

See also
L3ParserSettings::getParseModuloL3v2()
L3ParserSettings::setParseModuloL3v2()

◆ L3P_NO_UNITS

#define L3P_NO_UNITS   false

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

See also
L3ParserSettings::getParseUnits()
L3ParserSettings::setParseUnits()

◆ L3P_PARSE_L3V2_FUNCTIONS_AS_GENERIC

#define L3P_PARSE_L3V2_FUNCTIONS_AS_GENERIC   false

Parse the % symbol as an expanded 'piecewise' function (valid in all levels/versions).

See also
L3ParserSettings::getParseL3v2Functions()
L3ParserSettings::setParseL3v2Functions()

◆ L3P_PARSE_L3V2_FUNCTIONS_DIRECTLY

#define L3P_PARSE_L3V2_FUNCTIONS_DIRECTLY   true

◆ L3P_PARSE_PACKAGE_MATH_AS_GENERIC

#define L3P_PARSE_PACKAGE_MATH_AS_GENERIC   false

Parse the '' symbol as an expanded 'piecewise' function (valid in all levels/versions).

See also
L3ParserSettings::getParseDistribFunctions()
L3ParserSettings::setParseDistribFunctions()

◆ L3P_PARSE_PACKAGE_MATH_DIRECTLY

#define L3P_PARSE_PACKAGE_MATH_DIRECTLY   true

Parse the functions added in distrib.

See also
L3ParserSettings::getParseDistribFunctions()
L3ParserSettings::setParseDistribFunctions()

◆ L3P_PARSE_UNITS

#define L3P_PARSE_UNITS   true

Parse units in text-string formulas.

See also
L3ParserSettings::getParseUnits()
L3ParserSettings::setParseUnits()

Enumeration Type Documentation

◆ L3ParserGrammarLineType_t

Enumerator
INFIX_SYNTAX_NAMED_SQUARE_BRACKETS 
INFIX_SYNTAX_CURLY_BRACES 
INFIX_SYNTAX_CURLY_BRACES_SEMICOLON 

◆ ParseLogType_t

Configuration values for handling the log function in mathematical formulas.

The L3ParserSettings object can be used to modify the behavior of the SBML Level 3-oriented formula parser. One of the behaviors that can be modified is how it should translate the function log(x). It has three different behavior modes, each settable using values from this enumeration.

See also
L3ParserSettings
SBML_parseL3FormulaWithSettings()
SBML_formulaToL3StringWithSettings()
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.